@marleena/trb-proto 1.0.46 → 1.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3116 @@
1
+ // source: strategy/backtest.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global =
17
+ (typeof globalThis !== 'undefined' && globalThis) ||
18
+ (typeof window !== 'undefined' && window) ||
19
+ (typeof global !== 'undefined' && global) ||
20
+ (typeof self !== 'undefined' && self) ||
21
+ (function () { return this; }).call(null) ||
22
+ Function('return this')();
23
+
24
+ var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
25
+ goog.object.extend(proto, google_protobuf_timestamp_pb);
26
+ var strategy_spec_pb = require('../strategy/spec_pb.js');
27
+ goog.object.extend(proto, strategy_spec_pb);
28
+ goog.exportSymbol('proto.trb.strategy.v1.BacktestConfig', null, global);
29
+ goog.exportSymbol('proto.trb.strategy.v1.BacktestIndicatorPoint', null, global);
30
+ goog.exportSymbol('proto.trb.strategy.v1.BacktestIndicatorSeries', null, global);
31
+ goog.exportSymbol('proto.trb.strategy.v1.BacktestMetrics', null, global);
32
+ goog.exportSymbol('proto.trb.strategy.v1.BacktestRun', null, global);
33
+ goog.exportSymbol('proto.trb.strategy.v1.BacktestTask', null, global);
34
+ goog.exportSymbol('proto.trb.strategy.v1.EquityPoint', null, global);
35
+ goog.exportSymbol('proto.trb.strategy.v1.RunStatus', null, global);
36
+ goog.exportSymbol('proto.trb.strategy.v1.TradeRecord', null, global);
37
+ /**
38
+ * Generated by JsPbCodeGenerator.
39
+ * @param {Array=} opt_data Optional initial data array, typically from a
40
+ * server response, or constructed directly in Javascript. The array is used
41
+ * in place and becomes part of the constructed object. It is not cloned.
42
+ * If no data is provided, the constructed object will be empty, but still
43
+ * valid.
44
+ * @extends {jspb.Message}
45
+ * @constructor
46
+ */
47
+ proto.trb.strategy.v1.BacktestConfig = function(opt_data) {
48
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
49
+ };
50
+ goog.inherits(proto.trb.strategy.v1.BacktestConfig, jspb.Message);
51
+ if (goog.DEBUG && !COMPILED) {
52
+ /**
53
+ * @public
54
+ * @override
55
+ */
56
+ proto.trb.strategy.v1.BacktestConfig.displayName = 'proto.trb.strategy.v1.BacktestConfig';
57
+ }
58
+ /**
59
+ * Generated by JsPbCodeGenerator.
60
+ * @param {Array=} opt_data Optional initial data array, typically from a
61
+ * server response, or constructed directly in Javascript. The array is used
62
+ * in place and becomes part of the constructed object. It is not cloned.
63
+ * If no data is provided, the constructed object will be empty, but still
64
+ * valid.
65
+ * @extends {jspb.Message}
66
+ * @constructor
67
+ */
68
+ proto.trb.strategy.v1.BacktestMetrics = function(opt_data) {
69
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
70
+ };
71
+ goog.inherits(proto.trb.strategy.v1.BacktestMetrics, jspb.Message);
72
+ if (goog.DEBUG && !COMPILED) {
73
+ /**
74
+ * @public
75
+ * @override
76
+ */
77
+ proto.trb.strategy.v1.BacktestMetrics.displayName = 'proto.trb.strategy.v1.BacktestMetrics';
78
+ }
79
+ /**
80
+ * Generated by JsPbCodeGenerator.
81
+ * @param {Array=} opt_data Optional initial data array, typically from a
82
+ * server response, or constructed directly in Javascript. The array is used
83
+ * in place and becomes part of the constructed object. It is not cloned.
84
+ * If no data is provided, the constructed object will be empty, but still
85
+ * valid.
86
+ * @extends {jspb.Message}
87
+ * @constructor
88
+ */
89
+ proto.trb.strategy.v1.EquityPoint = function(opt_data) {
90
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
91
+ };
92
+ goog.inherits(proto.trb.strategy.v1.EquityPoint, jspb.Message);
93
+ if (goog.DEBUG && !COMPILED) {
94
+ /**
95
+ * @public
96
+ * @override
97
+ */
98
+ proto.trb.strategy.v1.EquityPoint.displayName = 'proto.trb.strategy.v1.EquityPoint';
99
+ }
100
+ /**
101
+ * Generated by JsPbCodeGenerator.
102
+ * @param {Array=} opt_data Optional initial data array, typically from a
103
+ * server response, or constructed directly in Javascript. The array is used
104
+ * in place and becomes part of the constructed object. It is not cloned.
105
+ * If no data is provided, the constructed object will be empty, but still
106
+ * valid.
107
+ * @extends {jspb.Message}
108
+ * @constructor
109
+ */
110
+ proto.trb.strategy.v1.TradeRecord = function(opt_data) {
111
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
112
+ };
113
+ goog.inherits(proto.trb.strategy.v1.TradeRecord, jspb.Message);
114
+ if (goog.DEBUG && !COMPILED) {
115
+ /**
116
+ * @public
117
+ * @override
118
+ */
119
+ proto.trb.strategy.v1.TradeRecord.displayName = 'proto.trb.strategy.v1.TradeRecord';
120
+ }
121
+ /**
122
+ * Generated by JsPbCodeGenerator.
123
+ * @param {Array=} opt_data Optional initial data array, typically from a
124
+ * server response, or constructed directly in Javascript. The array is used
125
+ * in place and becomes part of the constructed object. It is not cloned.
126
+ * If no data is provided, the constructed object will be empty, but still
127
+ * valid.
128
+ * @extends {jspb.Message}
129
+ * @constructor
130
+ */
131
+ proto.trb.strategy.v1.BacktestIndicatorPoint = function(opt_data) {
132
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
133
+ };
134
+ goog.inherits(proto.trb.strategy.v1.BacktestIndicatorPoint, jspb.Message);
135
+ if (goog.DEBUG && !COMPILED) {
136
+ /**
137
+ * @public
138
+ * @override
139
+ */
140
+ proto.trb.strategy.v1.BacktestIndicatorPoint.displayName = 'proto.trb.strategy.v1.BacktestIndicatorPoint';
141
+ }
142
+ /**
143
+ * Generated by JsPbCodeGenerator.
144
+ * @param {Array=} opt_data Optional initial data array, typically from a
145
+ * server response, or constructed directly in Javascript. The array is used
146
+ * in place and becomes part of the constructed object. It is not cloned.
147
+ * If no data is provided, the constructed object will be empty, but still
148
+ * valid.
149
+ * @extends {jspb.Message}
150
+ * @constructor
151
+ */
152
+ proto.trb.strategy.v1.BacktestIndicatorSeries = function(opt_data) {
153
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.trb.strategy.v1.BacktestIndicatorSeries.repeatedFields_, null);
154
+ };
155
+ goog.inherits(proto.trb.strategy.v1.BacktestIndicatorSeries, jspb.Message);
156
+ if (goog.DEBUG && !COMPILED) {
157
+ /**
158
+ * @public
159
+ * @override
160
+ */
161
+ proto.trb.strategy.v1.BacktestIndicatorSeries.displayName = 'proto.trb.strategy.v1.BacktestIndicatorSeries';
162
+ }
163
+ /**
164
+ * Generated by JsPbCodeGenerator.
165
+ * @param {Array=} opt_data Optional initial data array, typically from a
166
+ * server response, or constructed directly in Javascript. The array is used
167
+ * in place and becomes part of the constructed object. It is not cloned.
168
+ * If no data is provided, the constructed object will be empty, but still
169
+ * valid.
170
+ * @extends {jspb.Message}
171
+ * @constructor
172
+ */
173
+ proto.trb.strategy.v1.BacktestRun = function(opt_data) {
174
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
175
+ };
176
+ goog.inherits(proto.trb.strategy.v1.BacktestRun, jspb.Message);
177
+ if (goog.DEBUG && !COMPILED) {
178
+ /**
179
+ * @public
180
+ * @override
181
+ */
182
+ proto.trb.strategy.v1.BacktestRun.displayName = 'proto.trb.strategy.v1.BacktestRun';
183
+ }
184
+ /**
185
+ * Generated by JsPbCodeGenerator.
186
+ * @param {Array=} opt_data Optional initial data array, typically from a
187
+ * server response, or constructed directly in Javascript. The array is used
188
+ * in place and becomes part of the constructed object. It is not cloned.
189
+ * If no data is provided, the constructed object will be empty, but still
190
+ * valid.
191
+ * @extends {jspb.Message}
192
+ * @constructor
193
+ */
194
+ proto.trb.strategy.v1.BacktestTask = function(opt_data) {
195
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
196
+ };
197
+ goog.inherits(proto.trb.strategy.v1.BacktestTask, jspb.Message);
198
+ if (goog.DEBUG && !COMPILED) {
199
+ /**
200
+ * @public
201
+ * @override
202
+ */
203
+ proto.trb.strategy.v1.BacktestTask.displayName = 'proto.trb.strategy.v1.BacktestTask';
204
+ }
205
+
206
+
207
+
208
+ if (jspb.Message.GENERATE_TO_OBJECT) {
209
+ /**
210
+ * Creates an object representation of this proto.
211
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
212
+ * Optional fields that are not set will be set to undefined.
213
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
214
+ * For the list of reserved names please see:
215
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
216
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
217
+ * JSPB instance for transitional soy proto support:
218
+ * http://goto/soy-param-migration
219
+ * @return {!Object}
220
+ */
221
+ proto.trb.strategy.v1.BacktestConfig.prototype.toObject = function(opt_includeInstance) {
222
+ return proto.trb.strategy.v1.BacktestConfig.toObject(opt_includeInstance, this);
223
+ };
224
+
225
+
226
+ /**
227
+ * Static version of the {@see toObject} method.
228
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
229
+ * the JSPB instance for transitional soy proto support:
230
+ * http://goto/soy-param-migration
231
+ * @param {!proto.trb.strategy.v1.BacktestConfig} msg The msg instance to transform.
232
+ * @return {!Object}
233
+ * @suppress {unusedLocalVariables} f is only used for nested messages
234
+ */
235
+ proto.trb.strategy.v1.BacktestConfig.toObject = function(includeInstance, msg) {
236
+ var f, obj = {
237
+ uid: jspb.Message.getFieldWithDefault(msg, 1, ""),
238
+ interval: jspb.Message.getFieldWithDefault(msg, 2, 0),
239
+ start: (f = msg.getStart()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
240
+ end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
241
+ initialCash: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0),
242
+ commissionPct: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0),
243
+ slippagePct: jspb.Message.getFloatingPointFieldWithDefault(msg, 7, 0.0),
244
+ longOnly: jspb.Message.getBooleanFieldWithDefault(msg, 8, false)
245
+ };
246
+
247
+ if (includeInstance) {
248
+ obj.$jspbMessageInstance = msg;
249
+ }
250
+ return obj;
251
+ };
252
+ }
253
+
254
+
255
+ /**
256
+ * Deserializes binary data (in protobuf wire format).
257
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
258
+ * @return {!proto.trb.strategy.v1.BacktestConfig}
259
+ */
260
+ proto.trb.strategy.v1.BacktestConfig.deserializeBinary = function(bytes) {
261
+ var reader = new jspb.BinaryReader(bytes);
262
+ var msg = new proto.trb.strategy.v1.BacktestConfig;
263
+ return proto.trb.strategy.v1.BacktestConfig.deserializeBinaryFromReader(msg, reader);
264
+ };
265
+
266
+
267
+ /**
268
+ * Deserializes binary data (in protobuf wire format) from the
269
+ * given reader into the given message object.
270
+ * @param {!proto.trb.strategy.v1.BacktestConfig} msg The message object to deserialize into.
271
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
272
+ * @return {!proto.trb.strategy.v1.BacktestConfig}
273
+ */
274
+ proto.trb.strategy.v1.BacktestConfig.deserializeBinaryFromReader = function(msg, reader) {
275
+ while (reader.nextField()) {
276
+ if (reader.isEndGroup()) {
277
+ break;
278
+ }
279
+ var field = reader.getFieldNumber();
280
+ switch (field) {
281
+ case 1:
282
+ var value = /** @type {string} */ (reader.readString());
283
+ msg.setUid(value);
284
+ break;
285
+ case 2:
286
+ var value = /** @type {number} */ (reader.readInt32());
287
+ msg.setInterval(value);
288
+ break;
289
+ case 3:
290
+ var value = new google_protobuf_timestamp_pb.Timestamp;
291
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
292
+ msg.setStart(value);
293
+ break;
294
+ case 4:
295
+ var value = new google_protobuf_timestamp_pb.Timestamp;
296
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
297
+ msg.setEnd(value);
298
+ break;
299
+ case 5:
300
+ var value = /** @type {number} */ (reader.readDouble());
301
+ msg.setInitialCash(value);
302
+ break;
303
+ case 6:
304
+ var value = /** @type {number} */ (reader.readDouble());
305
+ msg.setCommissionPct(value);
306
+ break;
307
+ case 7:
308
+ var value = /** @type {number} */ (reader.readDouble());
309
+ msg.setSlippagePct(value);
310
+ break;
311
+ case 8:
312
+ var value = /** @type {boolean} */ (reader.readBool());
313
+ msg.setLongOnly(value);
314
+ break;
315
+ default:
316
+ reader.skipField();
317
+ break;
318
+ }
319
+ }
320
+ return msg;
321
+ };
322
+
323
+
324
+ /**
325
+ * Serializes the message to binary data (in protobuf wire format).
326
+ * @return {!Uint8Array}
327
+ */
328
+ proto.trb.strategy.v1.BacktestConfig.prototype.serializeBinary = function() {
329
+ var writer = new jspb.BinaryWriter();
330
+ proto.trb.strategy.v1.BacktestConfig.serializeBinaryToWriter(this, writer);
331
+ return writer.getResultBuffer();
332
+ };
333
+
334
+
335
+ /**
336
+ * Serializes the given message to binary data (in protobuf wire
337
+ * format), writing to the given BinaryWriter.
338
+ * @param {!proto.trb.strategy.v1.BacktestConfig} message
339
+ * @param {!jspb.BinaryWriter} writer
340
+ * @suppress {unusedLocalVariables} f is only used for nested messages
341
+ */
342
+ proto.trb.strategy.v1.BacktestConfig.serializeBinaryToWriter = function(message, writer) {
343
+ var f = undefined;
344
+ f = message.getUid();
345
+ if (f.length > 0) {
346
+ writer.writeString(
347
+ 1,
348
+ f
349
+ );
350
+ }
351
+ f = message.getInterval();
352
+ if (f !== 0) {
353
+ writer.writeInt32(
354
+ 2,
355
+ f
356
+ );
357
+ }
358
+ f = message.getStart();
359
+ if (f != null) {
360
+ writer.writeMessage(
361
+ 3,
362
+ f,
363
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
364
+ );
365
+ }
366
+ f = message.getEnd();
367
+ if (f != null) {
368
+ writer.writeMessage(
369
+ 4,
370
+ f,
371
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
372
+ );
373
+ }
374
+ f = message.getInitialCash();
375
+ if (f !== 0.0) {
376
+ writer.writeDouble(
377
+ 5,
378
+ f
379
+ );
380
+ }
381
+ f = message.getCommissionPct();
382
+ if (f !== 0.0) {
383
+ writer.writeDouble(
384
+ 6,
385
+ f
386
+ );
387
+ }
388
+ f = message.getSlippagePct();
389
+ if (f !== 0.0) {
390
+ writer.writeDouble(
391
+ 7,
392
+ f
393
+ );
394
+ }
395
+ f = message.getLongOnly();
396
+ if (f) {
397
+ writer.writeBool(
398
+ 8,
399
+ f
400
+ );
401
+ }
402
+ };
403
+
404
+
405
+ /**
406
+ * optional string uid = 1;
407
+ * @return {string}
408
+ */
409
+ proto.trb.strategy.v1.BacktestConfig.prototype.getUid = function() {
410
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
411
+ };
412
+
413
+
414
+ /**
415
+ * @param {string} value
416
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
417
+ */
418
+ proto.trb.strategy.v1.BacktestConfig.prototype.setUid = function(value) {
419
+ return jspb.Message.setProto3StringField(this, 1, value);
420
+ };
421
+
422
+
423
+ /**
424
+ * optional int32 interval = 2;
425
+ * @return {number}
426
+ */
427
+ proto.trb.strategy.v1.BacktestConfig.prototype.getInterval = function() {
428
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
429
+ };
430
+
431
+
432
+ /**
433
+ * @param {number} value
434
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
435
+ */
436
+ proto.trb.strategy.v1.BacktestConfig.prototype.setInterval = function(value) {
437
+ return jspb.Message.setProto3IntField(this, 2, value);
438
+ };
439
+
440
+
441
+ /**
442
+ * optional google.protobuf.Timestamp start = 3;
443
+ * @return {?proto.google.protobuf.Timestamp}
444
+ */
445
+ proto.trb.strategy.v1.BacktestConfig.prototype.getStart = function() {
446
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
447
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
448
+ };
449
+
450
+
451
+ /**
452
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
453
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
454
+ */
455
+ proto.trb.strategy.v1.BacktestConfig.prototype.setStart = function(value) {
456
+ return jspb.Message.setWrapperField(this, 3, value);
457
+ };
458
+
459
+
460
+ /**
461
+ * Clears the message field making it undefined.
462
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
463
+ */
464
+ proto.trb.strategy.v1.BacktestConfig.prototype.clearStart = function() {
465
+ return this.setStart(undefined);
466
+ };
467
+
468
+
469
+ /**
470
+ * Returns whether this field is set.
471
+ * @return {boolean}
472
+ */
473
+ proto.trb.strategy.v1.BacktestConfig.prototype.hasStart = function() {
474
+ return jspb.Message.getField(this, 3) != null;
475
+ };
476
+
477
+
478
+ /**
479
+ * optional google.protobuf.Timestamp end = 4;
480
+ * @return {?proto.google.protobuf.Timestamp}
481
+ */
482
+ proto.trb.strategy.v1.BacktestConfig.prototype.getEnd = function() {
483
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
484
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4));
485
+ };
486
+
487
+
488
+ /**
489
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
490
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
491
+ */
492
+ proto.trb.strategy.v1.BacktestConfig.prototype.setEnd = function(value) {
493
+ return jspb.Message.setWrapperField(this, 4, value);
494
+ };
495
+
496
+
497
+ /**
498
+ * Clears the message field making it undefined.
499
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
500
+ */
501
+ proto.trb.strategy.v1.BacktestConfig.prototype.clearEnd = function() {
502
+ return this.setEnd(undefined);
503
+ };
504
+
505
+
506
+ /**
507
+ * Returns whether this field is set.
508
+ * @return {boolean}
509
+ */
510
+ proto.trb.strategy.v1.BacktestConfig.prototype.hasEnd = function() {
511
+ return jspb.Message.getField(this, 4) != null;
512
+ };
513
+
514
+
515
+ /**
516
+ * optional double initial_cash = 5;
517
+ * @return {number}
518
+ */
519
+ proto.trb.strategy.v1.BacktestConfig.prototype.getInitialCash = function() {
520
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
521
+ };
522
+
523
+
524
+ /**
525
+ * @param {number} value
526
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
527
+ */
528
+ proto.trb.strategy.v1.BacktestConfig.prototype.setInitialCash = function(value) {
529
+ return jspb.Message.setProto3FloatField(this, 5, value);
530
+ };
531
+
532
+
533
+ /**
534
+ * optional double commission_pct = 6;
535
+ * @return {number}
536
+ */
537
+ proto.trb.strategy.v1.BacktestConfig.prototype.getCommissionPct = function() {
538
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
539
+ };
540
+
541
+
542
+ /**
543
+ * @param {number} value
544
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
545
+ */
546
+ proto.trb.strategy.v1.BacktestConfig.prototype.setCommissionPct = function(value) {
547
+ return jspb.Message.setProto3FloatField(this, 6, value);
548
+ };
549
+
550
+
551
+ /**
552
+ * optional double slippage_pct = 7;
553
+ * @return {number}
554
+ */
555
+ proto.trb.strategy.v1.BacktestConfig.prototype.getSlippagePct = function() {
556
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 7, 0.0));
557
+ };
558
+
559
+
560
+ /**
561
+ * @param {number} value
562
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
563
+ */
564
+ proto.trb.strategy.v1.BacktestConfig.prototype.setSlippagePct = function(value) {
565
+ return jspb.Message.setProto3FloatField(this, 7, value);
566
+ };
567
+
568
+
569
+ /**
570
+ * optional bool long_only = 8;
571
+ * @return {boolean}
572
+ */
573
+ proto.trb.strategy.v1.BacktestConfig.prototype.getLongOnly = function() {
574
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false));
575
+ };
576
+
577
+
578
+ /**
579
+ * @param {boolean} value
580
+ * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
581
+ */
582
+ proto.trb.strategy.v1.BacktestConfig.prototype.setLongOnly = function(value) {
583
+ return jspb.Message.setProto3BooleanField(this, 8, value);
584
+ };
585
+
586
+
587
+
588
+
589
+
590
+ if (jspb.Message.GENERATE_TO_OBJECT) {
591
+ /**
592
+ * Creates an object representation of this proto.
593
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
594
+ * Optional fields that are not set will be set to undefined.
595
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
596
+ * For the list of reserved names please see:
597
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
598
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
599
+ * JSPB instance for transitional soy proto support:
600
+ * http://goto/soy-param-migration
601
+ * @return {!Object}
602
+ */
603
+ proto.trb.strategy.v1.BacktestMetrics.prototype.toObject = function(opt_includeInstance) {
604
+ return proto.trb.strategy.v1.BacktestMetrics.toObject(opt_includeInstance, this);
605
+ };
606
+
607
+
608
+ /**
609
+ * Static version of the {@see toObject} method.
610
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
611
+ * the JSPB instance for transitional soy proto support:
612
+ * http://goto/soy-param-migration
613
+ * @param {!proto.trb.strategy.v1.BacktestMetrics} msg The msg instance to transform.
614
+ * @return {!Object}
615
+ * @suppress {unusedLocalVariables} f is only used for nested messages
616
+ */
617
+ proto.trb.strategy.v1.BacktestMetrics.toObject = function(includeInstance, msg) {
618
+ var f, obj = {
619
+ totalReturn: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0),
620
+ cagr: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0),
621
+ sharpe: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0),
622
+ sortino: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
623
+ maxDrawdown: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0),
624
+ winRate: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0),
625
+ profitFactor: jspb.Message.getFloatingPointFieldWithDefault(msg, 7, 0.0),
626
+ sqn: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 0.0),
627
+ tradesCount: jspb.Message.getFieldWithDefault(msg, 9, 0),
628
+ exposure: jspb.Message.getFloatingPointFieldWithDefault(msg, 10, 0.0),
629
+ finalEquity: jspb.Message.getFloatingPointFieldWithDefault(msg, 11, 0.0),
630
+ avgTradePct: jspb.Message.getFloatingPointFieldWithDefault(msg, 12, 0.0),
631
+ expectancy: jspb.Message.getFloatingPointFieldWithDefault(msg, 13, 0.0),
632
+ extraMap: (f = msg.getExtraMap()) ? f.toObject(includeInstance, undefined) : []
633
+ };
634
+
635
+ if (includeInstance) {
636
+ obj.$jspbMessageInstance = msg;
637
+ }
638
+ return obj;
639
+ };
640
+ }
641
+
642
+
643
+ /**
644
+ * Deserializes binary data (in protobuf wire format).
645
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
646
+ * @return {!proto.trb.strategy.v1.BacktestMetrics}
647
+ */
648
+ proto.trb.strategy.v1.BacktestMetrics.deserializeBinary = function(bytes) {
649
+ var reader = new jspb.BinaryReader(bytes);
650
+ var msg = new proto.trb.strategy.v1.BacktestMetrics;
651
+ return proto.trb.strategy.v1.BacktestMetrics.deserializeBinaryFromReader(msg, reader);
652
+ };
653
+
654
+
655
+ /**
656
+ * Deserializes binary data (in protobuf wire format) from the
657
+ * given reader into the given message object.
658
+ * @param {!proto.trb.strategy.v1.BacktestMetrics} msg The message object to deserialize into.
659
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
660
+ * @return {!proto.trb.strategy.v1.BacktestMetrics}
661
+ */
662
+ proto.trb.strategy.v1.BacktestMetrics.deserializeBinaryFromReader = function(msg, reader) {
663
+ while (reader.nextField()) {
664
+ if (reader.isEndGroup()) {
665
+ break;
666
+ }
667
+ var field = reader.getFieldNumber();
668
+ switch (field) {
669
+ case 1:
670
+ var value = /** @type {number} */ (reader.readDouble());
671
+ msg.setTotalReturn(value);
672
+ break;
673
+ case 2:
674
+ var value = /** @type {number} */ (reader.readDouble());
675
+ msg.setCagr(value);
676
+ break;
677
+ case 3:
678
+ var value = /** @type {number} */ (reader.readDouble());
679
+ msg.setSharpe(value);
680
+ break;
681
+ case 4:
682
+ var value = /** @type {number} */ (reader.readDouble());
683
+ msg.setSortino(value);
684
+ break;
685
+ case 5:
686
+ var value = /** @type {number} */ (reader.readDouble());
687
+ msg.setMaxDrawdown(value);
688
+ break;
689
+ case 6:
690
+ var value = /** @type {number} */ (reader.readDouble());
691
+ msg.setWinRate(value);
692
+ break;
693
+ case 7:
694
+ var value = /** @type {number} */ (reader.readDouble());
695
+ msg.setProfitFactor(value);
696
+ break;
697
+ case 8:
698
+ var value = /** @type {number} */ (reader.readDouble());
699
+ msg.setSqn(value);
700
+ break;
701
+ case 9:
702
+ var value = /** @type {number} */ (reader.readUint32());
703
+ msg.setTradesCount(value);
704
+ break;
705
+ case 10:
706
+ var value = /** @type {number} */ (reader.readDouble());
707
+ msg.setExposure(value);
708
+ break;
709
+ case 11:
710
+ var value = /** @type {number} */ (reader.readDouble());
711
+ msg.setFinalEquity(value);
712
+ break;
713
+ case 12:
714
+ var value = /** @type {number} */ (reader.readDouble());
715
+ msg.setAvgTradePct(value);
716
+ break;
717
+ case 13:
718
+ var value = /** @type {number} */ (reader.readDouble());
719
+ msg.setExpectancy(value);
720
+ break;
721
+ case 20:
722
+ var value = msg.getExtraMap();
723
+ reader.readMessage(value, function(message, reader) {
724
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readDouble, null, "", 0.0);
725
+ });
726
+ break;
727
+ default:
728
+ reader.skipField();
729
+ break;
730
+ }
731
+ }
732
+ return msg;
733
+ };
734
+
735
+
736
+ /**
737
+ * Serializes the message to binary data (in protobuf wire format).
738
+ * @return {!Uint8Array}
739
+ */
740
+ proto.trb.strategy.v1.BacktestMetrics.prototype.serializeBinary = function() {
741
+ var writer = new jspb.BinaryWriter();
742
+ proto.trb.strategy.v1.BacktestMetrics.serializeBinaryToWriter(this, writer);
743
+ return writer.getResultBuffer();
744
+ };
745
+
746
+
747
+ /**
748
+ * Serializes the given message to binary data (in protobuf wire
749
+ * format), writing to the given BinaryWriter.
750
+ * @param {!proto.trb.strategy.v1.BacktestMetrics} message
751
+ * @param {!jspb.BinaryWriter} writer
752
+ * @suppress {unusedLocalVariables} f is only used for nested messages
753
+ */
754
+ proto.trb.strategy.v1.BacktestMetrics.serializeBinaryToWriter = function(message, writer) {
755
+ var f = undefined;
756
+ f = message.getTotalReturn();
757
+ if (f !== 0.0) {
758
+ writer.writeDouble(
759
+ 1,
760
+ f
761
+ );
762
+ }
763
+ f = message.getCagr();
764
+ if (f !== 0.0) {
765
+ writer.writeDouble(
766
+ 2,
767
+ f
768
+ );
769
+ }
770
+ f = message.getSharpe();
771
+ if (f !== 0.0) {
772
+ writer.writeDouble(
773
+ 3,
774
+ f
775
+ );
776
+ }
777
+ f = message.getSortino();
778
+ if (f !== 0.0) {
779
+ writer.writeDouble(
780
+ 4,
781
+ f
782
+ );
783
+ }
784
+ f = message.getMaxDrawdown();
785
+ if (f !== 0.0) {
786
+ writer.writeDouble(
787
+ 5,
788
+ f
789
+ );
790
+ }
791
+ f = message.getWinRate();
792
+ if (f !== 0.0) {
793
+ writer.writeDouble(
794
+ 6,
795
+ f
796
+ );
797
+ }
798
+ f = message.getProfitFactor();
799
+ if (f !== 0.0) {
800
+ writer.writeDouble(
801
+ 7,
802
+ f
803
+ );
804
+ }
805
+ f = message.getSqn();
806
+ if (f !== 0.0) {
807
+ writer.writeDouble(
808
+ 8,
809
+ f
810
+ );
811
+ }
812
+ f = message.getTradesCount();
813
+ if (f !== 0) {
814
+ writer.writeUint32(
815
+ 9,
816
+ f
817
+ );
818
+ }
819
+ f = message.getExposure();
820
+ if (f !== 0.0) {
821
+ writer.writeDouble(
822
+ 10,
823
+ f
824
+ );
825
+ }
826
+ f = message.getFinalEquity();
827
+ if (f !== 0.0) {
828
+ writer.writeDouble(
829
+ 11,
830
+ f
831
+ );
832
+ }
833
+ f = message.getAvgTradePct();
834
+ if (f !== 0.0) {
835
+ writer.writeDouble(
836
+ 12,
837
+ f
838
+ );
839
+ }
840
+ f = message.getExpectancy();
841
+ if (f !== 0.0) {
842
+ writer.writeDouble(
843
+ 13,
844
+ f
845
+ );
846
+ }
847
+ f = message.getExtraMap(true);
848
+ if (f && f.getLength() > 0) {
849
+ f.serializeBinary(20, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeDouble);
850
+ }
851
+ };
852
+
853
+
854
+ /**
855
+ * optional double total_return = 1;
856
+ * @return {number}
857
+ */
858
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getTotalReturn = function() {
859
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0));
860
+ };
861
+
862
+
863
+ /**
864
+ * @param {number} value
865
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
866
+ */
867
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setTotalReturn = function(value) {
868
+ return jspb.Message.setProto3FloatField(this, 1, value);
869
+ };
870
+
871
+
872
+ /**
873
+ * optional double cagr = 2;
874
+ * @return {number}
875
+ */
876
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getCagr = function() {
877
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
878
+ };
879
+
880
+
881
+ /**
882
+ * @param {number} value
883
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
884
+ */
885
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setCagr = function(value) {
886
+ return jspb.Message.setProto3FloatField(this, 2, value);
887
+ };
888
+
889
+
890
+ /**
891
+ * optional double sharpe = 3;
892
+ * @return {number}
893
+ */
894
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getSharpe = function() {
895
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0));
896
+ };
897
+
898
+
899
+ /**
900
+ * @param {number} value
901
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
902
+ */
903
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setSharpe = function(value) {
904
+ return jspb.Message.setProto3FloatField(this, 3, value);
905
+ };
906
+
907
+
908
+ /**
909
+ * optional double sortino = 4;
910
+ * @return {number}
911
+ */
912
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getSortino = function() {
913
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
914
+ };
915
+
916
+
917
+ /**
918
+ * @param {number} value
919
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
920
+ */
921
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setSortino = function(value) {
922
+ return jspb.Message.setProto3FloatField(this, 4, value);
923
+ };
924
+
925
+
926
+ /**
927
+ * optional double max_drawdown = 5;
928
+ * @return {number}
929
+ */
930
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getMaxDrawdown = function() {
931
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
932
+ };
933
+
934
+
935
+ /**
936
+ * @param {number} value
937
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
938
+ */
939
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setMaxDrawdown = function(value) {
940
+ return jspb.Message.setProto3FloatField(this, 5, value);
941
+ };
942
+
943
+
944
+ /**
945
+ * optional double win_rate = 6;
946
+ * @return {number}
947
+ */
948
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getWinRate = function() {
949
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
950
+ };
951
+
952
+
953
+ /**
954
+ * @param {number} value
955
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
956
+ */
957
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setWinRate = function(value) {
958
+ return jspb.Message.setProto3FloatField(this, 6, value);
959
+ };
960
+
961
+
962
+ /**
963
+ * optional double profit_factor = 7;
964
+ * @return {number}
965
+ */
966
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getProfitFactor = function() {
967
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 7, 0.0));
968
+ };
969
+
970
+
971
+ /**
972
+ * @param {number} value
973
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
974
+ */
975
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setProfitFactor = function(value) {
976
+ return jspb.Message.setProto3FloatField(this, 7, value);
977
+ };
978
+
979
+
980
+ /**
981
+ * optional double sqn = 8;
982
+ * @return {number}
983
+ */
984
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getSqn = function() {
985
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 0.0));
986
+ };
987
+
988
+
989
+ /**
990
+ * @param {number} value
991
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
992
+ */
993
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setSqn = function(value) {
994
+ return jspb.Message.setProto3FloatField(this, 8, value);
995
+ };
996
+
997
+
998
+ /**
999
+ * optional uint32 trades_count = 9;
1000
+ * @return {number}
1001
+ */
1002
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getTradesCount = function() {
1003
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0));
1004
+ };
1005
+
1006
+
1007
+ /**
1008
+ * @param {number} value
1009
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1010
+ */
1011
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setTradesCount = function(value) {
1012
+ return jspb.Message.setProto3IntField(this, 9, value);
1013
+ };
1014
+
1015
+
1016
+ /**
1017
+ * optional double exposure = 10;
1018
+ * @return {number}
1019
+ */
1020
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getExposure = function() {
1021
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 10, 0.0));
1022
+ };
1023
+
1024
+
1025
+ /**
1026
+ * @param {number} value
1027
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1028
+ */
1029
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setExposure = function(value) {
1030
+ return jspb.Message.setProto3FloatField(this, 10, value);
1031
+ };
1032
+
1033
+
1034
+ /**
1035
+ * optional double final_equity = 11;
1036
+ * @return {number}
1037
+ */
1038
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getFinalEquity = function() {
1039
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 11, 0.0));
1040
+ };
1041
+
1042
+
1043
+ /**
1044
+ * @param {number} value
1045
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1046
+ */
1047
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setFinalEquity = function(value) {
1048
+ return jspb.Message.setProto3FloatField(this, 11, value);
1049
+ };
1050
+
1051
+
1052
+ /**
1053
+ * optional double avg_trade_pct = 12;
1054
+ * @return {number}
1055
+ */
1056
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getAvgTradePct = function() {
1057
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 12, 0.0));
1058
+ };
1059
+
1060
+
1061
+ /**
1062
+ * @param {number} value
1063
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1064
+ */
1065
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setAvgTradePct = function(value) {
1066
+ return jspb.Message.setProto3FloatField(this, 12, value);
1067
+ };
1068
+
1069
+
1070
+ /**
1071
+ * optional double expectancy = 13;
1072
+ * @return {number}
1073
+ */
1074
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getExpectancy = function() {
1075
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 13, 0.0));
1076
+ };
1077
+
1078
+
1079
+ /**
1080
+ * @param {number} value
1081
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1082
+ */
1083
+ proto.trb.strategy.v1.BacktestMetrics.prototype.setExpectancy = function(value) {
1084
+ return jspb.Message.setProto3FloatField(this, 13, value);
1085
+ };
1086
+
1087
+
1088
+ /**
1089
+ * map<string, double> extra = 20;
1090
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
1091
+ * empty, instead returning `undefined`
1092
+ * @return {!jspb.Map<string,number>}
1093
+ */
1094
+ proto.trb.strategy.v1.BacktestMetrics.prototype.getExtraMap = function(opt_noLazyCreate) {
1095
+ return /** @type {!jspb.Map<string,number>} */ (
1096
+ jspb.Message.getMapField(this, 20, opt_noLazyCreate,
1097
+ null));
1098
+ };
1099
+
1100
+
1101
+ /**
1102
+ * Clears values from the map. The map will be non-null.
1103
+ * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1104
+ */
1105
+ proto.trb.strategy.v1.BacktestMetrics.prototype.clearExtraMap = function() {
1106
+ this.getExtraMap().clear();
1107
+ return this;
1108
+ };
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1115
+ /**
1116
+ * Creates an object representation of this proto.
1117
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1118
+ * Optional fields that are not set will be set to undefined.
1119
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1120
+ * For the list of reserved names please see:
1121
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1122
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1123
+ * JSPB instance for transitional soy proto support:
1124
+ * http://goto/soy-param-migration
1125
+ * @return {!Object}
1126
+ */
1127
+ proto.trb.strategy.v1.EquityPoint.prototype.toObject = function(opt_includeInstance) {
1128
+ return proto.trb.strategy.v1.EquityPoint.toObject(opt_includeInstance, this);
1129
+ };
1130
+
1131
+
1132
+ /**
1133
+ * Static version of the {@see toObject} method.
1134
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1135
+ * the JSPB instance for transitional soy proto support:
1136
+ * http://goto/soy-param-migration
1137
+ * @param {!proto.trb.strategy.v1.EquityPoint} msg The msg instance to transform.
1138
+ * @return {!Object}
1139
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1140
+ */
1141
+ proto.trb.strategy.v1.EquityPoint.toObject = function(includeInstance, msg) {
1142
+ var f, obj = {
1143
+ time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
1144
+ equity: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0),
1145
+ cash: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0),
1146
+ positionValue: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
1147
+ drawdown: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0),
1148
+ ret: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0)
1149
+ };
1150
+
1151
+ if (includeInstance) {
1152
+ obj.$jspbMessageInstance = msg;
1153
+ }
1154
+ return obj;
1155
+ };
1156
+ }
1157
+
1158
+
1159
+ /**
1160
+ * Deserializes binary data (in protobuf wire format).
1161
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1162
+ * @return {!proto.trb.strategy.v1.EquityPoint}
1163
+ */
1164
+ proto.trb.strategy.v1.EquityPoint.deserializeBinary = function(bytes) {
1165
+ var reader = new jspb.BinaryReader(bytes);
1166
+ var msg = new proto.trb.strategy.v1.EquityPoint;
1167
+ return proto.trb.strategy.v1.EquityPoint.deserializeBinaryFromReader(msg, reader);
1168
+ };
1169
+
1170
+
1171
+ /**
1172
+ * Deserializes binary data (in protobuf wire format) from the
1173
+ * given reader into the given message object.
1174
+ * @param {!proto.trb.strategy.v1.EquityPoint} msg The message object to deserialize into.
1175
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1176
+ * @return {!proto.trb.strategy.v1.EquityPoint}
1177
+ */
1178
+ proto.trb.strategy.v1.EquityPoint.deserializeBinaryFromReader = function(msg, reader) {
1179
+ while (reader.nextField()) {
1180
+ if (reader.isEndGroup()) {
1181
+ break;
1182
+ }
1183
+ var field = reader.getFieldNumber();
1184
+ switch (field) {
1185
+ case 1:
1186
+ var value = new google_protobuf_timestamp_pb.Timestamp;
1187
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
1188
+ msg.setTime(value);
1189
+ break;
1190
+ case 2:
1191
+ var value = /** @type {number} */ (reader.readDouble());
1192
+ msg.setEquity(value);
1193
+ break;
1194
+ case 3:
1195
+ var value = /** @type {number} */ (reader.readDouble());
1196
+ msg.setCash(value);
1197
+ break;
1198
+ case 4:
1199
+ var value = /** @type {number} */ (reader.readDouble());
1200
+ msg.setPositionValue(value);
1201
+ break;
1202
+ case 5:
1203
+ var value = /** @type {number} */ (reader.readDouble());
1204
+ msg.setDrawdown(value);
1205
+ break;
1206
+ case 6:
1207
+ var value = /** @type {number} */ (reader.readDouble());
1208
+ msg.setRet(value);
1209
+ break;
1210
+ default:
1211
+ reader.skipField();
1212
+ break;
1213
+ }
1214
+ }
1215
+ return msg;
1216
+ };
1217
+
1218
+
1219
+ /**
1220
+ * Serializes the message to binary data (in protobuf wire format).
1221
+ * @return {!Uint8Array}
1222
+ */
1223
+ proto.trb.strategy.v1.EquityPoint.prototype.serializeBinary = function() {
1224
+ var writer = new jspb.BinaryWriter();
1225
+ proto.trb.strategy.v1.EquityPoint.serializeBinaryToWriter(this, writer);
1226
+ return writer.getResultBuffer();
1227
+ };
1228
+
1229
+
1230
+ /**
1231
+ * Serializes the given message to binary data (in protobuf wire
1232
+ * format), writing to the given BinaryWriter.
1233
+ * @param {!proto.trb.strategy.v1.EquityPoint} message
1234
+ * @param {!jspb.BinaryWriter} writer
1235
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1236
+ */
1237
+ proto.trb.strategy.v1.EquityPoint.serializeBinaryToWriter = function(message, writer) {
1238
+ var f = undefined;
1239
+ f = message.getTime();
1240
+ if (f != null) {
1241
+ writer.writeMessage(
1242
+ 1,
1243
+ f,
1244
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
1245
+ );
1246
+ }
1247
+ f = message.getEquity();
1248
+ if (f !== 0.0) {
1249
+ writer.writeDouble(
1250
+ 2,
1251
+ f
1252
+ );
1253
+ }
1254
+ f = message.getCash();
1255
+ if (f !== 0.0) {
1256
+ writer.writeDouble(
1257
+ 3,
1258
+ f
1259
+ );
1260
+ }
1261
+ f = message.getPositionValue();
1262
+ if (f !== 0.0) {
1263
+ writer.writeDouble(
1264
+ 4,
1265
+ f
1266
+ );
1267
+ }
1268
+ f = message.getDrawdown();
1269
+ if (f !== 0.0) {
1270
+ writer.writeDouble(
1271
+ 5,
1272
+ f
1273
+ );
1274
+ }
1275
+ f = message.getRet();
1276
+ if (f !== 0.0) {
1277
+ writer.writeDouble(
1278
+ 6,
1279
+ f
1280
+ );
1281
+ }
1282
+ };
1283
+
1284
+
1285
+ /**
1286
+ * optional google.protobuf.Timestamp time = 1;
1287
+ * @return {?proto.google.protobuf.Timestamp}
1288
+ */
1289
+ proto.trb.strategy.v1.EquityPoint.prototype.getTime = function() {
1290
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
1291
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1));
1292
+ };
1293
+
1294
+
1295
+ /**
1296
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
1297
+ * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1298
+ */
1299
+ proto.trb.strategy.v1.EquityPoint.prototype.setTime = function(value) {
1300
+ return jspb.Message.setWrapperField(this, 1, value);
1301
+ };
1302
+
1303
+
1304
+ /**
1305
+ * Clears the message field making it undefined.
1306
+ * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1307
+ */
1308
+ proto.trb.strategy.v1.EquityPoint.prototype.clearTime = function() {
1309
+ return this.setTime(undefined);
1310
+ };
1311
+
1312
+
1313
+ /**
1314
+ * Returns whether this field is set.
1315
+ * @return {boolean}
1316
+ */
1317
+ proto.trb.strategy.v1.EquityPoint.prototype.hasTime = function() {
1318
+ return jspb.Message.getField(this, 1) != null;
1319
+ };
1320
+
1321
+
1322
+ /**
1323
+ * optional double equity = 2;
1324
+ * @return {number}
1325
+ */
1326
+ proto.trb.strategy.v1.EquityPoint.prototype.getEquity = function() {
1327
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
1328
+ };
1329
+
1330
+
1331
+ /**
1332
+ * @param {number} value
1333
+ * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1334
+ */
1335
+ proto.trb.strategy.v1.EquityPoint.prototype.setEquity = function(value) {
1336
+ return jspb.Message.setProto3FloatField(this, 2, value);
1337
+ };
1338
+
1339
+
1340
+ /**
1341
+ * optional double cash = 3;
1342
+ * @return {number}
1343
+ */
1344
+ proto.trb.strategy.v1.EquityPoint.prototype.getCash = function() {
1345
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0));
1346
+ };
1347
+
1348
+
1349
+ /**
1350
+ * @param {number} value
1351
+ * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1352
+ */
1353
+ proto.trb.strategy.v1.EquityPoint.prototype.setCash = function(value) {
1354
+ return jspb.Message.setProto3FloatField(this, 3, value);
1355
+ };
1356
+
1357
+
1358
+ /**
1359
+ * optional double position_value = 4;
1360
+ * @return {number}
1361
+ */
1362
+ proto.trb.strategy.v1.EquityPoint.prototype.getPositionValue = function() {
1363
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
1364
+ };
1365
+
1366
+
1367
+ /**
1368
+ * @param {number} value
1369
+ * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1370
+ */
1371
+ proto.trb.strategy.v1.EquityPoint.prototype.setPositionValue = function(value) {
1372
+ return jspb.Message.setProto3FloatField(this, 4, value);
1373
+ };
1374
+
1375
+
1376
+ /**
1377
+ * optional double drawdown = 5;
1378
+ * @return {number}
1379
+ */
1380
+ proto.trb.strategy.v1.EquityPoint.prototype.getDrawdown = function() {
1381
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
1382
+ };
1383
+
1384
+
1385
+ /**
1386
+ * @param {number} value
1387
+ * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1388
+ */
1389
+ proto.trb.strategy.v1.EquityPoint.prototype.setDrawdown = function(value) {
1390
+ return jspb.Message.setProto3FloatField(this, 5, value);
1391
+ };
1392
+
1393
+
1394
+ /**
1395
+ * optional double ret = 6;
1396
+ * @return {number}
1397
+ */
1398
+ proto.trb.strategy.v1.EquityPoint.prototype.getRet = function() {
1399
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
1400
+ };
1401
+
1402
+
1403
+ /**
1404
+ * @param {number} value
1405
+ * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1406
+ */
1407
+ proto.trb.strategy.v1.EquityPoint.prototype.setRet = function(value) {
1408
+ return jspb.Message.setProto3FloatField(this, 6, value);
1409
+ };
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1416
+ /**
1417
+ * Creates an object representation of this proto.
1418
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1419
+ * Optional fields that are not set will be set to undefined.
1420
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1421
+ * For the list of reserved names please see:
1422
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1423
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1424
+ * JSPB instance for transitional soy proto support:
1425
+ * http://goto/soy-param-migration
1426
+ * @return {!Object}
1427
+ */
1428
+ proto.trb.strategy.v1.TradeRecord.prototype.toObject = function(opt_includeInstance) {
1429
+ return proto.trb.strategy.v1.TradeRecord.toObject(opt_includeInstance, this);
1430
+ };
1431
+
1432
+
1433
+ /**
1434
+ * Static version of the {@see toObject} method.
1435
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1436
+ * the JSPB instance for transitional soy proto support:
1437
+ * http://goto/soy-param-migration
1438
+ * @param {!proto.trb.strategy.v1.TradeRecord} msg The msg instance to transform.
1439
+ * @return {!Object}
1440
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1441
+ */
1442
+ proto.trb.strategy.v1.TradeRecord.toObject = function(includeInstance, msg) {
1443
+ var f, obj = {
1444
+ tradeId: jspb.Message.getFieldWithDefault(msg, 1, 0),
1445
+ isLong: jspb.Message.getBooleanFieldWithDefault(msg, 2, false),
1446
+ entryTime: (f = msg.getEntryTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
1447
+ entryPrice: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
1448
+ exitTime: (f = msg.getExitTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
1449
+ exitPrice: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0),
1450
+ size: jspb.Message.getFloatingPointFieldWithDefault(msg, 7, 0.0),
1451
+ pnl: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 0.0),
1452
+ pnlPct: jspb.Message.getFloatingPointFieldWithDefault(msg, 9, 0.0),
1453
+ barsHeld: jspb.Message.getFieldWithDefault(msg, 10, 0),
1454
+ mae: jspb.Message.getFloatingPointFieldWithDefault(msg, 11, 0.0),
1455
+ mfe: jspb.Message.getFloatingPointFieldWithDefault(msg, 12, 0.0),
1456
+ entryReason: jspb.Message.getFieldWithDefault(msg, 13, ""),
1457
+ exitReason: jspb.Message.getFieldWithDefault(msg, 14, "")
1458
+ };
1459
+
1460
+ if (includeInstance) {
1461
+ obj.$jspbMessageInstance = msg;
1462
+ }
1463
+ return obj;
1464
+ };
1465
+ }
1466
+
1467
+
1468
+ /**
1469
+ * Deserializes binary data (in protobuf wire format).
1470
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1471
+ * @return {!proto.trb.strategy.v1.TradeRecord}
1472
+ */
1473
+ proto.trb.strategy.v1.TradeRecord.deserializeBinary = function(bytes) {
1474
+ var reader = new jspb.BinaryReader(bytes);
1475
+ var msg = new proto.trb.strategy.v1.TradeRecord;
1476
+ return proto.trb.strategy.v1.TradeRecord.deserializeBinaryFromReader(msg, reader);
1477
+ };
1478
+
1479
+
1480
+ /**
1481
+ * Deserializes binary data (in protobuf wire format) from the
1482
+ * given reader into the given message object.
1483
+ * @param {!proto.trb.strategy.v1.TradeRecord} msg The message object to deserialize into.
1484
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1485
+ * @return {!proto.trb.strategy.v1.TradeRecord}
1486
+ */
1487
+ proto.trb.strategy.v1.TradeRecord.deserializeBinaryFromReader = function(msg, reader) {
1488
+ while (reader.nextField()) {
1489
+ if (reader.isEndGroup()) {
1490
+ break;
1491
+ }
1492
+ var field = reader.getFieldNumber();
1493
+ switch (field) {
1494
+ case 1:
1495
+ var value = /** @type {number} */ (reader.readUint32());
1496
+ msg.setTradeId(value);
1497
+ break;
1498
+ case 2:
1499
+ var value = /** @type {boolean} */ (reader.readBool());
1500
+ msg.setIsLong(value);
1501
+ break;
1502
+ case 3:
1503
+ var value = new google_protobuf_timestamp_pb.Timestamp;
1504
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
1505
+ msg.setEntryTime(value);
1506
+ break;
1507
+ case 4:
1508
+ var value = /** @type {number} */ (reader.readDouble());
1509
+ msg.setEntryPrice(value);
1510
+ break;
1511
+ case 5:
1512
+ var value = new google_protobuf_timestamp_pb.Timestamp;
1513
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
1514
+ msg.setExitTime(value);
1515
+ break;
1516
+ case 6:
1517
+ var value = /** @type {number} */ (reader.readDouble());
1518
+ msg.setExitPrice(value);
1519
+ break;
1520
+ case 7:
1521
+ var value = /** @type {number} */ (reader.readDouble());
1522
+ msg.setSize(value);
1523
+ break;
1524
+ case 8:
1525
+ var value = /** @type {number} */ (reader.readDouble());
1526
+ msg.setPnl(value);
1527
+ break;
1528
+ case 9:
1529
+ var value = /** @type {number} */ (reader.readDouble());
1530
+ msg.setPnlPct(value);
1531
+ break;
1532
+ case 10:
1533
+ var value = /** @type {number} */ (reader.readUint32());
1534
+ msg.setBarsHeld(value);
1535
+ break;
1536
+ case 11:
1537
+ var value = /** @type {number} */ (reader.readDouble());
1538
+ msg.setMae(value);
1539
+ break;
1540
+ case 12:
1541
+ var value = /** @type {number} */ (reader.readDouble());
1542
+ msg.setMfe(value);
1543
+ break;
1544
+ case 13:
1545
+ var value = /** @type {string} */ (reader.readString());
1546
+ msg.setEntryReason(value);
1547
+ break;
1548
+ case 14:
1549
+ var value = /** @type {string} */ (reader.readString());
1550
+ msg.setExitReason(value);
1551
+ break;
1552
+ default:
1553
+ reader.skipField();
1554
+ break;
1555
+ }
1556
+ }
1557
+ return msg;
1558
+ };
1559
+
1560
+
1561
+ /**
1562
+ * Serializes the message to binary data (in protobuf wire format).
1563
+ * @return {!Uint8Array}
1564
+ */
1565
+ proto.trb.strategy.v1.TradeRecord.prototype.serializeBinary = function() {
1566
+ var writer = new jspb.BinaryWriter();
1567
+ proto.trb.strategy.v1.TradeRecord.serializeBinaryToWriter(this, writer);
1568
+ return writer.getResultBuffer();
1569
+ };
1570
+
1571
+
1572
+ /**
1573
+ * Serializes the given message to binary data (in protobuf wire
1574
+ * format), writing to the given BinaryWriter.
1575
+ * @param {!proto.trb.strategy.v1.TradeRecord} message
1576
+ * @param {!jspb.BinaryWriter} writer
1577
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1578
+ */
1579
+ proto.trb.strategy.v1.TradeRecord.serializeBinaryToWriter = function(message, writer) {
1580
+ var f = undefined;
1581
+ f = message.getTradeId();
1582
+ if (f !== 0) {
1583
+ writer.writeUint32(
1584
+ 1,
1585
+ f
1586
+ );
1587
+ }
1588
+ f = message.getIsLong();
1589
+ if (f) {
1590
+ writer.writeBool(
1591
+ 2,
1592
+ f
1593
+ );
1594
+ }
1595
+ f = message.getEntryTime();
1596
+ if (f != null) {
1597
+ writer.writeMessage(
1598
+ 3,
1599
+ f,
1600
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
1601
+ );
1602
+ }
1603
+ f = message.getEntryPrice();
1604
+ if (f !== 0.0) {
1605
+ writer.writeDouble(
1606
+ 4,
1607
+ f
1608
+ );
1609
+ }
1610
+ f = message.getExitTime();
1611
+ if (f != null) {
1612
+ writer.writeMessage(
1613
+ 5,
1614
+ f,
1615
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
1616
+ );
1617
+ }
1618
+ f = message.getExitPrice();
1619
+ if (f !== 0.0) {
1620
+ writer.writeDouble(
1621
+ 6,
1622
+ f
1623
+ );
1624
+ }
1625
+ f = message.getSize();
1626
+ if (f !== 0.0) {
1627
+ writer.writeDouble(
1628
+ 7,
1629
+ f
1630
+ );
1631
+ }
1632
+ f = message.getPnl();
1633
+ if (f !== 0.0) {
1634
+ writer.writeDouble(
1635
+ 8,
1636
+ f
1637
+ );
1638
+ }
1639
+ f = message.getPnlPct();
1640
+ if (f !== 0.0) {
1641
+ writer.writeDouble(
1642
+ 9,
1643
+ f
1644
+ );
1645
+ }
1646
+ f = message.getBarsHeld();
1647
+ if (f !== 0) {
1648
+ writer.writeUint32(
1649
+ 10,
1650
+ f
1651
+ );
1652
+ }
1653
+ f = message.getMae();
1654
+ if (f !== 0.0) {
1655
+ writer.writeDouble(
1656
+ 11,
1657
+ f
1658
+ );
1659
+ }
1660
+ f = message.getMfe();
1661
+ if (f !== 0.0) {
1662
+ writer.writeDouble(
1663
+ 12,
1664
+ f
1665
+ );
1666
+ }
1667
+ f = message.getEntryReason();
1668
+ if (f.length > 0) {
1669
+ writer.writeString(
1670
+ 13,
1671
+ f
1672
+ );
1673
+ }
1674
+ f = message.getExitReason();
1675
+ if (f.length > 0) {
1676
+ writer.writeString(
1677
+ 14,
1678
+ f
1679
+ );
1680
+ }
1681
+ };
1682
+
1683
+
1684
+ /**
1685
+ * optional uint32 trade_id = 1;
1686
+ * @return {number}
1687
+ */
1688
+ proto.trb.strategy.v1.TradeRecord.prototype.getTradeId = function() {
1689
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
1690
+ };
1691
+
1692
+
1693
+ /**
1694
+ * @param {number} value
1695
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1696
+ */
1697
+ proto.trb.strategy.v1.TradeRecord.prototype.setTradeId = function(value) {
1698
+ return jspb.Message.setProto3IntField(this, 1, value);
1699
+ };
1700
+
1701
+
1702
+ /**
1703
+ * optional bool is_long = 2;
1704
+ * @return {boolean}
1705
+ */
1706
+ proto.trb.strategy.v1.TradeRecord.prototype.getIsLong = function() {
1707
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
1708
+ };
1709
+
1710
+
1711
+ /**
1712
+ * @param {boolean} value
1713
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1714
+ */
1715
+ proto.trb.strategy.v1.TradeRecord.prototype.setIsLong = function(value) {
1716
+ return jspb.Message.setProto3BooleanField(this, 2, value);
1717
+ };
1718
+
1719
+
1720
+ /**
1721
+ * optional google.protobuf.Timestamp entry_time = 3;
1722
+ * @return {?proto.google.protobuf.Timestamp}
1723
+ */
1724
+ proto.trb.strategy.v1.TradeRecord.prototype.getEntryTime = function() {
1725
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
1726
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
1727
+ };
1728
+
1729
+
1730
+ /**
1731
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
1732
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1733
+ */
1734
+ proto.trb.strategy.v1.TradeRecord.prototype.setEntryTime = function(value) {
1735
+ return jspb.Message.setWrapperField(this, 3, value);
1736
+ };
1737
+
1738
+
1739
+ /**
1740
+ * Clears the message field making it undefined.
1741
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1742
+ */
1743
+ proto.trb.strategy.v1.TradeRecord.prototype.clearEntryTime = function() {
1744
+ return this.setEntryTime(undefined);
1745
+ };
1746
+
1747
+
1748
+ /**
1749
+ * Returns whether this field is set.
1750
+ * @return {boolean}
1751
+ */
1752
+ proto.trb.strategy.v1.TradeRecord.prototype.hasEntryTime = function() {
1753
+ return jspb.Message.getField(this, 3) != null;
1754
+ };
1755
+
1756
+
1757
+ /**
1758
+ * optional double entry_price = 4;
1759
+ * @return {number}
1760
+ */
1761
+ proto.trb.strategy.v1.TradeRecord.prototype.getEntryPrice = function() {
1762
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
1763
+ };
1764
+
1765
+
1766
+ /**
1767
+ * @param {number} value
1768
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1769
+ */
1770
+ proto.trb.strategy.v1.TradeRecord.prototype.setEntryPrice = function(value) {
1771
+ return jspb.Message.setProto3FloatField(this, 4, value);
1772
+ };
1773
+
1774
+
1775
+ /**
1776
+ * optional google.protobuf.Timestamp exit_time = 5;
1777
+ * @return {?proto.google.protobuf.Timestamp}
1778
+ */
1779
+ proto.trb.strategy.v1.TradeRecord.prototype.getExitTime = function() {
1780
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
1781
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 5));
1782
+ };
1783
+
1784
+
1785
+ /**
1786
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
1787
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1788
+ */
1789
+ proto.trb.strategy.v1.TradeRecord.prototype.setExitTime = function(value) {
1790
+ return jspb.Message.setWrapperField(this, 5, value);
1791
+ };
1792
+
1793
+
1794
+ /**
1795
+ * Clears the message field making it undefined.
1796
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1797
+ */
1798
+ proto.trb.strategy.v1.TradeRecord.prototype.clearExitTime = function() {
1799
+ return this.setExitTime(undefined);
1800
+ };
1801
+
1802
+
1803
+ /**
1804
+ * Returns whether this field is set.
1805
+ * @return {boolean}
1806
+ */
1807
+ proto.trb.strategy.v1.TradeRecord.prototype.hasExitTime = function() {
1808
+ return jspb.Message.getField(this, 5) != null;
1809
+ };
1810
+
1811
+
1812
+ /**
1813
+ * optional double exit_price = 6;
1814
+ * @return {number}
1815
+ */
1816
+ proto.trb.strategy.v1.TradeRecord.prototype.getExitPrice = function() {
1817
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
1818
+ };
1819
+
1820
+
1821
+ /**
1822
+ * @param {number} value
1823
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1824
+ */
1825
+ proto.trb.strategy.v1.TradeRecord.prototype.setExitPrice = function(value) {
1826
+ return jspb.Message.setProto3FloatField(this, 6, value);
1827
+ };
1828
+
1829
+
1830
+ /**
1831
+ * optional double size = 7;
1832
+ * @return {number}
1833
+ */
1834
+ proto.trb.strategy.v1.TradeRecord.prototype.getSize = function() {
1835
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 7, 0.0));
1836
+ };
1837
+
1838
+
1839
+ /**
1840
+ * @param {number} value
1841
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1842
+ */
1843
+ proto.trb.strategy.v1.TradeRecord.prototype.setSize = function(value) {
1844
+ return jspb.Message.setProto3FloatField(this, 7, value);
1845
+ };
1846
+
1847
+
1848
+ /**
1849
+ * optional double pnl = 8;
1850
+ * @return {number}
1851
+ */
1852
+ proto.trb.strategy.v1.TradeRecord.prototype.getPnl = function() {
1853
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 0.0));
1854
+ };
1855
+
1856
+
1857
+ /**
1858
+ * @param {number} value
1859
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1860
+ */
1861
+ proto.trb.strategy.v1.TradeRecord.prototype.setPnl = function(value) {
1862
+ return jspb.Message.setProto3FloatField(this, 8, value);
1863
+ };
1864
+
1865
+
1866
+ /**
1867
+ * optional double pnl_pct = 9;
1868
+ * @return {number}
1869
+ */
1870
+ proto.trb.strategy.v1.TradeRecord.prototype.getPnlPct = function() {
1871
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 9, 0.0));
1872
+ };
1873
+
1874
+
1875
+ /**
1876
+ * @param {number} value
1877
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1878
+ */
1879
+ proto.trb.strategy.v1.TradeRecord.prototype.setPnlPct = function(value) {
1880
+ return jspb.Message.setProto3FloatField(this, 9, value);
1881
+ };
1882
+
1883
+
1884
+ /**
1885
+ * optional uint32 bars_held = 10;
1886
+ * @return {number}
1887
+ */
1888
+ proto.trb.strategy.v1.TradeRecord.prototype.getBarsHeld = function() {
1889
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
1890
+ };
1891
+
1892
+
1893
+ /**
1894
+ * @param {number} value
1895
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1896
+ */
1897
+ proto.trb.strategy.v1.TradeRecord.prototype.setBarsHeld = function(value) {
1898
+ return jspb.Message.setProto3IntField(this, 10, value);
1899
+ };
1900
+
1901
+
1902
+ /**
1903
+ * optional double mae = 11;
1904
+ * @return {number}
1905
+ */
1906
+ proto.trb.strategy.v1.TradeRecord.prototype.getMae = function() {
1907
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 11, 0.0));
1908
+ };
1909
+
1910
+
1911
+ /**
1912
+ * @param {number} value
1913
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1914
+ */
1915
+ proto.trb.strategy.v1.TradeRecord.prototype.setMae = function(value) {
1916
+ return jspb.Message.setProto3FloatField(this, 11, value);
1917
+ };
1918
+
1919
+
1920
+ /**
1921
+ * optional double mfe = 12;
1922
+ * @return {number}
1923
+ */
1924
+ proto.trb.strategy.v1.TradeRecord.prototype.getMfe = function() {
1925
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 12, 0.0));
1926
+ };
1927
+
1928
+
1929
+ /**
1930
+ * @param {number} value
1931
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1932
+ */
1933
+ proto.trb.strategy.v1.TradeRecord.prototype.setMfe = function(value) {
1934
+ return jspb.Message.setProto3FloatField(this, 12, value);
1935
+ };
1936
+
1937
+
1938
+ /**
1939
+ * optional string entry_reason = 13;
1940
+ * @return {string}
1941
+ */
1942
+ proto.trb.strategy.v1.TradeRecord.prototype.getEntryReason = function() {
1943
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, ""));
1944
+ };
1945
+
1946
+
1947
+ /**
1948
+ * @param {string} value
1949
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1950
+ */
1951
+ proto.trb.strategy.v1.TradeRecord.prototype.setEntryReason = function(value) {
1952
+ return jspb.Message.setProto3StringField(this, 13, value);
1953
+ };
1954
+
1955
+
1956
+ /**
1957
+ * optional string exit_reason = 14;
1958
+ * @return {string}
1959
+ */
1960
+ proto.trb.strategy.v1.TradeRecord.prototype.getExitReason = function() {
1961
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 14, ""));
1962
+ };
1963
+
1964
+
1965
+ /**
1966
+ * @param {string} value
1967
+ * @return {!proto.trb.strategy.v1.TradeRecord} returns this
1968
+ */
1969
+ proto.trb.strategy.v1.TradeRecord.prototype.setExitReason = function(value) {
1970
+ return jspb.Message.setProto3StringField(this, 14, value);
1971
+ };
1972
+
1973
+
1974
+
1975
+
1976
+
1977
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1978
+ /**
1979
+ * Creates an object representation of this proto.
1980
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1981
+ * Optional fields that are not set will be set to undefined.
1982
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1983
+ * For the list of reserved names please see:
1984
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1985
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1986
+ * JSPB instance for transitional soy proto support:
1987
+ * http://goto/soy-param-migration
1988
+ * @return {!Object}
1989
+ */
1990
+ proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.toObject = function(opt_includeInstance) {
1991
+ return proto.trb.strategy.v1.BacktestIndicatorPoint.toObject(opt_includeInstance, this);
1992
+ };
1993
+
1994
+
1995
+ /**
1996
+ * Static version of the {@see toObject} method.
1997
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1998
+ * the JSPB instance for transitional soy proto support:
1999
+ * http://goto/soy-param-migration
2000
+ * @param {!proto.trb.strategy.v1.BacktestIndicatorPoint} msg The msg instance to transform.
2001
+ * @return {!Object}
2002
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2003
+ */
2004
+ proto.trb.strategy.v1.BacktestIndicatorPoint.toObject = function(includeInstance, msg) {
2005
+ var f, obj = {
2006
+ time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
2007
+ valuesMap: (f = msg.getValuesMap()) ? f.toObject(includeInstance, undefined) : []
2008
+ };
2009
+
2010
+ if (includeInstance) {
2011
+ obj.$jspbMessageInstance = msg;
2012
+ }
2013
+ return obj;
2014
+ };
2015
+ }
2016
+
2017
+
2018
+ /**
2019
+ * Deserializes binary data (in protobuf wire format).
2020
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2021
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint}
2022
+ */
2023
+ proto.trb.strategy.v1.BacktestIndicatorPoint.deserializeBinary = function(bytes) {
2024
+ var reader = new jspb.BinaryReader(bytes);
2025
+ var msg = new proto.trb.strategy.v1.BacktestIndicatorPoint;
2026
+ return proto.trb.strategy.v1.BacktestIndicatorPoint.deserializeBinaryFromReader(msg, reader);
2027
+ };
2028
+
2029
+
2030
+ /**
2031
+ * Deserializes binary data (in protobuf wire format) from the
2032
+ * given reader into the given message object.
2033
+ * @param {!proto.trb.strategy.v1.BacktestIndicatorPoint} msg The message object to deserialize into.
2034
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2035
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint}
2036
+ */
2037
+ proto.trb.strategy.v1.BacktestIndicatorPoint.deserializeBinaryFromReader = function(msg, reader) {
2038
+ while (reader.nextField()) {
2039
+ if (reader.isEndGroup()) {
2040
+ break;
2041
+ }
2042
+ var field = reader.getFieldNumber();
2043
+ switch (field) {
2044
+ case 1:
2045
+ var value = new google_protobuf_timestamp_pb.Timestamp;
2046
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
2047
+ msg.setTime(value);
2048
+ break;
2049
+ case 2:
2050
+ var value = msg.getValuesMap();
2051
+ reader.readMessage(value, function(message, reader) {
2052
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readDouble, null, "", 0.0);
2053
+ });
2054
+ break;
2055
+ default:
2056
+ reader.skipField();
2057
+ break;
2058
+ }
2059
+ }
2060
+ return msg;
2061
+ };
2062
+
2063
+
2064
+ /**
2065
+ * Serializes the message to binary data (in protobuf wire format).
2066
+ * @return {!Uint8Array}
2067
+ */
2068
+ proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.serializeBinary = function() {
2069
+ var writer = new jspb.BinaryWriter();
2070
+ proto.trb.strategy.v1.BacktestIndicatorPoint.serializeBinaryToWriter(this, writer);
2071
+ return writer.getResultBuffer();
2072
+ };
2073
+
2074
+
2075
+ /**
2076
+ * Serializes the given message to binary data (in protobuf wire
2077
+ * format), writing to the given BinaryWriter.
2078
+ * @param {!proto.trb.strategy.v1.BacktestIndicatorPoint} message
2079
+ * @param {!jspb.BinaryWriter} writer
2080
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2081
+ */
2082
+ proto.trb.strategy.v1.BacktestIndicatorPoint.serializeBinaryToWriter = function(message, writer) {
2083
+ var f = undefined;
2084
+ f = message.getTime();
2085
+ if (f != null) {
2086
+ writer.writeMessage(
2087
+ 1,
2088
+ f,
2089
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
2090
+ );
2091
+ }
2092
+ f = message.getValuesMap(true);
2093
+ if (f && f.getLength() > 0) {
2094
+ f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeDouble);
2095
+ }
2096
+ };
2097
+
2098
+
2099
+ /**
2100
+ * optional google.protobuf.Timestamp time = 1;
2101
+ * @return {?proto.google.protobuf.Timestamp}
2102
+ */
2103
+ proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.getTime = function() {
2104
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
2105
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1));
2106
+ };
2107
+
2108
+
2109
+ /**
2110
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
2111
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint} returns this
2112
+ */
2113
+ proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.setTime = function(value) {
2114
+ return jspb.Message.setWrapperField(this, 1, value);
2115
+ };
2116
+
2117
+
2118
+ /**
2119
+ * Clears the message field making it undefined.
2120
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint} returns this
2121
+ */
2122
+ proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.clearTime = function() {
2123
+ return this.setTime(undefined);
2124
+ };
2125
+
2126
+
2127
+ /**
2128
+ * Returns whether this field is set.
2129
+ * @return {boolean}
2130
+ */
2131
+ proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.hasTime = function() {
2132
+ return jspb.Message.getField(this, 1) != null;
2133
+ };
2134
+
2135
+
2136
+ /**
2137
+ * map<string, double> values = 2;
2138
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
2139
+ * empty, instead returning `undefined`
2140
+ * @return {!jspb.Map<string,number>}
2141
+ */
2142
+ proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.getValuesMap = function(opt_noLazyCreate) {
2143
+ return /** @type {!jspb.Map<string,number>} */ (
2144
+ jspb.Message.getMapField(this, 2, opt_noLazyCreate,
2145
+ null));
2146
+ };
2147
+
2148
+
2149
+ /**
2150
+ * Clears values from the map. The map will be non-null.
2151
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint} returns this
2152
+ */
2153
+ proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.clearValuesMap = function() {
2154
+ this.getValuesMap().clear();
2155
+ return this;
2156
+ };
2157
+
2158
+
2159
+
2160
+ /**
2161
+ * List of repeated fields within this message type.
2162
+ * @private {!Array<number>}
2163
+ * @const
2164
+ */
2165
+ proto.trb.strategy.v1.BacktestIndicatorSeries.repeatedFields_ = [5];
2166
+
2167
+
2168
+
2169
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2170
+ /**
2171
+ * Creates an object representation of this proto.
2172
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2173
+ * Optional fields that are not set will be set to undefined.
2174
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2175
+ * For the list of reserved names please see:
2176
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2177
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2178
+ * JSPB instance for transitional soy proto support:
2179
+ * http://goto/soy-param-migration
2180
+ * @return {!Object}
2181
+ */
2182
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.toObject = function(opt_includeInstance) {
2183
+ return proto.trb.strategy.v1.BacktestIndicatorSeries.toObject(opt_includeInstance, this);
2184
+ };
2185
+
2186
+
2187
+ /**
2188
+ * Static version of the {@see toObject} method.
2189
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2190
+ * the JSPB instance for transitional soy proto support:
2191
+ * http://goto/soy-param-migration
2192
+ * @param {!proto.trb.strategy.v1.BacktestIndicatorSeries} msg The msg instance to transform.
2193
+ * @return {!Object}
2194
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2195
+ */
2196
+ proto.trb.strategy.v1.BacktestIndicatorSeries.toObject = function(includeInstance, msg) {
2197
+ var f, obj = {
2198
+ indicatorId: jspb.Message.getFieldWithDefault(msg, 1, ""),
2199
+ indicator: jspb.Message.getFieldWithDefault(msg, 2, ""),
2200
+ outputKey: jspb.Message.getFieldWithDefault(msg, 3, ""),
2201
+ overlay: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
2202
+ pointsList: jspb.Message.toObjectList(msg.getPointsList(),
2203
+ proto.trb.strategy.v1.BacktestIndicatorPoint.toObject, includeInstance)
2204
+ };
2205
+
2206
+ if (includeInstance) {
2207
+ obj.$jspbMessageInstance = msg;
2208
+ }
2209
+ return obj;
2210
+ };
2211
+ }
2212
+
2213
+
2214
+ /**
2215
+ * Deserializes binary data (in protobuf wire format).
2216
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2217
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries}
2218
+ */
2219
+ proto.trb.strategy.v1.BacktestIndicatorSeries.deserializeBinary = function(bytes) {
2220
+ var reader = new jspb.BinaryReader(bytes);
2221
+ var msg = new proto.trb.strategy.v1.BacktestIndicatorSeries;
2222
+ return proto.trb.strategy.v1.BacktestIndicatorSeries.deserializeBinaryFromReader(msg, reader);
2223
+ };
2224
+
2225
+
2226
+ /**
2227
+ * Deserializes binary data (in protobuf wire format) from the
2228
+ * given reader into the given message object.
2229
+ * @param {!proto.trb.strategy.v1.BacktestIndicatorSeries} msg The message object to deserialize into.
2230
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2231
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries}
2232
+ */
2233
+ proto.trb.strategy.v1.BacktestIndicatorSeries.deserializeBinaryFromReader = function(msg, reader) {
2234
+ while (reader.nextField()) {
2235
+ if (reader.isEndGroup()) {
2236
+ break;
2237
+ }
2238
+ var field = reader.getFieldNumber();
2239
+ switch (field) {
2240
+ case 1:
2241
+ var value = /** @type {string} */ (reader.readString());
2242
+ msg.setIndicatorId(value);
2243
+ break;
2244
+ case 2:
2245
+ var value = /** @type {string} */ (reader.readString());
2246
+ msg.setIndicator(value);
2247
+ break;
2248
+ case 3:
2249
+ var value = /** @type {string} */ (reader.readString());
2250
+ msg.setOutputKey(value);
2251
+ break;
2252
+ case 4:
2253
+ var value = /** @type {boolean} */ (reader.readBool());
2254
+ msg.setOverlay(value);
2255
+ break;
2256
+ case 5:
2257
+ var value = new proto.trb.strategy.v1.BacktestIndicatorPoint;
2258
+ reader.readMessage(value,proto.trb.strategy.v1.BacktestIndicatorPoint.deserializeBinaryFromReader);
2259
+ msg.addPoints(value);
2260
+ break;
2261
+ default:
2262
+ reader.skipField();
2263
+ break;
2264
+ }
2265
+ }
2266
+ return msg;
2267
+ };
2268
+
2269
+
2270
+ /**
2271
+ * Serializes the message to binary data (in protobuf wire format).
2272
+ * @return {!Uint8Array}
2273
+ */
2274
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.serializeBinary = function() {
2275
+ var writer = new jspb.BinaryWriter();
2276
+ proto.trb.strategy.v1.BacktestIndicatorSeries.serializeBinaryToWriter(this, writer);
2277
+ return writer.getResultBuffer();
2278
+ };
2279
+
2280
+
2281
+ /**
2282
+ * Serializes the given message to binary data (in protobuf wire
2283
+ * format), writing to the given BinaryWriter.
2284
+ * @param {!proto.trb.strategy.v1.BacktestIndicatorSeries} message
2285
+ * @param {!jspb.BinaryWriter} writer
2286
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2287
+ */
2288
+ proto.trb.strategy.v1.BacktestIndicatorSeries.serializeBinaryToWriter = function(message, writer) {
2289
+ var f = undefined;
2290
+ f = message.getIndicatorId();
2291
+ if (f.length > 0) {
2292
+ writer.writeString(
2293
+ 1,
2294
+ f
2295
+ );
2296
+ }
2297
+ f = message.getIndicator();
2298
+ if (f.length > 0) {
2299
+ writer.writeString(
2300
+ 2,
2301
+ f
2302
+ );
2303
+ }
2304
+ f = message.getOutputKey();
2305
+ if (f.length > 0) {
2306
+ writer.writeString(
2307
+ 3,
2308
+ f
2309
+ );
2310
+ }
2311
+ f = message.getOverlay();
2312
+ if (f) {
2313
+ writer.writeBool(
2314
+ 4,
2315
+ f
2316
+ );
2317
+ }
2318
+ f = message.getPointsList();
2319
+ if (f.length > 0) {
2320
+ writer.writeRepeatedMessage(
2321
+ 5,
2322
+ f,
2323
+ proto.trb.strategy.v1.BacktestIndicatorPoint.serializeBinaryToWriter
2324
+ );
2325
+ }
2326
+ };
2327
+
2328
+
2329
+ /**
2330
+ * optional string indicator_id = 1;
2331
+ * @return {string}
2332
+ */
2333
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getIndicatorId = function() {
2334
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
2335
+ };
2336
+
2337
+
2338
+ /**
2339
+ * @param {string} value
2340
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
2341
+ */
2342
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setIndicatorId = function(value) {
2343
+ return jspb.Message.setProto3StringField(this, 1, value);
2344
+ };
2345
+
2346
+
2347
+ /**
2348
+ * optional string indicator = 2;
2349
+ * @return {string}
2350
+ */
2351
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getIndicator = function() {
2352
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
2353
+ };
2354
+
2355
+
2356
+ /**
2357
+ * @param {string} value
2358
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
2359
+ */
2360
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setIndicator = function(value) {
2361
+ return jspb.Message.setProto3StringField(this, 2, value);
2362
+ };
2363
+
2364
+
2365
+ /**
2366
+ * optional string output_key = 3;
2367
+ * @return {string}
2368
+ */
2369
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getOutputKey = function() {
2370
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
2371
+ };
2372
+
2373
+
2374
+ /**
2375
+ * @param {string} value
2376
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
2377
+ */
2378
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setOutputKey = function(value) {
2379
+ return jspb.Message.setProto3StringField(this, 3, value);
2380
+ };
2381
+
2382
+
2383
+ /**
2384
+ * optional bool overlay = 4;
2385
+ * @return {boolean}
2386
+ */
2387
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getOverlay = function() {
2388
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
2389
+ };
2390
+
2391
+
2392
+ /**
2393
+ * @param {boolean} value
2394
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
2395
+ */
2396
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setOverlay = function(value) {
2397
+ return jspb.Message.setProto3BooleanField(this, 4, value);
2398
+ };
2399
+
2400
+
2401
+ /**
2402
+ * repeated BacktestIndicatorPoint points = 5;
2403
+ * @return {!Array<!proto.trb.strategy.v1.BacktestIndicatorPoint>}
2404
+ */
2405
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getPointsList = function() {
2406
+ return /** @type{!Array<!proto.trb.strategy.v1.BacktestIndicatorPoint>} */ (
2407
+ jspb.Message.getRepeatedWrapperField(this, proto.trb.strategy.v1.BacktestIndicatorPoint, 5));
2408
+ };
2409
+
2410
+
2411
+ /**
2412
+ * @param {!Array<!proto.trb.strategy.v1.BacktestIndicatorPoint>} value
2413
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
2414
+ */
2415
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setPointsList = function(value) {
2416
+ return jspb.Message.setRepeatedWrapperField(this, 5, value);
2417
+ };
2418
+
2419
+
2420
+ /**
2421
+ * @param {!proto.trb.strategy.v1.BacktestIndicatorPoint=} opt_value
2422
+ * @param {number=} opt_index
2423
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint}
2424
+ */
2425
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.addPoints = function(opt_value, opt_index) {
2426
+ return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.trb.strategy.v1.BacktestIndicatorPoint, opt_index);
2427
+ };
2428
+
2429
+
2430
+ /**
2431
+ * Clears the list making it empty but non-null.
2432
+ * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
2433
+ */
2434
+ proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.clearPointsList = function() {
2435
+ return this.setPointsList([]);
2436
+ };
2437
+
2438
+
2439
+
2440
+
2441
+
2442
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2443
+ /**
2444
+ * Creates an object representation of this proto.
2445
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2446
+ * Optional fields that are not set will be set to undefined.
2447
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2448
+ * For the list of reserved names please see:
2449
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2450
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2451
+ * JSPB instance for transitional soy proto support:
2452
+ * http://goto/soy-param-migration
2453
+ * @return {!Object}
2454
+ */
2455
+ proto.trb.strategy.v1.BacktestRun.prototype.toObject = function(opt_includeInstance) {
2456
+ return proto.trb.strategy.v1.BacktestRun.toObject(opt_includeInstance, this);
2457
+ };
2458
+
2459
+
2460
+ /**
2461
+ * Static version of the {@see toObject} method.
2462
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2463
+ * the JSPB instance for transitional soy proto support:
2464
+ * http://goto/soy-param-migration
2465
+ * @param {!proto.trb.strategy.v1.BacktestRun} msg The msg instance to transform.
2466
+ * @return {!Object}
2467
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2468
+ */
2469
+ proto.trb.strategy.v1.BacktestRun.toObject = function(includeInstance, msg) {
2470
+ var f, obj = {
2471
+ runId: jspb.Message.getFieldWithDefault(msg, 1, ""),
2472
+ strategyId: jspb.Message.getFieldWithDefault(msg, 2, ""),
2473
+ spec: (f = msg.getSpec()) && strategy_spec_pb.StrategySpec.toObject(includeInstance, f),
2474
+ config: (f = msg.getConfig()) && proto.trb.strategy.v1.BacktestConfig.toObject(includeInstance, f),
2475
+ status: jspb.Message.getFieldWithDefault(msg, 5, 0),
2476
+ error: jspb.Message.getFieldWithDefault(msg, 6, ""),
2477
+ engineVersion: jspb.Message.getFieldWithDefault(msg, 7, ""),
2478
+ searchRunId: jspb.Message.getFieldWithDefault(msg, 8, ""),
2479
+ createdAt: (f = msg.getCreatedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
2480
+ startedAt: (f = msg.getStartedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
2481
+ finishedAt: (f = msg.getFinishedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
2482
+ };
2483
+
2484
+ if (includeInstance) {
2485
+ obj.$jspbMessageInstance = msg;
2486
+ }
2487
+ return obj;
2488
+ };
2489
+ }
2490
+
2491
+
2492
+ /**
2493
+ * Deserializes binary data (in protobuf wire format).
2494
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2495
+ * @return {!proto.trb.strategy.v1.BacktestRun}
2496
+ */
2497
+ proto.trb.strategy.v1.BacktestRun.deserializeBinary = function(bytes) {
2498
+ var reader = new jspb.BinaryReader(bytes);
2499
+ var msg = new proto.trb.strategy.v1.BacktestRun;
2500
+ return proto.trb.strategy.v1.BacktestRun.deserializeBinaryFromReader(msg, reader);
2501
+ };
2502
+
2503
+
2504
+ /**
2505
+ * Deserializes binary data (in protobuf wire format) from the
2506
+ * given reader into the given message object.
2507
+ * @param {!proto.trb.strategy.v1.BacktestRun} msg The message object to deserialize into.
2508
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2509
+ * @return {!proto.trb.strategy.v1.BacktestRun}
2510
+ */
2511
+ proto.trb.strategy.v1.BacktestRun.deserializeBinaryFromReader = function(msg, reader) {
2512
+ while (reader.nextField()) {
2513
+ if (reader.isEndGroup()) {
2514
+ break;
2515
+ }
2516
+ var field = reader.getFieldNumber();
2517
+ switch (field) {
2518
+ case 1:
2519
+ var value = /** @type {string} */ (reader.readString());
2520
+ msg.setRunId(value);
2521
+ break;
2522
+ case 2:
2523
+ var value = /** @type {string} */ (reader.readString());
2524
+ msg.setStrategyId(value);
2525
+ break;
2526
+ case 3:
2527
+ var value = new strategy_spec_pb.StrategySpec;
2528
+ reader.readMessage(value,strategy_spec_pb.StrategySpec.deserializeBinaryFromReader);
2529
+ msg.setSpec(value);
2530
+ break;
2531
+ case 4:
2532
+ var value = new proto.trb.strategy.v1.BacktestConfig;
2533
+ reader.readMessage(value,proto.trb.strategy.v1.BacktestConfig.deserializeBinaryFromReader);
2534
+ msg.setConfig(value);
2535
+ break;
2536
+ case 5:
2537
+ var value = /** @type {!proto.trb.strategy.v1.RunStatus} */ (reader.readEnum());
2538
+ msg.setStatus(value);
2539
+ break;
2540
+ case 6:
2541
+ var value = /** @type {string} */ (reader.readString());
2542
+ msg.setError(value);
2543
+ break;
2544
+ case 7:
2545
+ var value = /** @type {string} */ (reader.readString());
2546
+ msg.setEngineVersion(value);
2547
+ break;
2548
+ case 8:
2549
+ var value = /** @type {string} */ (reader.readString());
2550
+ msg.setSearchRunId(value);
2551
+ break;
2552
+ case 9:
2553
+ var value = new google_protobuf_timestamp_pb.Timestamp;
2554
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
2555
+ msg.setCreatedAt(value);
2556
+ break;
2557
+ case 10:
2558
+ var value = new google_protobuf_timestamp_pb.Timestamp;
2559
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
2560
+ msg.setStartedAt(value);
2561
+ break;
2562
+ case 11:
2563
+ var value = new google_protobuf_timestamp_pb.Timestamp;
2564
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
2565
+ msg.setFinishedAt(value);
2566
+ break;
2567
+ default:
2568
+ reader.skipField();
2569
+ break;
2570
+ }
2571
+ }
2572
+ return msg;
2573
+ };
2574
+
2575
+
2576
+ /**
2577
+ * Serializes the message to binary data (in protobuf wire format).
2578
+ * @return {!Uint8Array}
2579
+ */
2580
+ proto.trb.strategy.v1.BacktestRun.prototype.serializeBinary = function() {
2581
+ var writer = new jspb.BinaryWriter();
2582
+ proto.trb.strategy.v1.BacktestRun.serializeBinaryToWriter(this, writer);
2583
+ return writer.getResultBuffer();
2584
+ };
2585
+
2586
+
2587
+ /**
2588
+ * Serializes the given message to binary data (in protobuf wire
2589
+ * format), writing to the given BinaryWriter.
2590
+ * @param {!proto.trb.strategy.v1.BacktestRun} message
2591
+ * @param {!jspb.BinaryWriter} writer
2592
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2593
+ */
2594
+ proto.trb.strategy.v1.BacktestRun.serializeBinaryToWriter = function(message, writer) {
2595
+ var f = undefined;
2596
+ f = message.getRunId();
2597
+ if (f.length > 0) {
2598
+ writer.writeString(
2599
+ 1,
2600
+ f
2601
+ );
2602
+ }
2603
+ f = message.getStrategyId();
2604
+ if (f.length > 0) {
2605
+ writer.writeString(
2606
+ 2,
2607
+ f
2608
+ );
2609
+ }
2610
+ f = message.getSpec();
2611
+ if (f != null) {
2612
+ writer.writeMessage(
2613
+ 3,
2614
+ f,
2615
+ strategy_spec_pb.StrategySpec.serializeBinaryToWriter
2616
+ );
2617
+ }
2618
+ f = message.getConfig();
2619
+ if (f != null) {
2620
+ writer.writeMessage(
2621
+ 4,
2622
+ f,
2623
+ proto.trb.strategy.v1.BacktestConfig.serializeBinaryToWriter
2624
+ );
2625
+ }
2626
+ f = message.getStatus();
2627
+ if (f !== 0.0) {
2628
+ writer.writeEnum(
2629
+ 5,
2630
+ f
2631
+ );
2632
+ }
2633
+ f = message.getError();
2634
+ if (f.length > 0) {
2635
+ writer.writeString(
2636
+ 6,
2637
+ f
2638
+ );
2639
+ }
2640
+ f = message.getEngineVersion();
2641
+ if (f.length > 0) {
2642
+ writer.writeString(
2643
+ 7,
2644
+ f
2645
+ );
2646
+ }
2647
+ f = message.getSearchRunId();
2648
+ if (f.length > 0) {
2649
+ writer.writeString(
2650
+ 8,
2651
+ f
2652
+ );
2653
+ }
2654
+ f = message.getCreatedAt();
2655
+ if (f != null) {
2656
+ writer.writeMessage(
2657
+ 9,
2658
+ f,
2659
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
2660
+ );
2661
+ }
2662
+ f = message.getStartedAt();
2663
+ if (f != null) {
2664
+ writer.writeMessage(
2665
+ 10,
2666
+ f,
2667
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
2668
+ );
2669
+ }
2670
+ f = message.getFinishedAt();
2671
+ if (f != null) {
2672
+ writer.writeMessage(
2673
+ 11,
2674
+ f,
2675
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
2676
+ );
2677
+ }
2678
+ };
2679
+
2680
+
2681
+ /**
2682
+ * optional string run_id = 1;
2683
+ * @return {string}
2684
+ */
2685
+ proto.trb.strategy.v1.BacktestRun.prototype.getRunId = function() {
2686
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
2687
+ };
2688
+
2689
+
2690
+ /**
2691
+ * @param {string} value
2692
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2693
+ */
2694
+ proto.trb.strategy.v1.BacktestRun.prototype.setRunId = function(value) {
2695
+ return jspb.Message.setProto3StringField(this, 1, value);
2696
+ };
2697
+
2698
+
2699
+ /**
2700
+ * optional string strategy_id = 2;
2701
+ * @return {string}
2702
+ */
2703
+ proto.trb.strategy.v1.BacktestRun.prototype.getStrategyId = function() {
2704
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
2705
+ };
2706
+
2707
+
2708
+ /**
2709
+ * @param {string} value
2710
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2711
+ */
2712
+ proto.trb.strategy.v1.BacktestRun.prototype.setStrategyId = function(value) {
2713
+ return jspb.Message.setProto3StringField(this, 2, value);
2714
+ };
2715
+
2716
+
2717
+ /**
2718
+ * optional StrategySpec spec = 3;
2719
+ * @return {?proto.trb.strategy.v1.StrategySpec}
2720
+ */
2721
+ proto.trb.strategy.v1.BacktestRun.prototype.getSpec = function() {
2722
+ return /** @type{?proto.trb.strategy.v1.StrategySpec} */ (
2723
+ jspb.Message.getWrapperField(this, strategy_spec_pb.StrategySpec, 3));
2724
+ };
2725
+
2726
+
2727
+ /**
2728
+ * @param {?proto.trb.strategy.v1.StrategySpec|undefined} value
2729
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2730
+ */
2731
+ proto.trb.strategy.v1.BacktestRun.prototype.setSpec = function(value) {
2732
+ return jspb.Message.setWrapperField(this, 3, value);
2733
+ };
2734
+
2735
+
2736
+ /**
2737
+ * Clears the message field making it undefined.
2738
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2739
+ */
2740
+ proto.trb.strategy.v1.BacktestRun.prototype.clearSpec = function() {
2741
+ return this.setSpec(undefined);
2742
+ };
2743
+
2744
+
2745
+ /**
2746
+ * Returns whether this field is set.
2747
+ * @return {boolean}
2748
+ */
2749
+ proto.trb.strategy.v1.BacktestRun.prototype.hasSpec = function() {
2750
+ return jspb.Message.getField(this, 3) != null;
2751
+ };
2752
+
2753
+
2754
+ /**
2755
+ * optional BacktestConfig config = 4;
2756
+ * @return {?proto.trb.strategy.v1.BacktestConfig}
2757
+ */
2758
+ proto.trb.strategy.v1.BacktestRun.prototype.getConfig = function() {
2759
+ return /** @type{?proto.trb.strategy.v1.BacktestConfig} */ (
2760
+ jspb.Message.getWrapperField(this, proto.trb.strategy.v1.BacktestConfig, 4));
2761
+ };
2762
+
2763
+
2764
+ /**
2765
+ * @param {?proto.trb.strategy.v1.BacktestConfig|undefined} value
2766
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2767
+ */
2768
+ proto.trb.strategy.v1.BacktestRun.prototype.setConfig = function(value) {
2769
+ return jspb.Message.setWrapperField(this, 4, value);
2770
+ };
2771
+
2772
+
2773
+ /**
2774
+ * Clears the message field making it undefined.
2775
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2776
+ */
2777
+ proto.trb.strategy.v1.BacktestRun.prototype.clearConfig = function() {
2778
+ return this.setConfig(undefined);
2779
+ };
2780
+
2781
+
2782
+ /**
2783
+ * Returns whether this field is set.
2784
+ * @return {boolean}
2785
+ */
2786
+ proto.trb.strategy.v1.BacktestRun.prototype.hasConfig = function() {
2787
+ return jspb.Message.getField(this, 4) != null;
2788
+ };
2789
+
2790
+
2791
+ /**
2792
+ * optional RunStatus status = 5;
2793
+ * @return {!proto.trb.strategy.v1.RunStatus}
2794
+ */
2795
+ proto.trb.strategy.v1.BacktestRun.prototype.getStatus = function() {
2796
+ return /** @type {!proto.trb.strategy.v1.RunStatus} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
2797
+ };
2798
+
2799
+
2800
+ /**
2801
+ * @param {!proto.trb.strategy.v1.RunStatus} value
2802
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2803
+ */
2804
+ proto.trb.strategy.v1.BacktestRun.prototype.setStatus = function(value) {
2805
+ return jspb.Message.setProto3EnumField(this, 5, value);
2806
+ };
2807
+
2808
+
2809
+ /**
2810
+ * optional string error = 6;
2811
+ * @return {string}
2812
+ */
2813
+ proto.trb.strategy.v1.BacktestRun.prototype.getError = function() {
2814
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
2815
+ };
2816
+
2817
+
2818
+ /**
2819
+ * @param {string} value
2820
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2821
+ */
2822
+ proto.trb.strategy.v1.BacktestRun.prototype.setError = function(value) {
2823
+ return jspb.Message.setProto3StringField(this, 6, value);
2824
+ };
2825
+
2826
+
2827
+ /**
2828
+ * optional string engine_version = 7;
2829
+ * @return {string}
2830
+ */
2831
+ proto.trb.strategy.v1.BacktestRun.prototype.getEngineVersion = function() {
2832
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
2833
+ };
2834
+
2835
+
2836
+ /**
2837
+ * @param {string} value
2838
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2839
+ */
2840
+ proto.trb.strategy.v1.BacktestRun.prototype.setEngineVersion = function(value) {
2841
+ return jspb.Message.setProto3StringField(this, 7, value);
2842
+ };
2843
+
2844
+
2845
+ /**
2846
+ * optional string search_run_id = 8;
2847
+ * @return {string}
2848
+ */
2849
+ proto.trb.strategy.v1.BacktestRun.prototype.getSearchRunId = function() {
2850
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
2851
+ };
2852
+
2853
+
2854
+ /**
2855
+ * @param {string} value
2856
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2857
+ */
2858
+ proto.trb.strategy.v1.BacktestRun.prototype.setSearchRunId = function(value) {
2859
+ return jspb.Message.setProto3StringField(this, 8, value);
2860
+ };
2861
+
2862
+
2863
+ /**
2864
+ * optional google.protobuf.Timestamp created_at = 9;
2865
+ * @return {?proto.google.protobuf.Timestamp}
2866
+ */
2867
+ proto.trb.strategy.v1.BacktestRun.prototype.getCreatedAt = function() {
2868
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
2869
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 9));
2870
+ };
2871
+
2872
+
2873
+ /**
2874
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
2875
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2876
+ */
2877
+ proto.trb.strategy.v1.BacktestRun.prototype.setCreatedAt = function(value) {
2878
+ return jspb.Message.setWrapperField(this, 9, value);
2879
+ };
2880
+
2881
+
2882
+ /**
2883
+ * Clears the message field making it undefined.
2884
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2885
+ */
2886
+ proto.trb.strategy.v1.BacktestRun.prototype.clearCreatedAt = function() {
2887
+ return this.setCreatedAt(undefined);
2888
+ };
2889
+
2890
+
2891
+ /**
2892
+ * Returns whether this field is set.
2893
+ * @return {boolean}
2894
+ */
2895
+ proto.trb.strategy.v1.BacktestRun.prototype.hasCreatedAt = function() {
2896
+ return jspb.Message.getField(this, 9) != null;
2897
+ };
2898
+
2899
+
2900
+ /**
2901
+ * optional google.protobuf.Timestamp started_at = 10;
2902
+ * @return {?proto.google.protobuf.Timestamp}
2903
+ */
2904
+ proto.trb.strategy.v1.BacktestRun.prototype.getStartedAt = function() {
2905
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
2906
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 10));
2907
+ };
2908
+
2909
+
2910
+ /**
2911
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
2912
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2913
+ */
2914
+ proto.trb.strategy.v1.BacktestRun.prototype.setStartedAt = function(value) {
2915
+ return jspb.Message.setWrapperField(this, 10, value);
2916
+ };
2917
+
2918
+
2919
+ /**
2920
+ * Clears the message field making it undefined.
2921
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2922
+ */
2923
+ proto.trb.strategy.v1.BacktestRun.prototype.clearStartedAt = function() {
2924
+ return this.setStartedAt(undefined);
2925
+ };
2926
+
2927
+
2928
+ /**
2929
+ * Returns whether this field is set.
2930
+ * @return {boolean}
2931
+ */
2932
+ proto.trb.strategy.v1.BacktestRun.prototype.hasStartedAt = function() {
2933
+ return jspb.Message.getField(this, 10) != null;
2934
+ };
2935
+
2936
+
2937
+ /**
2938
+ * optional google.protobuf.Timestamp finished_at = 11;
2939
+ * @return {?proto.google.protobuf.Timestamp}
2940
+ */
2941
+ proto.trb.strategy.v1.BacktestRun.prototype.getFinishedAt = function() {
2942
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
2943
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 11));
2944
+ };
2945
+
2946
+
2947
+ /**
2948
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
2949
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2950
+ */
2951
+ proto.trb.strategy.v1.BacktestRun.prototype.setFinishedAt = function(value) {
2952
+ return jspb.Message.setWrapperField(this, 11, value);
2953
+ };
2954
+
2955
+
2956
+ /**
2957
+ * Clears the message field making it undefined.
2958
+ * @return {!proto.trb.strategy.v1.BacktestRun} returns this
2959
+ */
2960
+ proto.trb.strategy.v1.BacktestRun.prototype.clearFinishedAt = function() {
2961
+ return this.setFinishedAt(undefined);
2962
+ };
2963
+
2964
+
2965
+ /**
2966
+ * Returns whether this field is set.
2967
+ * @return {boolean}
2968
+ */
2969
+ proto.trb.strategy.v1.BacktestRun.prototype.hasFinishedAt = function() {
2970
+ return jspb.Message.getField(this, 11) != null;
2971
+ };
2972
+
2973
+
2974
+
2975
+
2976
+
2977
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2978
+ /**
2979
+ * Creates an object representation of this proto.
2980
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2981
+ * Optional fields that are not set will be set to undefined.
2982
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2983
+ * For the list of reserved names please see:
2984
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2985
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2986
+ * JSPB instance for transitional soy proto support:
2987
+ * http://goto/soy-param-migration
2988
+ * @return {!Object}
2989
+ */
2990
+ proto.trb.strategy.v1.BacktestTask.prototype.toObject = function(opt_includeInstance) {
2991
+ return proto.trb.strategy.v1.BacktestTask.toObject(opt_includeInstance, this);
2992
+ };
2993
+
2994
+
2995
+ /**
2996
+ * Static version of the {@see toObject} method.
2997
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2998
+ * the JSPB instance for transitional soy proto support:
2999
+ * http://goto/soy-param-migration
3000
+ * @param {!proto.trb.strategy.v1.BacktestTask} msg The msg instance to transform.
3001
+ * @return {!Object}
3002
+ * @suppress {unusedLocalVariables} f is only used for nested messages
3003
+ */
3004
+ proto.trb.strategy.v1.BacktestTask.toObject = function(includeInstance, msg) {
3005
+ var f, obj = {
3006
+ runId: jspb.Message.getFieldWithDefault(msg, 1, "")
3007
+ };
3008
+
3009
+ if (includeInstance) {
3010
+ obj.$jspbMessageInstance = msg;
3011
+ }
3012
+ return obj;
3013
+ };
3014
+ }
3015
+
3016
+
3017
+ /**
3018
+ * Deserializes binary data (in protobuf wire format).
3019
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
3020
+ * @return {!proto.trb.strategy.v1.BacktestTask}
3021
+ */
3022
+ proto.trb.strategy.v1.BacktestTask.deserializeBinary = function(bytes) {
3023
+ var reader = new jspb.BinaryReader(bytes);
3024
+ var msg = new proto.trb.strategy.v1.BacktestTask;
3025
+ return proto.trb.strategy.v1.BacktestTask.deserializeBinaryFromReader(msg, reader);
3026
+ };
3027
+
3028
+
3029
+ /**
3030
+ * Deserializes binary data (in protobuf wire format) from the
3031
+ * given reader into the given message object.
3032
+ * @param {!proto.trb.strategy.v1.BacktestTask} msg The message object to deserialize into.
3033
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3034
+ * @return {!proto.trb.strategy.v1.BacktestTask}
3035
+ */
3036
+ proto.trb.strategy.v1.BacktestTask.deserializeBinaryFromReader = function(msg, reader) {
3037
+ while (reader.nextField()) {
3038
+ if (reader.isEndGroup()) {
3039
+ break;
3040
+ }
3041
+ var field = reader.getFieldNumber();
3042
+ switch (field) {
3043
+ case 1:
3044
+ var value = /** @type {string} */ (reader.readString());
3045
+ msg.setRunId(value);
3046
+ break;
3047
+ default:
3048
+ reader.skipField();
3049
+ break;
3050
+ }
3051
+ }
3052
+ return msg;
3053
+ };
3054
+
3055
+
3056
+ /**
3057
+ * Serializes the message to binary data (in protobuf wire format).
3058
+ * @return {!Uint8Array}
3059
+ */
3060
+ proto.trb.strategy.v1.BacktestTask.prototype.serializeBinary = function() {
3061
+ var writer = new jspb.BinaryWriter();
3062
+ proto.trb.strategy.v1.BacktestTask.serializeBinaryToWriter(this, writer);
3063
+ return writer.getResultBuffer();
3064
+ };
3065
+
3066
+
3067
+ /**
3068
+ * Serializes the given message to binary data (in protobuf wire
3069
+ * format), writing to the given BinaryWriter.
3070
+ * @param {!proto.trb.strategy.v1.BacktestTask} message
3071
+ * @param {!jspb.BinaryWriter} writer
3072
+ * @suppress {unusedLocalVariables} f is only used for nested messages
3073
+ */
3074
+ proto.trb.strategy.v1.BacktestTask.serializeBinaryToWriter = function(message, writer) {
3075
+ var f = undefined;
3076
+ f = message.getRunId();
3077
+ if (f.length > 0) {
3078
+ writer.writeString(
3079
+ 1,
3080
+ f
3081
+ );
3082
+ }
3083
+ };
3084
+
3085
+
3086
+ /**
3087
+ * optional string run_id = 1;
3088
+ * @return {string}
3089
+ */
3090
+ proto.trb.strategy.v1.BacktestTask.prototype.getRunId = function() {
3091
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
3092
+ };
3093
+
3094
+
3095
+ /**
3096
+ * @param {string} value
3097
+ * @return {!proto.trb.strategy.v1.BacktestTask} returns this
3098
+ */
3099
+ proto.trb.strategy.v1.BacktestTask.prototype.setRunId = function(value) {
3100
+ return jspb.Message.setProto3StringField(this, 1, value);
3101
+ };
3102
+
3103
+
3104
+ /**
3105
+ * @enum {number}
3106
+ */
3107
+ proto.trb.strategy.v1.RunStatus = {
3108
+ RUN_STATUS_UNSPECIFIED: 0,
3109
+ RUN_QUEUED: 1,
3110
+ RUN_RUNNING: 2,
3111
+ RUN_SUCCEEDED: 3,
3112
+ RUN_FAILED: 4,
3113
+ RUN_CANCELED: 5
3114
+ };
3115
+
3116
+ goog.object.extend(exports, proto.trb.strategy.v1);