@marleena/trb-proto 1.0.45 → 1.0.51

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