@marleena/trb-proto 1.0.61 → 1.0.62

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.
@@ -1,3776 +0,0 @@
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
- benchmarkUid: jspb.Message.getFieldWithDefault(msg, 9, "")
246
- };
247
-
248
- if (includeInstance) {
249
- obj.$jspbMessageInstance = msg;
250
- }
251
- return obj;
252
- };
253
- }
254
-
255
-
256
- /**
257
- * Deserializes binary data (in protobuf wire format).
258
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
259
- * @return {!proto.trb.strategy.v1.BacktestConfig}
260
- */
261
- proto.trb.strategy.v1.BacktestConfig.deserializeBinary = function(bytes) {
262
- var reader = new jspb.BinaryReader(bytes);
263
- var msg = new proto.trb.strategy.v1.BacktestConfig;
264
- return proto.trb.strategy.v1.BacktestConfig.deserializeBinaryFromReader(msg, reader);
265
- };
266
-
267
-
268
- /**
269
- * Deserializes binary data (in protobuf wire format) from the
270
- * given reader into the given message object.
271
- * @param {!proto.trb.strategy.v1.BacktestConfig} msg The message object to deserialize into.
272
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
273
- * @return {!proto.trb.strategy.v1.BacktestConfig}
274
- */
275
- proto.trb.strategy.v1.BacktestConfig.deserializeBinaryFromReader = function(msg, reader) {
276
- while (reader.nextField()) {
277
- if (reader.isEndGroup()) {
278
- break;
279
- }
280
- var field = reader.getFieldNumber();
281
- switch (field) {
282
- case 1:
283
- var value = /** @type {string} */ (reader.readString());
284
- msg.setUid(value);
285
- break;
286
- case 2:
287
- var value = /** @type {number} */ (reader.readInt32());
288
- msg.setInterval(value);
289
- break;
290
- case 3:
291
- var value = new google_protobuf_timestamp_pb.Timestamp;
292
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
293
- msg.setStart(value);
294
- break;
295
- case 4:
296
- var value = new google_protobuf_timestamp_pb.Timestamp;
297
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
298
- msg.setEnd(value);
299
- break;
300
- case 5:
301
- var value = /** @type {number} */ (reader.readDouble());
302
- msg.setInitialCash(value);
303
- break;
304
- case 6:
305
- var value = /** @type {number} */ (reader.readDouble());
306
- msg.setCommissionPct(value);
307
- break;
308
- case 7:
309
- var value = /** @type {number} */ (reader.readDouble());
310
- msg.setSlippagePct(value);
311
- break;
312
- case 8:
313
- var value = /** @type {boolean} */ (reader.readBool());
314
- msg.setLongOnly(value);
315
- break;
316
- case 9:
317
- var value = /** @type {string} */ (reader.readString());
318
- msg.setBenchmarkUid(value);
319
- break;
320
- default:
321
- reader.skipField();
322
- break;
323
- }
324
- }
325
- return msg;
326
- };
327
-
328
-
329
- /**
330
- * Serializes the message to binary data (in protobuf wire format).
331
- * @return {!Uint8Array}
332
- */
333
- proto.trb.strategy.v1.BacktestConfig.prototype.serializeBinary = function() {
334
- var writer = new jspb.BinaryWriter();
335
- proto.trb.strategy.v1.BacktestConfig.serializeBinaryToWriter(this, writer);
336
- return writer.getResultBuffer();
337
- };
338
-
339
-
340
- /**
341
- * Serializes the given message to binary data (in protobuf wire
342
- * format), writing to the given BinaryWriter.
343
- * @param {!proto.trb.strategy.v1.BacktestConfig} message
344
- * @param {!jspb.BinaryWriter} writer
345
- * @suppress {unusedLocalVariables} f is only used for nested messages
346
- */
347
- proto.trb.strategy.v1.BacktestConfig.serializeBinaryToWriter = function(message, writer) {
348
- var f = undefined;
349
- f = message.getUid();
350
- if (f.length > 0) {
351
- writer.writeString(
352
- 1,
353
- f
354
- );
355
- }
356
- f = message.getInterval();
357
- if (f !== 0) {
358
- writer.writeInt32(
359
- 2,
360
- f
361
- );
362
- }
363
- f = message.getStart();
364
- if (f != null) {
365
- writer.writeMessage(
366
- 3,
367
- f,
368
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
369
- );
370
- }
371
- f = message.getEnd();
372
- if (f != null) {
373
- writer.writeMessage(
374
- 4,
375
- f,
376
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
377
- );
378
- }
379
- f = message.getInitialCash();
380
- if (f !== 0.0) {
381
- writer.writeDouble(
382
- 5,
383
- f
384
- );
385
- }
386
- f = message.getCommissionPct();
387
- if (f !== 0.0) {
388
- writer.writeDouble(
389
- 6,
390
- f
391
- );
392
- }
393
- f = message.getSlippagePct();
394
- if (f !== 0.0) {
395
- writer.writeDouble(
396
- 7,
397
- f
398
- );
399
- }
400
- f = message.getLongOnly();
401
- if (f) {
402
- writer.writeBool(
403
- 8,
404
- f
405
- );
406
- }
407
- f = message.getBenchmarkUid();
408
- if (f.length > 0) {
409
- writer.writeString(
410
- 9,
411
- f
412
- );
413
- }
414
- };
415
-
416
-
417
- /**
418
- * optional string uid = 1;
419
- * @return {string}
420
- */
421
- proto.trb.strategy.v1.BacktestConfig.prototype.getUid = function() {
422
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
423
- };
424
-
425
-
426
- /**
427
- * @param {string} value
428
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
429
- */
430
- proto.trb.strategy.v1.BacktestConfig.prototype.setUid = function(value) {
431
- return jspb.Message.setProto3StringField(this, 1, value);
432
- };
433
-
434
-
435
- /**
436
- * optional int32 interval = 2;
437
- * @return {number}
438
- */
439
- proto.trb.strategy.v1.BacktestConfig.prototype.getInterval = function() {
440
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
441
- };
442
-
443
-
444
- /**
445
- * @param {number} value
446
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
447
- */
448
- proto.trb.strategy.v1.BacktestConfig.prototype.setInterval = function(value) {
449
- return jspb.Message.setProto3IntField(this, 2, value);
450
- };
451
-
452
-
453
- /**
454
- * optional google.protobuf.Timestamp start = 3;
455
- * @return {?proto.google.protobuf.Timestamp}
456
- */
457
- proto.trb.strategy.v1.BacktestConfig.prototype.getStart = function() {
458
- return /** @type{?proto.google.protobuf.Timestamp} */ (
459
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
460
- };
461
-
462
-
463
- /**
464
- * @param {?proto.google.protobuf.Timestamp|undefined} value
465
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
466
- */
467
- proto.trb.strategy.v1.BacktestConfig.prototype.setStart = function(value) {
468
- return jspb.Message.setWrapperField(this, 3, value);
469
- };
470
-
471
-
472
- /**
473
- * Clears the message field making it undefined.
474
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
475
- */
476
- proto.trb.strategy.v1.BacktestConfig.prototype.clearStart = function() {
477
- return this.setStart(undefined);
478
- };
479
-
480
-
481
- /**
482
- * Returns whether this field is set.
483
- * @return {boolean}
484
- */
485
- proto.trb.strategy.v1.BacktestConfig.prototype.hasStart = function() {
486
- return jspb.Message.getField(this, 3) != null;
487
- };
488
-
489
-
490
- /**
491
- * optional google.protobuf.Timestamp end = 4;
492
- * @return {?proto.google.protobuf.Timestamp}
493
- */
494
- proto.trb.strategy.v1.BacktestConfig.prototype.getEnd = function() {
495
- return /** @type{?proto.google.protobuf.Timestamp} */ (
496
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4));
497
- };
498
-
499
-
500
- /**
501
- * @param {?proto.google.protobuf.Timestamp|undefined} value
502
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
503
- */
504
- proto.trb.strategy.v1.BacktestConfig.prototype.setEnd = function(value) {
505
- return jspb.Message.setWrapperField(this, 4, value);
506
- };
507
-
508
-
509
- /**
510
- * Clears the message field making it undefined.
511
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
512
- */
513
- proto.trb.strategy.v1.BacktestConfig.prototype.clearEnd = function() {
514
- return this.setEnd(undefined);
515
- };
516
-
517
-
518
- /**
519
- * Returns whether this field is set.
520
- * @return {boolean}
521
- */
522
- proto.trb.strategy.v1.BacktestConfig.prototype.hasEnd = function() {
523
- return jspb.Message.getField(this, 4) != null;
524
- };
525
-
526
-
527
- /**
528
- * optional double initial_cash = 5;
529
- * @return {number}
530
- */
531
- proto.trb.strategy.v1.BacktestConfig.prototype.getInitialCash = function() {
532
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
533
- };
534
-
535
-
536
- /**
537
- * @param {number} value
538
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
539
- */
540
- proto.trb.strategy.v1.BacktestConfig.prototype.setInitialCash = function(value) {
541
- return jspb.Message.setProto3FloatField(this, 5, value);
542
- };
543
-
544
-
545
- /**
546
- * optional double commission_pct = 6;
547
- * @return {number}
548
- */
549
- proto.trb.strategy.v1.BacktestConfig.prototype.getCommissionPct = function() {
550
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
551
- };
552
-
553
-
554
- /**
555
- * @param {number} value
556
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
557
- */
558
- proto.trb.strategy.v1.BacktestConfig.prototype.setCommissionPct = function(value) {
559
- return jspb.Message.setProto3FloatField(this, 6, value);
560
- };
561
-
562
-
563
- /**
564
- * optional double slippage_pct = 7;
565
- * @return {number}
566
- */
567
- proto.trb.strategy.v1.BacktestConfig.prototype.getSlippagePct = function() {
568
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 7, 0.0));
569
- };
570
-
571
-
572
- /**
573
- * @param {number} value
574
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
575
- */
576
- proto.trb.strategy.v1.BacktestConfig.prototype.setSlippagePct = function(value) {
577
- return jspb.Message.setProto3FloatField(this, 7, value);
578
- };
579
-
580
-
581
- /**
582
- * optional bool long_only = 8;
583
- * @return {boolean}
584
- */
585
- proto.trb.strategy.v1.BacktestConfig.prototype.getLongOnly = function() {
586
- return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false));
587
- };
588
-
589
-
590
- /**
591
- * @param {boolean} value
592
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
593
- */
594
- proto.trb.strategy.v1.BacktestConfig.prototype.setLongOnly = function(value) {
595
- return jspb.Message.setProto3BooleanField(this, 8, value);
596
- };
597
-
598
-
599
- /**
600
- * optional string benchmark_uid = 9;
601
- * @return {string}
602
- */
603
- proto.trb.strategy.v1.BacktestConfig.prototype.getBenchmarkUid = function() {
604
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
605
- };
606
-
607
-
608
- /**
609
- * @param {string} value
610
- * @return {!proto.trb.strategy.v1.BacktestConfig} returns this
611
- */
612
- proto.trb.strategy.v1.BacktestConfig.prototype.setBenchmarkUid = function(value) {
613
- return jspb.Message.setProto3StringField(this, 9, value);
614
- };
615
-
616
-
617
-
618
-
619
-
620
- if (jspb.Message.GENERATE_TO_OBJECT) {
621
- /**
622
- * Creates an object representation of this proto.
623
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
624
- * Optional fields that are not set will be set to undefined.
625
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
626
- * For the list of reserved names please see:
627
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
628
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
629
- * JSPB instance for transitional soy proto support:
630
- * http://goto/soy-param-migration
631
- * @return {!Object}
632
- */
633
- proto.trb.strategy.v1.BacktestMetrics.prototype.toObject = function(opt_includeInstance) {
634
- return proto.trb.strategy.v1.BacktestMetrics.toObject(opt_includeInstance, this);
635
- };
636
-
637
-
638
- /**
639
- * Static version of the {@see toObject} method.
640
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
641
- * the JSPB instance for transitional soy proto support:
642
- * http://goto/soy-param-migration
643
- * @param {!proto.trb.strategy.v1.BacktestMetrics} msg The msg instance to transform.
644
- * @return {!Object}
645
- * @suppress {unusedLocalVariables} f is only used for nested messages
646
- */
647
- proto.trb.strategy.v1.BacktestMetrics.toObject = function(includeInstance, msg) {
648
- var f, obj = {
649
- totalReturn: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0),
650
- cagr: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0),
651
- sharpe: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0),
652
- sortino: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
653
- maxDrawdown: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0),
654
- winRate: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0),
655
- profitFactor: jspb.Message.getFloatingPointFieldWithDefault(msg, 7, 0.0),
656
- sqn: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 0.0),
657
- tradesCount: jspb.Message.getFieldWithDefault(msg, 9, 0),
658
- exposure: jspb.Message.getFloatingPointFieldWithDefault(msg, 10, 0.0),
659
- finalEquity: jspb.Message.getFloatingPointFieldWithDefault(msg, 11, 0.0),
660
- avgTradePct: jspb.Message.getFloatingPointFieldWithDefault(msg, 12, 0.0),
661
- expectancy: jspb.Message.getFloatingPointFieldWithDefault(msg, 13, 0.0),
662
- calmar: jspb.Message.getFloatingPointFieldWithDefault(msg, 21, 0.0),
663
- omega: jspb.Message.getFloatingPointFieldWithDefault(msg, 22, 0.0),
664
- tailRatio: jspb.Message.getFloatingPointFieldWithDefault(msg, 23, 0.0),
665
- valueAtRisk: jspb.Message.getFloatingPointFieldWithDefault(msg, 24, 0.0),
666
- conditionalValueAtRisk: jspb.Message.getFloatingPointFieldWithDefault(msg, 25, 0.0),
667
- skew: jspb.Message.getFloatingPointFieldWithDefault(msg, 26, 0.0),
668
- kurtosis: jspb.Message.getFloatingPointFieldWithDefault(msg, 27, 0.0),
669
- kellyCriterion: jspb.Message.getFloatingPointFieldWithDefault(msg, 28, 0.0),
670
- riskOfRuin: jspb.Message.getFloatingPointFieldWithDefault(msg, 29, 0.0),
671
- recoveryFactor: jspb.Message.getFloatingPointFieldWithDefault(msg, 30, 0.0),
672
- payoffRatio: jspb.Message.getFloatingPointFieldWithDefault(msg, 31, 0.0),
673
- gainToPainRatio: jspb.Message.getFloatingPointFieldWithDefault(msg, 32, 0.0),
674
- outlierWinRatio: jspb.Message.getFloatingPointFieldWithDefault(msg, 33, 0.0),
675
- outlierLossRatio: jspb.Message.getFloatingPointFieldWithDefault(msg, 34, 0.0),
676
- commonSenseRatio: jspb.Message.getFloatingPointFieldWithDefault(msg, 35, 0.0),
677
- ulcerIndex: jspb.Message.getFloatingPointFieldWithDefault(msg, 36, 0.0),
678
- serenityIndex: jspb.Message.getFloatingPointFieldWithDefault(msg, 37, 0.0),
679
- alpha: jspb.Message.getFloatingPointFieldWithDefault(msg, 38, 0.0),
680
- beta: jspb.Message.getFloatingPointFieldWithDefault(msg, 39, 0.0),
681
- informationRatio: jspb.Message.getFloatingPointFieldWithDefault(msg, 40, 0.0),
682
- rSquared: jspb.Message.getFloatingPointFieldWithDefault(msg, 41, 0.0),
683
- extraMap: (f = msg.getExtraMap()) ? f.toObject(includeInstance, undefined) : []
684
- };
685
-
686
- if (includeInstance) {
687
- obj.$jspbMessageInstance = msg;
688
- }
689
- return obj;
690
- };
691
- }
692
-
693
-
694
- /**
695
- * Deserializes binary data (in protobuf wire format).
696
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
697
- * @return {!proto.trb.strategy.v1.BacktestMetrics}
698
- */
699
- proto.trb.strategy.v1.BacktestMetrics.deserializeBinary = function(bytes) {
700
- var reader = new jspb.BinaryReader(bytes);
701
- var msg = new proto.trb.strategy.v1.BacktestMetrics;
702
- return proto.trb.strategy.v1.BacktestMetrics.deserializeBinaryFromReader(msg, reader);
703
- };
704
-
705
-
706
- /**
707
- * Deserializes binary data (in protobuf wire format) from the
708
- * given reader into the given message object.
709
- * @param {!proto.trb.strategy.v1.BacktestMetrics} msg The message object to deserialize into.
710
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
711
- * @return {!proto.trb.strategy.v1.BacktestMetrics}
712
- */
713
- proto.trb.strategy.v1.BacktestMetrics.deserializeBinaryFromReader = function(msg, reader) {
714
- while (reader.nextField()) {
715
- if (reader.isEndGroup()) {
716
- break;
717
- }
718
- var field = reader.getFieldNumber();
719
- switch (field) {
720
- case 1:
721
- var value = /** @type {number} */ (reader.readDouble());
722
- msg.setTotalReturn(value);
723
- break;
724
- case 2:
725
- var value = /** @type {number} */ (reader.readDouble());
726
- msg.setCagr(value);
727
- break;
728
- case 3:
729
- var value = /** @type {number} */ (reader.readDouble());
730
- msg.setSharpe(value);
731
- break;
732
- case 4:
733
- var value = /** @type {number} */ (reader.readDouble());
734
- msg.setSortino(value);
735
- break;
736
- case 5:
737
- var value = /** @type {number} */ (reader.readDouble());
738
- msg.setMaxDrawdown(value);
739
- break;
740
- case 6:
741
- var value = /** @type {number} */ (reader.readDouble());
742
- msg.setWinRate(value);
743
- break;
744
- case 7:
745
- var value = /** @type {number} */ (reader.readDouble());
746
- msg.setProfitFactor(value);
747
- break;
748
- case 8:
749
- var value = /** @type {number} */ (reader.readDouble());
750
- msg.setSqn(value);
751
- break;
752
- case 9:
753
- var value = /** @type {number} */ (reader.readUint32());
754
- msg.setTradesCount(value);
755
- break;
756
- case 10:
757
- var value = /** @type {number} */ (reader.readDouble());
758
- msg.setExposure(value);
759
- break;
760
- case 11:
761
- var value = /** @type {number} */ (reader.readDouble());
762
- msg.setFinalEquity(value);
763
- break;
764
- case 12:
765
- var value = /** @type {number} */ (reader.readDouble());
766
- msg.setAvgTradePct(value);
767
- break;
768
- case 13:
769
- var value = /** @type {number} */ (reader.readDouble());
770
- msg.setExpectancy(value);
771
- break;
772
- case 21:
773
- var value = /** @type {number} */ (reader.readDouble());
774
- msg.setCalmar(value);
775
- break;
776
- case 22:
777
- var value = /** @type {number} */ (reader.readDouble());
778
- msg.setOmega(value);
779
- break;
780
- case 23:
781
- var value = /** @type {number} */ (reader.readDouble());
782
- msg.setTailRatio(value);
783
- break;
784
- case 24:
785
- var value = /** @type {number} */ (reader.readDouble());
786
- msg.setValueAtRisk(value);
787
- break;
788
- case 25:
789
- var value = /** @type {number} */ (reader.readDouble());
790
- msg.setConditionalValueAtRisk(value);
791
- break;
792
- case 26:
793
- var value = /** @type {number} */ (reader.readDouble());
794
- msg.setSkew(value);
795
- break;
796
- case 27:
797
- var value = /** @type {number} */ (reader.readDouble());
798
- msg.setKurtosis(value);
799
- break;
800
- case 28:
801
- var value = /** @type {number} */ (reader.readDouble());
802
- msg.setKellyCriterion(value);
803
- break;
804
- case 29:
805
- var value = /** @type {number} */ (reader.readDouble());
806
- msg.setRiskOfRuin(value);
807
- break;
808
- case 30:
809
- var value = /** @type {number} */ (reader.readDouble());
810
- msg.setRecoveryFactor(value);
811
- break;
812
- case 31:
813
- var value = /** @type {number} */ (reader.readDouble());
814
- msg.setPayoffRatio(value);
815
- break;
816
- case 32:
817
- var value = /** @type {number} */ (reader.readDouble());
818
- msg.setGainToPainRatio(value);
819
- break;
820
- case 33:
821
- var value = /** @type {number} */ (reader.readDouble());
822
- msg.setOutlierWinRatio(value);
823
- break;
824
- case 34:
825
- var value = /** @type {number} */ (reader.readDouble());
826
- msg.setOutlierLossRatio(value);
827
- break;
828
- case 35:
829
- var value = /** @type {number} */ (reader.readDouble());
830
- msg.setCommonSenseRatio(value);
831
- break;
832
- case 36:
833
- var value = /** @type {number} */ (reader.readDouble());
834
- msg.setUlcerIndex(value);
835
- break;
836
- case 37:
837
- var value = /** @type {number} */ (reader.readDouble());
838
- msg.setSerenityIndex(value);
839
- break;
840
- case 38:
841
- var value = /** @type {number} */ (reader.readDouble());
842
- msg.setAlpha(value);
843
- break;
844
- case 39:
845
- var value = /** @type {number} */ (reader.readDouble());
846
- msg.setBeta(value);
847
- break;
848
- case 40:
849
- var value = /** @type {number} */ (reader.readDouble());
850
- msg.setInformationRatio(value);
851
- break;
852
- case 41:
853
- var value = /** @type {number} */ (reader.readDouble());
854
- msg.setRSquared(value);
855
- break;
856
- case 20:
857
- var value = msg.getExtraMap();
858
- reader.readMessage(value, function(message, reader) {
859
- jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readDouble, null, "", 0.0);
860
- });
861
- break;
862
- default:
863
- reader.skipField();
864
- break;
865
- }
866
- }
867
- return msg;
868
- };
869
-
870
-
871
- /**
872
- * Serializes the message to binary data (in protobuf wire format).
873
- * @return {!Uint8Array}
874
- */
875
- proto.trb.strategy.v1.BacktestMetrics.prototype.serializeBinary = function() {
876
- var writer = new jspb.BinaryWriter();
877
- proto.trb.strategy.v1.BacktestMetrics.serializeBinaryToWriter(this, writer);
878
- return writer.getResultBuffer();
879
- };
880
-
881
-
882
- /**
883
- * Serializes the given message to binary data (in protobuf wire
884
- * format), writing to the given BinaryWriter.
885
- * @param {!proto.trb.strategy.v1.BacktestMetrics} message
886
- * @param {!jspb.BinaryWriter} writer
887
- * @suppress {unusedLocalVariables} f is only used for nested messages
888
- */
889
- proto.trb.strategy.v1.BacktestMetrics.serializeBinaryToWriter = function(message, writer) {
890
- var f = undefined;
891
- f = message.getTotalReturn();
892
- if (f !== 0.0) {
893
- writer.writeDouble(
894
- 1,
895
- f
896
- );
897
- }
898
- f = message.getCagr();
899
- if (f !== 0.0) {
900
- writer.writeDouble(
901
- 2,
902
- f
903
- );
904
- }
905
- f = message.getSharpe();
906
- if (f !== 0.0) {
907
- writer.writeDouble(
908
- 3,
909
- f
910
- );
911
- }
912
- f = message.getSortino();
913
- if (f !== 0.0) {
914
- writer.writeDouble(
915
- 4,
916
- f
917
- );
918
- }
919
- f = message.getMaxDrawdown();
920
- if (f !== 0.0) {
921
- writer.writeDouble(
922
- 5,
923
- f
924
- );
925
- }
926
- f = message.getWinRate();
927
- if (f !== 0.0) {
928
- writer.writeDouble(
929
- 6,
930
- f
931
- );
932
- }
933
- f = message.getProfitFactor();
934
- if (f !== 0.0) {
935
- writer.writeDouble(
936
- 7,
937
- f
938
- );
939
- }
940
- f = message.getSqn();
941
- if (f !== 0.0) {
942
- writer.writeDouble(
943
- 8,
944
- f
945
- );
946
- }
947
- f = message.getTradesCount();
948
- if (f !== 0) {
949
- writer.writeUint32(
950
- 9,
951
- f
952
- );
953
- }
954
- f = message.getExposure();
955
- if (f !== 0.0) {
956
- writer.writeDouble(
957
- 10,
958
- f
959
- );
960
- }
961
- f = message.getFinalEquity();
962
- if (f !== 0.0) {
963
- writer.writeDouble(
964
- 11,
965
- f
966
- );
967
- }
968
- f = message.getAvgTradePct();
969
- if (f !== 0.0) {
970
- writer.writeDouble(
971
- 12,
972
- f
973
- );
974
- }
975
- f = message.getExpectancy();
976
- if (f !== 0.0) {
977
- writer.writeDouble(
978
- 13,
979
- f
980
- );
981
- }
982
- f = message.getCalmar();
983
- if (f !== 0.0) {
984
- writer.writeDouble(
985
- 21,
986
- f
987
- );
988
- }
989
- f = message.getOmega();
990
- if (f !== 0.0) {
991
- writer.writeDouble(
992
- 22,
993
- f
994
- );
995
- }
996
- f = message.getTailRatio();
997
- if (f !== 0.0) {
998
- writer.writeDouble(
999
- 23,
1000
- f
1001
- );
1002
- }
1003
- f = message.getValueAtRisk();
1004
- if (f !== 0.0) {
1005
- writer.writeDouble(
1006
- 24,
1007
- f
1008
- );
1009
- }
1010
- f = message.getConditionalValueAtRisk();
1011
- if (f !== 0.0) {
1012
- writer.writeDouble(
1013
- 25,
1014
- f
1015
- );
1016
- }
1017
- f = message.getSkew();
1018
- if (f !== 0.0) {
1019
- writer.writeDouble(
1020
- 26,
1021
- f
1022
- );
1023
- }
1024
- f = message.getKurtosis();
1025
- if (f !== 0.0) {
1026
- writer.writeDouble(
1027
- 27,
1028
- f
1029
- );
1030
- }
1031
- f = message.getKellyCriterion();
1032
- if (f !== 0.0) {
1033
- writer.writeDouble(
1034
- 28,
1035
- f
1036
- );
1037
- }
1038
- f = message.getRiskOfRuin();
1039
- if (f !== 0.0) {
1040
- writer.writeDouble(
1041
- 29,
1042
- f
1043
- );
1044
- }
1045
- f = message.getRecoveryFactor();
1046
- if (f !== 0.0) {
1047
- writer.writeDouble(
1048
- 30,
1049
- f
1050
- );
1051
- }
1052
- f = message.getPayoffRatio();
1053
- if (f !== 0.0) {
1054
- writer.writeDouble(
1055
- 31,
1056
- f
1057
- );
1058
- }
1059
- f = message.getGainToPainRatio();
1060
- if (f !== 0.0) {
1061
- writer.writeDouble(
1062
- 32,
1063
- f
1064
- );
1065
- }
1066
- f = message.getOutlierWinRatio();
1067
- if (f !== 0.0) {
1068
- writer.writeDouble(
1069
- 33,
1070
- f
1071
- );
1072
- }
1073
- f = message.getOutlierLossRatio();
1074
- if (f !== 0.0) {
1075
- writer.writeDouble(
1076
- 34,
1077
- f
1078
- );
1079
- }
1080
- f = message.getCommonSenseRatio();
1081
- if (f !== 0.0) {
1082
- writer.writeDouble(
1083
- 35,
1084
- f
1085
- );
1086
- }
1087
- f = message.getUlcerIndex();
1088
- if (f !== 0.0) {
1089
- writer.writeDouble(
1090
- 36,
1091
- f
1092
- );
1093
- }
1094
- f = message.getSerenityIndex();
1095
- if (f !== 0.0) {
1096
- writer.writeDouble(
1097
- 37,
1098
- f
1099
- );
1100
- }
1101
- f = message.getAlpha();
1102
- if (f !== 0.0) {
1103
- writer.writeDouble(
1104
- 38,
1105
- f
1106
- );
1107
- }
1108
- f = message.getBeta();
1109
- if (f !== 0.0) {
1110
- writer.writeDouble(
1111
- 39,
1112
- f
1113
- );
1114
- }
1115
- f = message.getInformationRatio();
1116
- if (f !== 0.0) {
1117
- writer.writeDouble(
1118
- 40,
1119
- f
1120
- );
1121
- }
1122
- f = message.getRSquared();
1123
- if (f !== 0.0) {
1124
- writer.writeDouble(
1125
- 41,
1126
- f
1127
- );
1128
- }
1129
- f = message.getExtraMap(true);
1130
- if (f && f.getLength() > 0) {
1131
- f.serializeBinary(20, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeDouble);
1132
- }
1133
- };
1134
-
1135
-
1136
- /**
1137
- * optional double total_return = 1;
1138
- * @return {number}
1139
- */
1140
- proto.trb.strategy.v1.BacktestMetrics.prototype.getTotalReturn = function() {
1141
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0));
1142
- };
1143
-
1144
-
1145
- /**
1146
- * @param {number} value
1147
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1148
- */
1149
- proto.trb.strategy.v1.BacktestMetrics.prototype.setTotalReturn = function(value) {
1150
- return jspb.Message.setProto3FloatField(this, 1, value);
1151
- };
1152
-
1153
-
1154
- /**
1155
- * optional double cagr = 2;
1156
- * @return {number}
1157
- */
1158
- proto.trb.strategy.v1.BacktestMetrics.prototype.getCagr = function() {
1159
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
1160
- };
1161
-
1162
-
1163
- /**
1164
- * @param {number} value
1165
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1166
- */
1167
- proto.trb.strategy.v1.BacktestMetrics.prototype.setCagr = function(value) {
1168
- return jspb.Message.setProto3FloatField(this, 2, value);
1169
- };
1170
-
1171
-
1172
- /**
1173
- * optional double sharpe = 3;
1174
- * @return {number}
1175
- */
1176
- proto.trb.strategy.v1.BacktestMetrics.prototype.getSharpe = function() {
1177
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0));
1178
- };
1179
-
1180
-
1181
- /**
1182
- * @param {number} value
1183
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1184
- */
1185
- proto.trb.strategy.v1.BacktestMetrics.prototype.setSharpe = function(value) {
1186
- return jspb.Message.setProto3FloatField(this, 3, value);
1187
- };
1188
-
1189
-
1190
- /**
1191
- * optional double sortino = 4;
1192
- * @return {number}
1193
- */
1194
- proto.trb.strategy.v1.BacktestMetrics.prototype.getSortino = function() {
1195
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
1196
- };
1197
-
1198
-
1199
- /**
1200
- * @param {number} value
1201
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1202
- */
1203
- proto.trb.strategy.v1.BacktestMetrics.prototype.setSortino = function(value) {
1204
- return jspb.Message.setProto3FloatField(this, 4, value);
1205
- };
1206
-
1207
-
1208
- /**
1209
- * optional double max_drawdown = 5;
1210
- * @return {number}
1211
- */
1212
- proto.trb.strategy.v1.BacktestMetrics.prototype.getMaxDrawdown = function() {
1213
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
1214
- };
1215
-
1216
-
1217
- /**
1218
- * @param {number} value
1219
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1220
- */
1221
- proto.trb.strategy.v1.BacktestMetrics.prototype.setMaxDrawdown = function(value) {
1222
- return jspb.Message.setProto3FloatField(this, 5, value);
1223
- };
1224
-
1225
-
1226
- /**
1227
- * optional double win_rate = 6;
1228
- * @return {number}
1229
- */
1230
- proto.trb.strategy.v1.BacktestMetrics.prototype.getWinRate = function() {
1231
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
1232
- };
1233
-
1234
-
1235
- /**
1236
- * @param {number} value
1237
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1238
- */
1239
- proto.trb.strategy.v1.BacktestMetrics.prototype.setWinRate = function(value) {
1240
- return jspb.Message.setProto3FloatField(this, 6, value);
1241
- };
1242
-
1243
-
1244
- /**
1245
- * optional double profit_factor = 7;
1246
- * @return {number}
1247
- */
1248
- proto.trb.strategy.v1.BacktestMetrics.prototype.getProfitFactor = function() {
1249
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 7, 0.0));
1250
- };
1251
-
1252
-
1253
- /**
1254
- * @param {number} value
1255
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1256
- */
1257
- proto.trb.strategy.v1.BacktestMetrics.prototype.setProfitFactor = function(value) {
1258
- return jspb.Message.setProto3FloatField(this, 7, value);
1259
- };
1260
-
1261
-
1262
- /**
1263
- * optional double sqn = 8;
1264
- * @return {number}
1265
- */
1266
- proto.trb.strategy.v1.BacktestMetrics.prototype.getSqn = function() {
1267
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 0.0));
1268
- };
1269
-
1270
-
1271
- /**
1272
- * @param {number} value
1273
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1274
- */
1275
- proto.trb.strategy.v1.BacktestMetrics.prototype.setSqn = function(value) {
1276
- return jspb.Message.setProto3FloatField(this, 8, value);
1277
- };
1278
-
1279
-
1280
- /**
1281
- * optional uint32 trades_count = 9;
1282
- * @return {number}
1283
- */
1284
- proto.trb.strategy.v1.BacktestMetrics.prototype.getTradesCount = function() {
1285
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0));
1286
- };
1287
-
1288
-
1289
- /**
1290
- * @param {number} value
1291
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1292
- */
1293
- proto.trb.strategy.v1.BacktestMetrics.prototype.setTradesCount = function(value) {
1294
- return jspb.Message.setProto3IntField(this, 9, value);
1295
- };
1296
-
1297
-
1298
- /**
1299
- * optional double exposure = 10;
1300
- * @return {number}
1301
- */
1302
- proto.trb.strategy.v1.BacktestMetrics.prototype.getExposure = function() {
1303
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 10, 0.0));
1304
- };
1305
-
1306
-
1307
- /**
1308
- * @param {number} value
1309
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1310
- */
1311
- proto.trb.strategy.v1.BacktestMetrics.prototype.setExposure = function(value) {
1312
- return jspb.Message.setProto3FloatField(this, 10, value);
1313
- };
1314
-
1315
-
1316
- /**
1317
- * optional double final_equity = 11;
1318
- * @return {number}
1319
- */
1320
- proto.trb.strategy.v1.BacktestMetrics.prototype.getFinalEquity = function() {
1321
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 11, 0.0));
1322
- };
1323
-
1324
-
1325
- /**
1326
- * @param {number} value
1327
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1328
- */
1329
- proto.trb.strategy.v1.BacktestMetrics.prototype.setFinalEquity = function(value) {
1330
- return jspb.Message.setProto3FloatField(this, 11, value);
1331
- };
1332
-
1333
-
1334
- /**
1335
- * optional double avg_trade_pct = 12;
1336
- * @return {number}
1337
- */
1338
- proto.trb.strategy.v1.BacktestMetrics.prototype.getAvgTradePct = function() {
1339
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 12, 0.0));
1340
- };
1341
-
1342
-
1343
- /**
1344
- * @param {number} value
1345
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1346
- */
1347
- proto.trb.strategy.v1.BacktestMetrics.prototype.setAvgTradePct = function(value) {
1348
- return jspb.Message.setProto3FloatField(this, 12, value);
1349
- };
1350
-
1351
-
1352
- /**
1353
- * optional double expectancy = 13;
1354
- * @return {number}
1355
- */
1356
- proto.trb.strategy.v1.BacktestMetrics.prototype.getExpectancy = function() {
1357
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 13, 0.0));
1358
- };
1359
-
1360
-
1361
- /**
1362
- * @param {number} value
1363
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1364
- */
1365
- proto.trb.strategy.v1.BacktestMetrics.prototype.setExpectancy = function(value) {
1366
- return jspb.Message.setProto3FloatField(this, 13, value);
1367
- };
1368
-
1369
-
1370
- /**
1371
- * optional double calmar = 21;
1372
- * @return {number}
1373
- */
1374
- proto.trb.strategy.v1.BacktestMetrics.prototype.getCalmar = function() {
1375
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 21, 0.0));
1376
- };
1377
-
1378
-
1379
- /**
1380
- * @param {number} value
1381
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1382
- */
1383
- proto.trb.strategy.v1.BacktestMetrics.prototype.setCalmar = function(value) {
1384
- return jspb.Message.setProto3FloatField(this, 21, value);
1385
- };
1386
-
1387
-
1388
- /**
1389
- * optional double omega = 22;
1390
- * @return {number}
1391
- */
1392
- proto.trb.strategy.v1.BacktestMetrics.prototype.getOmega = function() {
1393
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 22, 0.0));
1394
- };
1395
-
1396
-
1397
- /**
1398
- * @param {number} value
1399
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1400
- */
1401
- proto.trb.strategy.v1.BacktestMetrics.prototype.setOmega = function(value) {
1402
- return jspb.Message.setProto3FloatField(this, 22, value);
1403
- };
1404
-
1405
-
1406
- /**
1407
- * optional double tail_ratio = 23;
1408
- * @return {number}
1409
- */
1410
- proto.trb.strategy.v1.BacktestMetrics.prototype.getTailRatio = function() {
1411
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 23, 0.0));
1412
- };
1413
-
1414
-
1415
- /**
1416
- * @param {number} value
1417
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1418
- */
1419
- proto.trb.strategy.v1.BacktestMetrics.prototype.setTailRatio = function(value) {
1420
- return jspb.Message.setProto3FloatField(this, 23, value);
1421
- };
1422
-
1423
-
1424
- /**
1425
- * optional double value_at_risk = 24;
1426
- * @return {number}
1427
- */
1428
- proto.trb.strategy.v1.BacktestMetrics.prototype.getValueAtRisk = function() {
1429
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 24, 0.0));
1430
- };
1431
-
1432
-
1433
- /**
1434
- * @param {number} value
1435
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1436
- */
1437
- proto.trb.strategy.v1.BacktestMetrics.prototype.setValueAtRisk = function(value) {
1438
- return jspb.Message.setProto3FloatField(this, 24, value);
1439
- };
1440
-
1441
-
1442
- /**
1443
- * optional double conditional_value_at_risk = 25;
1444
- * @return {number}
1445
- */
1446
- proto.trb.strategy.v1.BacktestMetrics.prototype.getConditionalValueAtRisk = function() {
1447
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 25, 0.0));
1448
- };
1449
-
1450
-
1451
- /**
1452
- * @param {number} value
1453
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1454
- */
1455
- proto.trb.strategy.v1.BacktestMetrics.prototype.setConditionalValueAtRisk = function(value) {
1456
- return jspb.Message.setProto3FloatField(this, 25, value);
1457
- };
1458
-
1459
-
1460
- /**
1461
- * optional double skew = 26;
1462
- * @return {number}
1463
- */
1464
- proto.trb.strategy.v1.BacktestMetrics.prototype.getSkew = function() {
1465
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 26, 0.0));
1466
- };
1467
-
1468
-
1469
- /**
1470
- * @param {number} value
1471
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1472
- */
1473
- proto.trb.strategy.v1.BacktestMetrics.prototype.setSkew = function(value) {
1474
- return jspb.Message.setProto3FloatField(this, 26, value);
1475
- };
1476
-
1477
-
1478
- /**
1479
- * optional double kurtosis = 27;
1480
- * @return {number}
1481
- */
1482
- proto.trb.strategy.v1.BacktestMetrics.prototype.getKurtosis = function() {
1483
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 27, 0.0));
1484
- };
1485
-
1486
-
1487
- /**
1488
- * @param {number} value
1489
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1490
- */
1491
- proto.trb.strategy.v1.BacktestMetrics.prototype.setKurtosis = function(value) {
1492
- return jspb.Message.setProto3FloatField(this, 27, value);
1493
- };
1494
-
1495
-
1496
- /**
1497
- * optional double kelly_criterion = 28;
1498
- * @return {number}
1499
- */
1500
- proto.trb.strategy.v1.BacktestMetrics.prototype.getKellyCriterion = function() {
1501
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 28, 0.0));
1502
- };
1503
-
1504
-
1505
- /**
1506
- * @param {number} value
1507
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1508
- */
1509
- proto.trb.strategy.v1.BacktestMetrics.prototype.setKellyCriterion = function(value) {
1510
- return jspb.Message.setProto3FloatField(this, 28, value);
1511
- };
1512
-
1513
-
1514
- /**
1515
- * optional double risk_of_ruin = 29;
1516
- * @return {number}
1517
- */
1518
- proto.trb.strategy.v1.BacktestMetrics.prototype.getRiskOfRuin = function() {
1519
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 29, 0.0));
1520
- };
1521
-
1522
-
1523
- /**
1524
- * @param {number} value
1525
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1526
- */
1527
- proto.trb.strategy.v1.BacktestMetrics.prototype.setRiskOfRuin = function(value) {
1528
- return jspb.Message.setProto3FloatField(this, 29, value);
1529
- };
1530
-
1531
-
1532
- /**
1533
- * optional double recovery_factor = 30;
1534
- * @return {number}
1535
- */
1536
- proto.trb.strategy.v1.BacktestMetrics.prototype.getRecoveryFactor = function() {
1537
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 30, 0.0));
1538
- };
1539
-
1540
-
1541
- /**
1542
- * @param {number} value
1543
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1544
- */
1545
- proto.trb.strategy.v1.BacktestMetrics.prototype.setRecoveryFactor = function(value) {
1546
- return jspb.Message.setProto3FloatField(this, 30, value);
1547
- };
1548
-
1549
-
1550
- /**
1551
- * optional double payoff_ratio = 31;
1552
- * @return {number}
1553
- */
1554
- proto.trb.strategy.v1.BacktestMetrics.prototype.getPayoffRatio = function() {
1555
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 31, 0.0));
1556
- };
1557
-
1558
-
1559
- /**
1560
- * @param {number} value
1561
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1562
- */
1563
- proto.trb.strategy.v1.BacktestMetrics.prototype.setPayoffRatio = function(value) {
1564
- return jspb.Message.setProto3FloatField(this, 31, value);
1565
- };
1566
-
1567
-
1568
- /**
1569
- * optional double gain_to_pain_ratio = 32;
1570
- * @return {number}
1571
- */
1572
- proto.trb.strategy.v1.BacktestMetrics.prototype.getGainToPainRatio = function() {
1573
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 32, 0.0));
1574
- };
1575
-
1576
-
1577
- /**
1578
- * @param {number} value
1579
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1580
- */
1581
- proto.trb.strategy.v1.BacktestMetrics.prototype.setGainToPainRatio = function(value) {
1582
- return jspb.Message.setProto3FloatField(this, 32, value);
1583
- };
1584
-
1585
-
1586
- /**
1587
- * optional double outlier_win_ratio = 33;
1588
- * @return {number}
1589
- */
1590
- proto.trb.strategy.v1.BacktestMetrics.prototype.getOutlierWinRatio = function() {
1591
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 33, 0.0));
1592
- };
1593
-
1594
-
1595
- /**
1596
- * @param {number} value
1597
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1598
- */
1599
- proto.trb.strategy.v1.BacktestMetrics.prototype.setOutlierWinRatio = function(value) {
1600
- return jspb.Message.setProto3FloatField(this, 33, value);
1601
- };
1602
-
1603
-
1604
- /**
1605
- * optional double outlier_loss_ratio = 34;
1606
- * @return {number}
1607
- */
1608
- proto.trb.strategy.v1.BacktestMetrics.prototype.getOutlierLossRatio = function() {
1609
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 34, 0.0));
1610
- };
1611
-
1612
-
1613
- /**
1614
- * @param {number} value
1615
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1616
- */
1617
- proto.trb.strategy.v1.BacktestMetrics.prototype.setOutlierLossRatio = function(value) {
1618
- return jspb.Message.setProto3FloatField(this, 34, value);
1619
- };
1620
-
1621
-
1622
- /**
1623
- * optional double common_sense_ratio = 35;
1624
- * @return {number}
1625
- */
1626
- proto.trb.strategy.v1.BacktestMetrics.prototype.getCommonSenseRatio = function() {
1627
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 35, 0.0));
1628
- };
1629
-
1630
-
1631
- /**
1632
- * @param {number} value
1633
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1634
- */
1635
- proto.trb.strategy.v1.BacktestMetrics.prototype.setCommonSenseRatio = function(value) {
1636
- return jspb.Message.setProto3FloatField(this, 35, value);
1637
- };
1638
-
1639
-
1640
- /**
1641
- * optional double ulcer_index = 36;
1642
- * @return {number}
1643
- */
1644
- proto.trb.strategy.v1.BacktestMetrics.prototype.getUlcerIndex = function() {
1645
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 36, 0.0));
1646
- };
1647
-
1648
-
1649
- /**
1650
- * @param {number} value
1651
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1652
- */
1653
- proto.trb.strategy.v1.BacktestMetrics.prototype.setUlcerIndex = function(value) {
1654
- return jspb.Message.setProto3FloatField(this, 36, value);
1655
- };
1656
-
1657
-
1658
- /**
1659
- * optional double serenity_index = 37;
1660
- * @return {number}
1661
- */
1662
- proto.trb.strategy.v1.BacktestMetrics.prototype.getSerenityIndex = function() {
1663
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 37, 0.0));
1664
- };
1665
-
1666
-
1667
- /**
1668
- * @param {number} value
1669
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1670
- */
1671
- proto.trb.strategy.v1.BacktestMetrics.prototype.setSerenityIndex = function(value) {
1672
- return jspb.Message.setProto3FloatField(this, 37, value);
1673
- };
1674
-
1675
-
1676
- /**
1677
- * optional double alpha = 38;
1678
- * @return {number}
1679
- */
1680
- proto.trb.strategy.v1.BacktestMetrics.prototype.getAlpha = function() {
1681
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 38, 0.0));
1682
- };
1683
-
1684
-
1685
- /**
1686
- * @param {number} value
1687
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1688
- */
1689
- proto.trb.strategy.v1.BacktestMetrics.prototype.setAlpha = function(value) {
1690
- return jspb.Message.setProto3FloatField(this, 38, value);
1691
- };
1692
-
1693
-
1694
- /**
1695
- * optional double beta = 39;
1696
- * @return {number}
1697
- */
1698
- proto.trb.strategy.v1.BacktestMetrics.prototype.getBeta = function() {
1699
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 39, 0.0));
1700
- };
1701
-
1702
-
1703
- /**
1704
- * @param {number} value
1705
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1706
- */
1707
- proto.trb.strategy.v1.BacktestMetrics.prototype.setBeta = function(value) {
1708
- return jspb.Message.setProto3FloatField(this, 39, value);
1709
- };
1710
-
1711
-
1712
- /**
1713
- * optional double information_ratio = 40;
1714
- * @return {number}
1715
- */
1716
- proto.trb.strategy.v1.BacktestMetrics.prototype.getInformationRatio = function() {
1717
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 40, 0.0));
1718
- };
1719
-
1720
-
1721
- /**
1722
- * @param {number} value
1723
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1724
- */
1725
- proto.trb.strategy.v1.BacktestMetrics.prototype.setInformationRatio = function(value) {
1726
- return jspb.Message.setProto3FloatField(this, 40, value);
1727
- };
1728
-
1729
-
1730
- /**
1731
- * optional double r_squared = 41;
1732
- * @return {number}
1733
- */
1734
- proto.trb.strategy.v1.BacktestMetrics.prototype.getRSquared = function() {
1735
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 41, 0.0));
1736
- };
1737
-
1738
-
1739
- /**
1740
- * @param {number} value
1741
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1742
- */
1743
- proto.trb.strategy.v1.BacktestMetrics.prototype.setRSquared = function(value) {
1744
- return jspb.Message.setProto3FloatField(this, 41, value);
1745
- };
1746
-
1747
-
1748
- /**
1749
- * map<string, double> extra = 20;
1750
- * @param {boolean=} opt_noLazyCreate Do not create the map if
1751
- * empty, instead returning `undefined`
1752
- * @return {!jspb.Map<string,number>}
1753
- */
1754
- proto.trb.strategy.v1.BacktestMetrics.prototype.getExtraMap = function(opt_noLazyCreate) {
1755
- return /** @type {!jspb.Map<string,number>} */ (
1756
- jspb.Message.getMapField(this, 20, opt_noLazyCreate,
1757
- null));
1758
- };
1759
-
1760
-
1761
- /**
1762
- * Clears values from the map. The map will be non-null.
1763
- * @return {!proto.trb.strategy.v1.BacktestMetrics} returns this
1764
- */
1765
- proto.trb.strategy.v1.BacktestMetrics.prototype.clearExtraMap = function() {
1766
- this.getExtraMap().clear();
1767
- return this;
1768
- };
1769
-
1770
-
1771
-
1772
-
1773
-
1774
- if (jspb.Message.GENERATE_TO_OBJECT) {
1775
- /**
1776
- * Creates an object representation of this proto.
1777
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
1778
- * Optional fields that are not set will be set to undefined.
1779
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1780
- * For the list of reserved names please see:
1781
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1782
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1783
- * JSPB instance for transitional soy proto support:
1784
- * http://goto/soy-param-migration
1785
- * @return {!Object}
1786
- */
1787
- proto.trb.strategy.v1.EquityPoint.prototype.toObject = function(opt_includeInstance) {
1788
- return proto.trb.strategy.v1.EquityPoint.toObject(opt_includeInstance, this);
1789
- };
1790
-
1791
-
1792
- /**
1793
- * Static version of the {@see toObject} method.
1794
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1795
- * the JSPB instance for transitional soy proto support:
1796
- * http://goto/soy-param-migration
1797
- * @param {!proto.trb.strategy.v1.EquityPoint} msg The msg instance to transform.
1798
- * @return {!Object}
1799
- * @suppress {unusedLocalVariables} f is only used for nested messages
1800
- */
1801
- proto.trb.strategy.v1.EquityPoint.toObject = function(includeInstance, msg) {
1802
- var f, obj = {
1803
- time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
1804
- equity: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0),
1805
- cash: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0),
1806
- positionValue: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
1807
- drawdown: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0),
1808
- ret: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0)
1809
- };
1810
-
1811
- if (includeInstance) {
1812
- obj.$jspbMessageInstance = msg;
1813
- }
1814
- return obj;
1815
- };
1816
- }
1817
-
1818
-
1819
- /**
1820
- * Deserializes binary data (in protobuf wire format).
1821
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
1822
- * @return {!proto.trb.strategy.v1.EquityPoint}
1823
- */
1824
- proto.trb.strategy.v1.EquityPoint.deserializeBinary = function(bytes) {
1825
- var reader = new jspb.BinaryReader(bytes);
1826
- var msg = new proto.trb.strategy.v1.EquityPoint;
1827
- return proto.trb.strategy.v1.EquityPoint.deserializeBinaryFromReader(msg, reader);
1828
- };
1829
-
1830
-
1831
- /**
1832
- * Deserializes binary data (in protobuf wire format) from the
1833
- * given reader into the given message object.
1834
- * @param {!proto.trb.strategy.v1.EquityPoint} msg The message object to deserialize into.
1835
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1836
- * @return {!proto.trb.strategy.v1.EquityPoint}
1837
- */
1838
- proto.trb.strategy.v1.EquityPoint.deserializeBinaryFromReader = function(msg, reader) {
1839
- while (reader.nextField()) {
1840
- if (reader.isEndGroup()) {
1841
- break;
1842
- }
1843
- var field = reader.getFieldNumber();
1844
- switch (field) {
1845
- case 1:
1846
- var value = new google_protobuf_timestamp_pb.Timestamp;
1847
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
1848
- msg.setTime(value);
1849
- break;
1850
- case 2:
1851
- var value = /** @type {number} */ (reader.readDouble());
1852
- msg.setEquity(value);
1853
- break;
1854
- case 3:
1855
- var value = /** @type {number} */ (reader.readDouble());
1856
- msg.setCash(value);
1857
- break;
1858
- case 4:
1859
- var value = /** @type {number} */ (reader.readDouble());
1860
- msg.setPositionValue(value);
1861
- break;
1862
- case 5:
1863
- var value = /** @type {number} */ (reader.readDouble());
1864
- msg.setDrawdown(value);
1865
- break;
1866
- case 6:
1867
- var value = /** @type {number} */ (reader.readDouble());
1868
- msg.setRet(value);
1869
- break;
1870
- default:
1871
- reader.skipField();
1872
- break;
1873
- }
1874
- }
1875
- return msg;
1876
- };
1877
-
1878
-
1879
- /**
1880
- * Serializes the message to binary data (in protobuf wire format).
1881
- * @return {!Uint8Array}
1882
- */
1883
- proto.trb.strategy.v1.EquityPoint.prototype.serializeBinary = function() {
1884
- var writer = new jspb.BinaryWriter();
1885
- proto.trb.strategy.v1.EquityPoint.serializeBinaryToWriter(this, writer);
1886
- return writer.getResultBuffer();
1887
- };
1888
-
1889
-
1890
- /**
1891
- * Serializes the given message to binary data (in protobuf wire
1892
- * format), writing to the given BinaryWriter.
1893
- * @param {!proto.trb.strategy.v1.EquityPoint} message
1894
- * @param {!jspb.BinaryWriter} writer
1895
- * @suppress {unusedLocalVariables} f is only used for nested messages
1896
- */
1897
- proto.trb.strategy.v1.EquityPoint.serializeBinaryToWriter = function(message, writer) {
1898
- var f = undefined;
1899
- f = message.getTime();
1900
- if (f != null) {
1901
- writer.writeMessage(
1902
- 1,
1903
- f,
1904
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
1905
- );
1906
- }
1907
- f = message.getEquity();
1908
- if (f !== 0.0) {
1909
- writer.writeDouble(
1910
- 2,
1911
- f
1912
- );
1913
- }
1914
- f = message.getCash();
1915
- if (f !== 0.0) {
1916
- writer.writeDouble(
1917
- 3,
1918
- f
1919
- );
1920
- }
1921
- f = message.getPositionValue();
1922
- if (f !== 0.0) {
1923
- writer.writeDouble(
1924
- 4,
1925
- f
1926
- );
1927
- }
1928
- f = message.getDrawdown();
1929
- if (f !== 0.0) {
1930
- writer.writeDouble(
1931
- 5,
1932
- f
1933
- );
1934
- }
1935
- f = message.getRet();
1936
- if (f !== 0.0) {
1937
- writer.writeDouble(
1938
- 6,
1939
- f
1940
- );
1941
- }
1942
- };
1943
-
1944
-
1945
- /**
1946
- * optional google.protobuf.Timestamp time = 1;
1947
- * @return {?proto.google.protobuf.Timestamp}
1948
- */
1949
- proto.trb.strategy.v1.EquityPoint.prototype.getTime = function() {
1950
- return /** @type{?proto.google.protobuf.Timestamp} */ (
1951
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1));
1952
- };
1953
-
1954
-
1955
- /**
1956
- * @param {?proto.google.protobuf.Timestamp|undefined} value
1957
- * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1958
- */
1959
- proto.trb.strategy.v1.EquityPoint.prototype.setTime = function(value) {
1960
- return jspb.Message.setWrapperField(this, 1, value);
1961
- };
1962
-
1963
-
1964
- /**
1965
- * Clears the message field making it undefined.
1966
- * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1967
- */
1968
- proto.trb.strategy.v1.EquityPoint.prototype.clearTime = function() {
1969
- return this.setTime(undefined);
1970
- };
1971
-
1972
-
1973
- /**
1974
- * Returns whether this field is set.
1975
- * @return {boolean}
1976
- */
1977
- proto.trb.strategy.v1.EquityPoint.prototype.hasTime = function() {
1978
- return jspb.Message.getField(this, 1) != null;
1979
- };
1980
-
1981
-
1982
- /**
1983
- * optional double equity = 2;
1984
- * @return {number}
1985
- */
1986
- proto.trb.strategy.v1.EquityPoint.prototype.getEquity = function() {
1987
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
1988
- };
1989
-
1990
-
1991
- /**
1992
- * @param {number} value
1993
- * @return {!proto.trb.strategy.v1.EquityPoint} returns this
1994
- */
1995
- proto.trb.strategy.v1.EquityPoint.prototype.setEquity = function(value) {
1996
- return jspb.Message.setProto3FloatField(this, 2, value);
1997
- };
1998
-
1999
-
2000
- /**
2001
- * optional double cash = 3;
2002
- * @return {number}
2003
- */
2004
- proto.trb.strategy.v1.EquityPoint.prototype.getCash = function() {
2005
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0));
2006
- };
2007
-
2008
-
2009
- /**
2010
- * @param {number} value
2011
- * @return {!proto.trb.strategy.v1.EquityPoint} returns this
2012
- */
2013
- proto.trb.strategy.v1.EquityPoint.prototype.setCash = function(value) {
2014
- return jspb.Message.setProto3FloatField(this, 3, value);
2015
- };
2016
-
2017
-
2018
- /**
2019
- * optional double position_value = 4;
2020
- * @return {number}
2021
- */
2022
- proto.trb.strategy.v1.EquityPoint.prototype.getPositionValue = function() {
2023
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
2024
- };
2025
-
2026
-
2027
- /**
2028
- * @param {number} value
2029
- * @return {!proto.trb.strategy.v1.EquityPoint} returns this
2030
- */
2031
- proto.trb.strategy.v1.EquityPoint.prototype.setPositionValue = function(value) {
2032
- return jspb.Message.setProto3FloatField(this, 4, value);
2033
- };
2034
-
2035
-
2036
- /**
2037
- * optional double drawdown = 5;
2038
- * @return {number}
2039
- */
2040
- proto.trb.strategy.v1.EquityPoint.prototype.getDrawdown = function() {
2041
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
2042
- };
2043
-
2044
-
2045
- /**
2046
- * @param {number} value
2047
- * @return {!proto.trb.strategy.v1.EquityPoint} returns this
2048
- */
2049
- proto.trb.strategy.v1.EquityPoint.prototype.setDrawdown = function(value) {
2050
- return jspb.Message.setProto3FloatField(this, 5, value);
2051
- };
2052
-
2053
-
2054
- /**
2055
- * optional double ret = 6;
2056
- * @return {number}
2057
- */
2058
- proto.trb.strategy.v1.EquityPoint.prototype.getRet = function() {
2059
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
2060
- };
2061
-
2062
-
2063
- /**
2064
- * @param {number} value
2065
- * @return {!proto.trb.strategy.v1.EquityPoint} returns this
2066
- */
2067
- proto.trb.strategy.v1.EquityPoint.prototype.setRet = function(value) {
2068
- return jspb.Message.setProto3FloatField(this, 6, value);
2069
- };
2070
-
2071
-
2072
-
2073
-
2074
-
2075
- if (jspb.Message.GENERATE_TO_OBJECT) {
2076
- /**
2077
- * Creates an object representation of this proto.
2078
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
2079
- * Optional fields that are not set will be set to undefined.
2080
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2081
- * For the list of reserved names please see:
2082
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2083
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2084
- * JSPB instance for transitional soy proto support:
2085
- * http://goto/soy-param-migration
2086
- * @return {!Object}
2087
- */
2088
- proto.trb.strategy.v1.TradeRecord.prototype.toObject = function(opt_includeInstance) {
2089
- return proto.trb.strategy.v1.TradeRecord.toObject(opt_includeInstance, this);
2090
- };
2091
-
2092
-
2093
- /**
2094
- * Static version of the {@see toObject} method.
2095
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2096
- * the JSPB instance for transitional soy proto support:
2097
- * http://goto/soy-param-migration
2098
- * @param {!proto.trb.strategy.v1.TradeRecord} msg The msg instance to transform.
2099
- * @return {!Object}
2100
- * @suppress {unusedLocalVariables} f is only used for nested messages
2101
- */
2102
- proto.trb.strategy.v1.TradeRecord.toObject = function(includeInstance, msg) {
2103
- var f, obj = {
2104
- tradeId: jspb.Message.getFieldWithDefault(msg, 1, 0),
2105
- isLong: jspb.Message.getBooleanFieldWithDefault(msg, 2, false),
2106
- entryTime: (f = msg.getEntryTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
2107
- entryPrice: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
2108
- exitTime: (f = msg.getExitTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
2109
- exitPrice: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0),
2110
- size: jspb.Message.getFloatingPointFieldWithDefault(msg, 7, 0.0),
2111
- pnl: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 0.0),
2112
- pnlPct: jspb.Message.getFloatingPointFieldWithDefault(msg, 9, 0.0),
2113
- barsHeld: jspb.Message.getFieldWithDefault(msg, 10, 0),
2114
- mae: jspb.Message.getFloatingPointFieldWithDefault(msg, 11, 0.0),
2115
- mfe: jspb.Message.getFloatingPointFieldWithDefault(msg, 12, 0.0),
2116
- entryReason: jspb.Message.getFieldWithDefault(msg, 13, ""),
2117
- exitReason: jspb.Message.getFieldWithDefault(msg, 14, "")
2118
- };
2119
-
2120
- if (includeInstance) {
2121
- obj.$jspbMessageInstance = msg;
2122
- }
2123
- return obj;
2124
- };
2125
- }
2126
-
2127
-
2128
- /**
2129
- * Deserializes binary data (in protobuf wire format).
2130
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
2131
- * @return {!proto.trb.strategy.v1.TradeRecord}
2132
- */
2133
- proto.trb.strategy.v1.TradeRecord.deserializeBinary = function(bytes) {
2134
- var reader = new jspb.BinaryReader(bytes);
2135
- var msg = new proto.trb.strategy.v1.TradeRecord;
2136
- return proto.trb.strategy.v1.TradeRecord.deserializeBinaryFromReader(msg, reader);
2137
- };
2138
-
2139
-
2140
- /**
2141
- * Deserializes binary data (in protobuf wire format) from the
2142
- * given reader into the given message object.
2143
- * @param {!proto.trb.strategy.v1.TradeRecord} msg The message object to deserialize into.
2144
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2145
- * @return {!proto.trb.strategy.v1.TradeRecord}
2146
- */
2147
- proto.trb.strategy.v1.TradeRecord.deserializeBinaryFromReader = function(msg, reader) {
2148
- while (reader.nextField()) {
2149
- if (reader.isEndGroup()) {
2150
- break;
2151
- }
2152
- var field = reader.getFieldNumber();
2153
- switch (field) {
2154
- case 1:
2155
- var value = /** @type {number} */ (reader.readUint32());
2156
- msg.setTradeId(value);
2157
- break;
2158
- case 2:
2159
- var value = /** @type {boolean} */ (reader.readBool());
2160
- msg.setIsLong(value);
2161
- break;
2162
- case 3:
2163
- var value = new google_protobuf_timestamp_pb.Timestamp;
2164
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
2165
- msg.setEntryTime(value);
2166
- break;
2167
- case 4:
2168
- var value = /** @type {number} */ (reader.readDouble());
2169
- msg.setEntryPrice(value);
2170
- break;
2171
- case 5:
2172
- var value = new google_protobuf_timestamp_pb.Timestamp;
2173
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
2174
- msg.setExitTime(value);
2175
- break;
2176
- case 6:
2177
- var value = /** @type {number} */ (reader.readDouble());
2178
- msg.setExitPrice(value);
2179
- break;
2180
- case 7:
2181
- var value = /** @type {number} */ (reader.readDouble());
2182
- msg.setSize(value);
2183
- break;
2184
- case 8:
2185
- var value = /** @type {number} */ (reader.readDouble());
2186
- msg.setPnl(value);
2187
- break;
2188
- case 9:
2189
- var value = /** @type {number} */ (reader.readDouble());
2190
- msg.setPnlPct(value);
2191
- break;
2192
- case 10:
2193
- var value = /** @type {number} */ (reader.readUint32());
2194
- msg.setBarsHeld(value);
2195
- break;
2196
- case 11:
2197
- var value = /** @type {number} */ (reader.readDouble());
2198
- msg.setMae(value);
2199
- break;
2200
- case 12:
2201
- var value = /** @type {number} */ (reader.readDouble());
2202
- msg.setMfe(value);
2203
- break;
2204
- case 13:
2205
- var value = /** @type {string} */ (reader.readString());
2206
- msg.setEntryReason(value);
2207
- break;
2208
- case 14:
2209
- var value = /** @type {string} */ (reader.readString());
2210
- msg.setExitReason(value);
2211
- break;
2212
- default:
2213
- reader.skipField();
2214
- break;
2215
- }
2216
- }
2217
- return msg;
2218
- };
2219
-
2220
-
2221
- /**
2222
- * Serializes the message to binary data (in protobuf wire format).
2223
- * @return {!Uint8Array}
2224
- */
2225
- proto.trb.strategy.v1.TradeRecord.prototype.serializeBinary = function() {
2226
- var writer = new jspb.BinaryWriter();
2227
- proto.trb.strategy.v1.TradeRecord.serializeBinaryToWriter(this, writer);
2228
- return writer.getResultBuffer();
2229
- };
2230
-
2231
-
2232
- /**
2233
- * Serializes the given message to binary data (in protobuf wire
2234
- * format), writing to the given BinaryWriter.
2235
- * @param {!proto.trb.strategy.v1.TradeRecord} message
2236
- * @param {!jspb.BinaryWriter} writer
2237
- * @suppress {unusedLocalVariables} f is only used for nested messages
2238
- */
2239
- proto.trb.strategy.v1.TradeRecord.serializeBinaryToWriter = function(message, writer) {
2240
- var f = undefined;
2241
- f = message.getTradeId();
2242
- if (f !== 0) {
2243
- writer.writeUint32(
2244
- 1,
2245
- f
2246
- );
2247
- }
2248
- f = message.getIsLong();
2249
- if (f) {
2250
- writer.writeBool(
2251
- 2,
2252
- f
2253
- );
2254
- }
2255
- f = message.getEntryTime();
2256
- if (f != null) {
2257
- writer.writeMessage(
2258
- 3,
2259
- f,
2260
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
2261
- );
2262
- }
2263
- f = message.getEntryPrice();
2264
- if (f !== 0.0) {
2265
- writer.writeDouble(
2266
- 4,
2267
- f
2268
- );
2269
- }
2270
- f = message.getExitTime();
2271
- if (f != null) {
2272
- writer.writeMessage(
2273
- 5,
2274
- f,
2275
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
2276
- );
2277
- }
2278
- f = message.getExitPrice();
2279
- if (f !== 0.0) {
2280
- writer.writeDouble(
2281
- 6,
2282
- f
2283
- );
2284
- }
2285
- f = message.getSize();
2286
- if (f !== 0.0) {
2287
- writer.writeDouble(
2288
- 7,
2289
- f
2290
- );
2291
- }
2292
- f = message.getPnl();
2293
- if (f !== 0.0) {
2294
- writer.writeDouble(
2295
- 8,
2296
- f
2297
- );
2298
- }
2299
- f = message.getPnlPct();
2300
- if (f !== 0.0) {
2301
- writer.writeDouble(
2302
- 9,
2303
- f
2304
- );
2305
- }
2306
- f = message.getBarsHeld();
2307
- if (f !== 0) {
2308
- writer.writeUint32(
2309
- 10,
2310
- f
2311
- );
2312
- }
2313
- f = message.getMae();
2314
- if (f !== 0.0) {
2315
- writer.writeDouble(
2316
- 11,
2317
- f
2318
- );
2319
- }
2320
- f = message.getMfe();
2321
- if (f !== 0.0) {
2322
- writer.writeDouble(
2323
- 12,
2324
- f
2325
- );
2326
- }
2327
- f = message.getEntryReason();
2328
- if (f.length > 0) {
2329
- writer.writeString(
2330
- 13,
2331
- f
2332
- );
2333
- }
2334
- f = message.getExitReason();
2335
- if (f.length > 0) {
2336
- writer.writeString(
2337
- 14,
2338
- f
2339
- );
2340
- }
2341
- };
2342
-
2343
-
2344
- /**
2345
- * optional uint32 trade_id = 1;
2346
- * @return {number}
2347
- */
2348
- proto.trb.strategy.v1.TradeRecord.prototype.getTradeId = function() {
2349
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
2350
- };
2351
-
2352
-
2353
- /**
2354
- * @param {number} value
2355
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2356
- */
2357
- proto.trb.strategy.v1.TradeRecord.prototype.setTradeId = function(value) {
2358
- return jspb.Message.setProto3IntField(this, 1, value);
2359
- };
2360
-
2361
-
2362
- /**
2363
- * optional bool is_long = 2;
2364
- * @return {boolean}
2365
- */
2366
- proto.trb.strategy.v1.TradeRecord.prototype.getIsLong = function() {
2367
- return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
2368
- };
2369
-
2370
-
2371
- /**
2372
- * @param {boolean} value
2373
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2374
- */
2375
- proto.trb.strategy.v1.TradeRecord.prototype.setIsLong = function(value) {
2376
- return jspb.Message.setProto3BooleanField(this, 2, value);
2377
- };
2378
-
2379
-
2380
- /**
2381
- * optional google.protobuf.Timestamp entry_time = 3;
2382
- * @return {?proto.google.protobuf.Timestamp}
2383
- */
2384
- proto.trb.strategy.v1.TradeRecord.prototype.getEntryTime = function() {
2385
- return /** @type{?proto.google.protobuf.Timestamp} */ (
2386
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
2387
- };
2388
-
2389
-
2390
- /**
2391
- * @param {?proto.google.protobuf.Timestamp|undefined} value
2392
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2393
- */
2394
- proto.trb.strategy.v1.TradeRecord.prototype.setEntryTime = function(value) {
2395
- return jspb.Message.setWrapperField(this, 3, value);
2396
- };
2397
-
2398
-
2399
- /**
2400
- * Clears the message field making it undefined.
2401
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2402
- */
2403
- proto.trb.strategy.v1.TradeRecord.prototype.clearEntryTime = function() {
2404
- return this.setEntryTime(undefined);
2405
- };
2406
-
2407
-
2408
- /**
2409
- * Returns whether this field is set.
2410
- * @return {boolean}
2411
- */
2412
- proto.trb.strategy.v1.TradeRecord.prototype.hasEntryTime = function() {
2413
- return jspb.Message.getField(this, 3) != null;
2414
- };
2415
-
2416
-
2417
- /**
2418
- * optional double entry_price = 4;
2419
- * @return {number}
2420
- */
2421
- proto.trb.strategy.v1.TradeRecord.prototype.getEntryPrice = function() {
2422
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
2423
- };
2424
-
2425
-
2426
- /**
2427
- * @param {number} value
2428
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2429
- */
2430
- proto.trb.strategy.v1.TradeRecord.prototype.setEntryPrice = function(value) {
2431
- return jspb.Message.setProto3FloatField(this, 4, value);
2432
- };
2433
-
2434
-
2435
- /**
2436
- * optional google.protobuf.Timestamp exit_time = 5;
2437
- * @return {?proto.google.protobuf.Timestamp}
2438
- */
2439
- proto.trb.strategy.v1.TradeRecord.prototype.getExitTime = function() {
2440
- return /** @type{?proto.google.protobuf.Timestamp} */ (
2441
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 5));
2442
- };
2443
-
2444
-
2445
- /**
2446
- * @param {?proto.google.protobuf.Timestamp|undefined} value
2447
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2448
- */
2449
- proto.trb.strategy.v1.TradeRecord.prototype.setExitTime = function(value) {
2450
- return jspb.Message.setWrapperField(this, 5, value);
2451
- };
2452
-
2453
-
2454
- /**
2455
- * Clears the message field making it undefined.
2456
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2457
- */
2458
- proto.trb.strategy.v1.TradeRecord.prototype.clearExitTime = function() {
2459
- return this.setExitTime(undefined);
2460
- };
2461
-
2462
-
2463
- /**
2464
- * Returns whether this field is set.
2465
- * @return {boolean}
2466
- */
2467
- proto.trb.strategy.v1.TradeRecord.prototype.hasExitTime = function() {
2468
- return jspb.Message.getField(this, 5) != null;
2469
- };
2470
-
2471
-
2472
- /**
2473
- * optional double exit_price = 6;
2474
- * @return {number}
2475
- */
2476
- proto.trb.strategy.v1.TradeRecord.prototype.getExitPrice = function() {
2477
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
2478
- };
2479
-
2480
-
2481
- /**
2482
- * @param {number} value
2483
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2484
- */
2485
- proto.trb.strategy.v1.TradeRecord.prototype.setExitPrice = function(value) {
2486
- return jspb.Message.setProto3FloatField(this, 6, value);
2487
- };
2488
-
2489
-
2490
- /**
2491
- * optional double size = 7;
2492
- * @return {number}
2493
- */
2494
- proto.trb.strategy.v1.TradeRecord.prototype.getSize = function() {
2495
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 7, 0.0));
2496
- };
2497
-
2498
-
2499
- /**
2500
- * @param {number} value
2501
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2502
- */
2503
- proto.trb.strategy.v1.TradeRecord.prototype.setSize = function(value) {
2504
- return jspb.Message.setProto3FloatField(this, 7, value);
2505
- };
2506
-
2507
-
2508
- /**
2509
- * optional double pnl = 8;
2510
- * @return {number}
2511
- */
2512
- proto.trb.strategy.v1.TradeRecord.prototype.getPnl = function() {
2513
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 0.0));
2514
- };
2515
-
2516
-
2517
- /**
2518
- * @param {number} value
2519
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2520
- */
2521
- proto.trb.strategy.v1.TradeRecord.prototype.setPnl = function(value) {
2522
- return jspb.Message.setProto3FloatField(this, 8, value);
2523
- };
2524
-
2525
-
2526
- /**
2527
- * optional double pnl_pct = 9;
2528
- * @return {number}
2529
- */
2530
- proto.trb.strategy.v1.TradeRecord.prototype.getPnlPct = function() {
2531
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 9, 0.0));
2532
- };
2533
-
2534
-
2535
- /**
2536
- * @param {number} value
2537
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2538
- */
2539
- proto.trb.strategy.v1.TradeRecord.prototype.setPnlPct = function(value) {
2540
- return jspb.Message.setProto3FloatField(this, 9, value);
2541
- };
2542
-
2543
-
2544
- /**
2545
- * optional uint32 bars_held = 10;
2546
- * @return {number}
2547
- */
2548
- proto.trb.strategy.v1.TradeRecord.prototype.getBarsHeld = function() {
2549
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
2550
- };
2551
-
2552
-
2553
- /**
2554
- * @param {number} value
2555
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2556
- */
2557
- proto.trb.strategy.v1.TradeRecord.prototype.setBarsHeld = function(value) {
2558
- return jspb.Message.setProto3IntField(this, 10, value);
2559
- };
2560
-
2561
-
2562
- /**
2563
- * optional double mae = 11;
2564
- * @return {number}
2565
- */
2566
- proto.trb.strategy.v1.TradeRecord.prototype.getMae = function() {
2567
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 11, 0.0));
2568
- };
2569
-
2570
-
2571
- /**
2572
- * @param {number} value
2573
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2574
- */
2575
- proto.trb.strategy.v1.TradeRecord.prototype.setMae = function(value) {
2576
- return jspb.Message.setProto3FloatField(this, 11, value);
2577
- };
2578
-
2579
-
2580
- /**
2581
- * optional double mfe = 12;
2582
- * @return {number}
2583
- */
2584
- proto.trb.strategy.v1.TradeRecord.prototype.getMfe = function() {
2585
- return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 12, 0.0));
2586
- };
2587
-
2588
-
2589
- /**
2590
- * @param {number} value
2591
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2592
- */
2593
- proto.trb.strategy.v1.TradeRecord.prototype.setMfe = function(value) {
2594
- return jspb.Message.setProto3FloatField(this, 12, value);
2595
- };
2596
-
2597
-
2598
- /**
2599
- * optional string entry_reason = 13;
2600
- * @return {string}
2601
- */
2602
- proto.trb.strategy.v1.TradeRecord.prototype.getEntryReason = function() {
2603
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, ""));
2604
- };
2605
-
2606
-
2607
- /**
2608
- * @param {string} value
2609
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2610
- */
2611
- proto.trb.strategy.v1.TradeRecord.prototype.setEntryReason = function(value) {
2612
- return jspb.Message.setProto3StringField(this, 13, value);
2613
- };
2614
-
2615
-
2616
- /**
2617
- * optional string exit_reason = 14;
2618
- * @return {string}
2619
- */
2620
- proto.trb.strategy.v1.TradeRecord.prototype.getExitReason = function() {
2621
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 14, ""));
2622
- };
2623
-
2624
-
2625
- /**
2626
- * @param {string} value
2627
- * @return {!proto.trb.strategy.v1.TradeRecord} returns this
2628
- */
2629
- proto.trb.strategy.v1.TradeRecord.prototype.setExitReason = function(value) {
2630
- return jspb.Message.setProto3StringField(this, 14, value);
2631
- };
2632
-
2633
-
2634
-
2635
-
2636
-
2637
- if (jspb.Message.GENERATE_TO_OBJECT) {
2638
- /**
2639
- * Creates an object representation of this proto.
2640
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
2641
- * Optional fields that are not set will be set to undefined.
2642
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2643
- * For the list of reserved names please see:
2644
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2645
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2646
- * JSPB instance for transitional soy proto support:
2647
- * http://goto/soy-param-migration
2648
- * @return {!Object}
2649
- */
2650
- proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.toObject = function(opt_includeInstance) {
2651
- return proto.trb.strategy.v1.BacktestIndicatorPoint.toObject(opt_includeInstance, this);
2652
- };
2653
-
2654
-
2655
- /**
2656
- * Static version of the {@see toObject} method.
2657
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2658
- * the JSPB instance for transitional soy proto support:
2659
- * http://goto/soy-param-migration
2660
- * @param {!proto.trb.strategy.v1.BacktestIndicatorPoint} msg The msg instance to transform.
2661
- * @return {!Object}
2662
- * @suppress {unusedLocalVariables} f is only used for nested messages
2663
- */
2664
- proto.trb.strategy.v1.BacktestIndicatorPoint.toObject = function(includeInstance, msg) {
2665
- var f, obj = {
2666
- time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
2667
- valuesMap: (f = msg.getValuesMap()) ? f.toObject(includeInstance, undefined) : []
2668
- };
2669
-
2670
- if (includeInstance) {
2671
- obj.$jspbMessageInstance = msg;
2672
- }
2673
- return obj;
2674
- };
2675
- }
2676
-
2677
-
2678
- /**
2679
- * Deserializes binary data (in protobuf wire format).
2680
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
2681
- * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint}
2682
- */
2683
- proto.trb.strategy.v1.BacktestIndicatorPoint.deserializeBinary = function(bytes) {
2684
- var reader = new jspb.BinaryReader(bytes);
2685
- var msg = new proto.trb.strategy.v1.BacktestIndicatorPoint;
2686
- return proto.trb.strategy.v1.BacktestIndicatorPoint.deserializeBinaryFromReader(msg, reader);
2687
- };
2688
-
2689
-
2690
- /**
2691
- * Deserializes binary data (in protobuf wire format) from the
2692
- * given reader into the given message object.
2693
- * @param {!proto.trb.strategy.v1.BacktestIndicatorPoint} msg The message object to deserialize into.
2694
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2695
- * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint}
2696
- */
2697
- proto.trb.strategy.v1.BacktestIndicatorPoint.deserializeBinaryFromReader = function(msg, reader) {
2698
- while (reader.nextField()) {
2699
- if (reader.isEndGroup()) {
2700
- break;
2701
- }
2702
- var field = reader.getFieldNumber();
2703
- switch (field) {
2704
- case 1:
2705
- var value = new google_protobuf_timestamp_pb.Timestamp;
2706
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
2707
- msg.setTime(value);
2708
- break;
2709
- case 2:
2710
- var value = msg.getValuesMap();
2711
- reader.readMessage(value, function(message, reader) {
2712
- jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readDouble, null, "", 0.0);
2713
- });
2714
- break;
2715
- default:
2716
- reader.skipField();
2717
- break;
2718
- }
2719
- }
2720
- return msg;
2721
- };
2722
-
2723
-
2724
- /**
2725
- * Serializes the message to binary data (in protobuf wire format).
2726
- * @return {!Uint8Array}
2727
- */
2728
- proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.serializeBinary = function() {
2729
- var writer = new jspb.BinaryWriter();
2730
- proto.trb.strategy.v1.BacktestIndicatorPoint.serializeBinaryToWriter(this, writer);
2731
- return writer.getResultBuffer();
2732
- };
2733
-
2734
-
2735
- /**
2736
- * Serializes the given message to binary data (in protobuf wire
2737
- * format), writing to the given BinaryWriter.
2738
- * @param {!proto.trb.strategy.v1.BacktestIndicatorPoint} message
2739
- * @param {!jspb.BinaryWriter} writer
2740
- * @suppress {unusedLocalVariables} f is only used for nested messages
2741
- */
2742
- proto.trb.strategy.v1.BacktestIndicatorPoint.serializeBinaryToWriter = function(message, writer) {
2743
- var f = undefined;
2744
- f = message.getTime();
2745
- if (f != null) {
2746
- writer.writeMessage(
2747
- 1,
2748
- f,
2749
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
2750
- );
2751
- }
2752
- f = message.getValuesMap(true);
2753
- if (f && f.getLength() > 0) {
2754
- f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeDouble);
2755
- }
2756
- };
2757
-
2758
-
2759
- /**
2760
- * optional google.protobuf.Timestamp time = 1;
2761
- * @return {?proto.google.protobuf.Timestamp}
2762
- */
2763
- proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.getTime = function() {
2764
- return /** @type{?proto.google.protobuf.Timestamp} */ (
2765
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1));
2766
- };
2767
-
2768
-
2769
- /**
2770
- * @param {?proto.google.protobuf.Timestamp|undefined} value
2771
- * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint} returns this
2772
- */
2773
- proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.setTime = function(value) {
2774
- return jspb.Message.setWrapperField(this, 1, value);
2775
- };
2776
-
2777
-
2778
- /**
2779
- * Clears the message field making it undefined.
2780
- * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint} returns this
2781
- */
2782
- proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.clearTime = function() {
2783
- return this.setTime(undefined);
2784
- };
2785
-
2786
-
2787
- /**
2788
- * Returns whether this field is set.
2789
- * @return {boolean}
2790
- */
2791
- proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.hasTime = function() {
2792
- return jspb.Message.getField(this, 1) != null;
2793
- };
2794
-
2795
-
2796
- /**
2797
- * map<string, double> values = 2;
2798
- * @param {boolean=} opt_noLazyCreate Do not create the map if
2799
- * empty, instead returning `undefined`
2800
- * @return {!jspb.Map<string,number>}
2801
- */
2802
- proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.getValuesMap = function(opt_noLazyCreate) {
2803
- return /** @type {!jspb.Map<string,number>} */ (
2804
- jspb.Message.getMapField(this, 2, opt_noLazyCreate,
2805
- null));
2806
- };
2807
-
2808
-
2809
- /**
2810
- * Clears values from the map. The map will be non-null.
2811
- * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint} returns this
2812
- */
2813
- proto.trb.strategy.v1.BacktestIndicatorPoint.prototype.clearValuesMap = function() {
2814
- this.getValuesMap().clear();
2815
- return this;
2816
- };
2817
-
2818
-
2819
-
2820
- /**
2821
- * List of repeated fields within this message type.
2822
- * @private {!Array<number>}
2823
- * @const
2824
- */
2825
- proto.trb.strategy.v1.BacktestIndicatorSeries.repeatedFields_ = [5];
2826
-
2827
-
2828
-
2829
- if (jspb.Message.GENERATE_TO_OBJECT) {
2830
- /**
2831
- * Creates an object representation of this proto.
2832
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
2833
- * Optional fields that are not set will be set to undefined.
2834
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2835
- * For the list of reserved names please see:
2836
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2837
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2838
- * JSPB instance for transitional soy proto support:
2839
- * http://goto/soy-param-migration
2840
- * @return {!Object}
2841
- */
2842
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.toObject = function(opt_includeInstance) {
2843
- return proto.trb.strategy.v1.BacktestIndicatorSeries.toObject(opt_includeInstance, this);
2844
- };
2845
-
2846
-
2847
- /**
2848
- * Static version of the {@see toObject} method.
2849
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2850
- * the JSPB instance for transitional soy proto support:
2851
- * http://goto/soy-param-migration
2852
- * @param {!proto.trb.strategy.v1.BacktestIndicatorSeries} msg The msg instance to transform.
2853
- * @return {!Object}
2854
- * @suppress {unusedLocalVariables} f is only used for nested messages
2855
- */
2856
- proto.trb.strategy.v1.BacktestIndicatorSeries.toObject = function(includeInstance, msg) {
2857
- var f, obj = {
2858
- indicatorId: jspb.Message.getFieldWithDefault(msg, 1, ""),
2859
- indicator: jspb.Message.getFieldWithDefault(msg, 2, ""),
2860
- outputKey: jspb.Message.getFieldWithDefault(msg, 3, ""),
2861
- overlay: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
2862
- pointsList: jspb.Message.toObjectList(msg.getPointsList(),
2863
- proto.trb.strategy.v1.BacktestIndicatorPoint.toObject, includeInstance)
2864
- };
2865
-
2866
- if (includeInstance) {
2867
- obj.$jspbMessageInstance = msg;
2868
- }
2869
- return obj;
2870
- };
2871
- }
2872
-
2873
-
2874
- /**
2875
- * Deserializes binary data (in protobuf wire format).
2876
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
2877
- * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries}
2878
- */
2879
- proto.trb.strategy.v1.BacktestIndicatorSeries.deserializeBinary = function(bytes) {
2880
- var reader = new jspb.BinaryReader(bytes);
2881
- var msg = new proto.trb.strategy.v1.BacktestIndicatorSeries;
2882
- return proto.trb.strategy.v1.BacktestIndicatorSeries.deserializeBinaryFromReader(msg, reader);
2883
- };
2884
-
2885
-
2886
- /**
2887
- * Deserializes binary data (in protobuf wire format) from the
2888
- * given reader into the given message object.
2889
- * @param {!proto.trb.strategy.v1.BacktestIndicatorSeries} msg The message object to deserialize into.
2890
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2891
- * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries}
2892
- */
2893
- proto.trb.strategy.v1.BacktestIndicatorSeries.deserializeBinaryFromReader = function(msg, reader) {
2894
- while (reader.nextField()) {
2895
- if (reader.isEndGroup()) {
2896
- break;
2897
- }
2898
- var field = reader.getFieldNumber();
2899
- switch (field) {
2900
- case 1:
2901
- var value = /** @type {string} */ (reader.readString());
2902
- msg.setIndicatorId(value);
2903
- break;
2904
- case 2:
2905
- var value = /** @type {string} */ (reader.readString());
2906
- msg.setIndicator(value);
2907
- break;
2908
- case 3:
2909
- var value = /** @type {string} */ (reader.readString());
2910
- msg.setOutputKey(value);
2911
- break;
2912
- case 4:
2913
- var value = /** @type {boolean} */ (reader.readBool());
2914
- msg.setOverlay(value);
2915
- break;
2916
- case 5:
2917
- var value = new proto.trb.strategy.v1.BacktestIndicatorPoint;
2918
- reader.readMessage(value,proto.trb.strategy.v1.BacktestIndicatorPoint.deserializeBinaryFromReader);
2919
- msg.addPoints(value);
2920
- break;
2921
- default:
2922
- reader.skipField();
2923
- break;
2924
- }
2925
- }
2926
- return msg;
2927
- };
2928
-
2929
-
2930
- /**
2931
- * Serializes the message to binary data (in protobuf wire format).
2932
- * @return {!Uint8Array}
2933
- */
2934
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.serializeBinary = function() {
2935
- var writer = new jspb.BinaryWriter();
2936
- proto.trb.strategy.v1.BacktestIndicatorSeries.serializeBinaryToWriter(this, writer);
2937
- return writer.getResultBuffer();
2938
- };
2939
-
2940
-
2941
- /**
2942
- * Serializes the given message to binary data (in protobuf wire
2943
- * format), writing to the given BinaryWriter.
2944
- * @param {!proto.trb.strategy.v1.BacktestIndicatorSeries} message
2945
- * @param {!jspb.BinaryWriter} writer
2946
- * @suppress {unusedLocalVariables} f is only used for nested messages
2947
- */
2948
- proto.trb.strategy.v1.BacktestIndicatorSeries.serializeBinaryToWriter = function(message, writer) {
2949
- var f = undefined;
2950
- f = message.getIndicatorId();
2951
- if (f.length > 0) {
2952
- writer.writeString(
2953
- 1,
2954
- f
2955
- );
2956
- }
2957
- f = message.getIndicator();
2958
- if (f.length > 0) {
2959
- writer.writeString(
2960
- 2,
2961
- f
2962
- );
2963
- }
2964
- f = message.getOutputKey();
2965
- if (f.length > 0) {
2966
- writer.writeString(
2967
- 3,
2968
- f
2969
- );
2970
- }
2971
- f = message.getOverlay();
2972
- if (f) {
2973
- writer.writeBool(
2974
- 4,
2975
- f
2976
- );
2977
- }
2978
- f = message.getPointsList();
2979
- if (f.length > 0) {
2980
- writer.writeRepeatedMessage(
2981
- 5,
2982
- f,
2983
- proto.trb.strategy.v1.BacktestIndicatorPoint.serializeBinaryToWriter
2984
- );
2985
- }
2986
- };
2987
-
2988
-
2989
- /**
2990
- * optional string indicator_id = 1;
2991
- * @return {string}
2992
- */
2993
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getIndicatorId = function() {
2994
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
2995
- };
2996
-
2997
-
2998
- /**
2999
- * @param {string} value
3000
- * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
3001
- */
3002
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setIndicatorId = function(value) {
3003
- return jspb.Message.setProto3StringField(this, 1, value);
3004
- };
3005
-
3006
-
3007
- /**
3008
- * optional string indicator = 2;
3009
- * @return {string}
3010
- */
3011
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getIndicator = function() {
3012
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
3013
- };
3014
-
3015
-
3016
- /**
3017
- * @param {string} value
3018
- * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
3019
- */
3020
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setIndicator = function(value) {
3021
- return jspb.Message.setProto3StringField(this, 2, value);
3022
- };
3023
-
3024
-
3025
- /**
3026
- * optional string output_key = 3;
3027
- * @return {string}
3028
- */
3029
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getOutputKey = function() {
3030
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
3031
- };
3032
-
3033
-
3034
- /**
3035
- * @param {string} value
3036
- * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
3037
- */
3038
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setOutputKey = function(value) {
3039
- return jspb.Message.setProto3StringField(this, 3, value);
3040
- };
3041
-
3042
-
3043
- /**
3044
- * optional bool overlay = 4;
3045
- * @return {boolean}
3046
- */
3047
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getOverlay = function() {
3048
- return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
3049
- };
3050
-
3051
-
3052
- /**
3053
- * @param {boolean} value
3054
- * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
3055
- */
3056
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setOverlay = function(value) {
3057
- return jspb.Message.setProto3BooleanField(this, 4, value);
3058
- };
3059
-
3060
-
3061
- /**
3062
- * repeated BacktestIndicatorPoint points = 5;
3063
- * @return {!Array<!proto.trb.strategy.v1.BacktestIndicatorPoint>}
3064
- */
3065
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.getPointsList = function() {
3066
- return /** @type{!Array<!proto.trb.strategy.v1.BacktestIndicatorPoint>} */ (
3067
- jspb.Message.getRepeatedWrapperField(this, proto.trb.strategy.v1.BacktestIndicatorPoint, 5));
3068
- };
3069
-
3070
-
3071
- /**
3072
- * @param {!Array<!proto.trb.strategy.v1.BacktestIndicatorPoint>} value
3073
- * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
3074
- */
3075
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.setPointsList = function(value) {
3076
- return jspb.Message.setRepeatedWrapperField(this, 5, value);
3077
- };
3078
-
3079
-
3080
- /**
3081
- * @param {!proto.trb.strategy.v1.BacktestIndicatorPoint=} opt_value
3082
- * @param {number=} opt_index
3083
- * @return {!proto.trb.strategy.v1.BacktestIndicatorPoint}
3084
- */
3085
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.addPoints = function(opt_value, opt_index) {
3086
- return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.trb.strategy.v1.BacktestIndicatorPoint, opt_index);
3087
- };
3088
-
3089
-
3090
- /**
3091
- * Clears the list making it empty but non-null.
3092
- * @return {!proto.trb.strategy.v1.BacktestIndicatorSeries} returns this
3093
- */
3094
- proto.trb.strategy.v1.BacktestIndicatorSeries.prototype.clearPointsList = function() {
3095
- return this.setPointsList([]);
3096
- };
3097
-
3098
-
3099
-
3100
-
3101
-
3102
- if (jspb.Message.GENERATE_TO_OBJECT) {
3103
- /**
3104
- * Creates an object representation of this proto.
3105
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
3106
- * Optional fields that are not set will be set to undefined.
3107
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
3108
- * For the list of reserved names please see:
3109
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
3110
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
3111
- * JSPB instance for transitional soy proto support:
3112
- * http://goto/soy-param-migration
3113
- * @return {!Object}
3114
- */
3115
- proto.trb.strategy.v1.BacktestRun.prototype.toObject = function(opt_includeInstance) {
3116
- return proto.trb.strategy.v1.BacktestRun.toObject(opt_includeInstance, this);
3117
- };
3118
-
3119
-
3120
- /**
3121
- * Static version of the {@see toObject} method.
3122
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
3123
- * the JSPB instance for transitional soy proto support:
3124
- * http://goto/soy-param-migration
3125
- * @param {!proto.trb.strategy.v1.BacktestRun} msg The msg instance to transform.
3126
- * @return {!Object}
3127
- * @suppress {unusedLocalVariables} f is only used for nested messages
3128
- */
3129
- proto.trb.strategy.v1.BacktestRun.toObject = function(includeInstance, msg) {
3130
- var f, obj = {
3131
- runId: jspb.Message.getFieldWithDefault(msg, 1, ""),
3132
- strategyId: jspb.Message.getFieldWithDefault(msg, 2, ""),
3133
- spec: (f = msg.getSpec()) && strategy_spec_pb.StrategySpec.toObject(includeInstance, f),
3134
- config: (f = msg.getConfig()) && proto.trb.strategy.v1.BacktestConfig.toObject(includeInstance, f),
3135
- status: jspb.Message.getFieldWithDefault(msg, 5, 0),
3136
- error: jspb.Message.getFieldWithDefault(msg, 6, ""),
3137
- engineVersion: jspb.Message.getFieldWithDefault(msg, 7, ""),
3138
- searchRunId: jspb.Message.getFieldWithDefault(msg, 8, ""),
3139
- createdAt: (f = msg.getCreatedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
3140
- startedAt: (f = msg.getStartedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
3141
- finishedAt: (f = msg.getFinishedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
3142
- };
3143
-
3144
- if (includeInstance) {
3145
- obj.$jspbMessageInstance = msg;
3146
- }
3147
- return obj;
3148
- };
3149
- }
3150
-
3151
-
3152
- /**
3153
- * Deserializes binary data (in protobuf wire format).
3154
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
3155
- * @return {!proto.trb.strategy.v1.BacktestRun}
3156
- */
3157
- proto.trb.strategy.v1.BacktestRun.deserializeBinary = function(bytes) {
3158
- var reader = new jspb.BinaryReader(bytes);
3159
- var msg = new proto.trb.strategy.v1.BacktestRun;
3160
- return proto.trb.strategy.v1.BacktestRun.deserializeBinaryFromReader(msg, reader);
3161
- };
3162
-
3163
-
3164
- /**
3165
- * Deserializes binary data (in protobuf wire format) from the
3166
- * given reader into the given message object.
3167
- * @param {!proto.trb.strategy.v1.BacktestRun} msg The message object to deserialize into.
3168
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3169
- * @return {!proto.trb.strategy.v1.BacktestRun}
3170
- */
3171
- proto.trb.strategy.v1.BacktestRun.deserializeBinaryFromReader = function(msg, reader) {
3172
- while (reader.nextField()) {
3173
- if (reader.isEndGroup()) {
3174
- break;
3175
- }
3176
- var field = reader.getFieldNumber();
3177
- switch (field) {
3178
- case 1:
3179
- var value = /** @type {string} */ (reader.readString());
3180
- msg.setRunId(value);
3181
- break;
3182
- case 2:
3183
- var value = /** @type {string} */ (reader.readString());
3184
- msg.setStrategyId(value);
3185
- break;
3186
- case 3:
3187
- var value = new strategy_spec_pb.StrategySpec;
3188
- reader.readMessage(value,strategy_spec_pb.StrategySpec.deserializeBinaryFromReader);
3189
- msg.setSpec(value);
3190
- break;
3191
- case 4:
3192
- var value = new proto.trb.strategy.v1.BacktestConfig;
3193
- reader.readMessage(value,proto.trb.strategy.v1.BacktestConfig.deserializeBinaryFromReader);
3194
- msg.setConfig(value);
3195
- break;
3196
- case 5:
3197
- var value = /** @type {!proto.trb.strategy.v1.RunStatus} */ (reader.readEnum());
3198
- msg.setStatus(value);
3199
- break;
3200
- case 6:
3201
- var value = /** @type {string} */ (reader.readString());
3202
- msg.setError(value);
3203
- break;
3204
- case 7:
3205
- var value = /** @type {string} */ (reader.readString());
3206
- msg.setEngineVersion(value);
3207
- break;
3208
- case 8:
3209
- var value = /** @type {string} */ (reader.readString());
3210
- msg.setSearchRunId(value);
3211
- break;
3212
- case 9:
3213
- var value = new google_protobuf_timestamp_pb.Timestamp;
3214
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
3215
- msg.setCreatedAt(value);
3216
- break;
3217
- case 10:
3218
- var value = new google_protobuf_timestamp_pb.Timestamp;
3219
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
3220
- msg.setStartedAt(value);
3221
- break;
3222
- case 11:
3223
- var value = new google_protobuf_timestamp_pb.Timestamp;
3224
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
3225
- msg.setFinishedAt(value);
3226
- break;
3227
- default:
3228
- reader.skipField();
3229
- break;
3230
- }
3231
- }
3232
- return msg;
3233
- };
3234
-
3235
-
3236
- /**
3237
- * Serializes the message to binary data (in protobuf wire format).
3238
- * @return {!Uint8Array}
3239
- */
3240
- proto.trb.strategy.v1.BacktestRun.prototype.serializeBinary = function() {
3241
- var writer = new jspb.BinaryWriter();
3242
- proto.trb.strategy.v1.BacktestRun.serializeBinaryToWriter(this, writer);
3243
- return writer.getResultBuffer();
3244
- };
3245
-
3246
-
3247
- /**
3248
- * Serializes the given message to binary data (in protobuf wire
3249
- * format), writing to the given BinaryWriter.
3250
- * @param {!proto.trb.strategy.v1.BacktestRun} message
3251
- * @param {!jspb.BinaryWriter} writer
3252
- * @suppress {unusedLocalVariables} f is only used for nested messages
3253
- */
3254
- proto.trb.strategy.v1.BacktestRun.serializeBinaryToWriter = function(message, writer) {
3255
- var f = undefined;
3256
- f = message.getRunId();
3257
- if (f.length > 0) {
3258
- writer.writeString(
3259
- 1,
3260
- f
3261
- );
3262
- }
3263
- f = message.getStrategyId();
3264
- if (f.length > 0) {
3265
- writer.writeString(
3266
- 2,
3267
- f
3268
- );
3269
- }
3270
- f = message.getSpec();
3271
- if (f != null) {
3272
- writer.writeMessage(
3273
- 3,
3274
- f,
3275
- strategy_spec_pb.StrategySpec.serializeBinaryToWriter
3276
- );
3277
- }
3278
- f = message.getConfig();
3279
- if (f != null) {
3280
- writer.writeMessage(
3281
- 4,
3282
- f,
3283
- proto.trb.strategy.v1.BacktestConfig.serializeBinaryToWriter
3284
- );
3285
- }
3286
- f = message.getStatus();
3287
- if (f !== 0.0) {
3288
- writer.writeEnum(
3289
- 5,
3290
- f
3291
- );
3292
- }
3293
- f = message.getError();
3294
- if (f.length > 0) {
3295
- writer.writeString(
3296
- 6,
3297
- f
3298
- );
3299
- }
3300
- f = message.getEngineVersion();
3301
- if (f.length > 0) {
3302
- writer.writeString(
3303
- 7,
3304
- f
3305
- );
3306
- }
3307
- f = message.getSearchRunId();
3308
- if (f.length > 0) {
3309
- writer.writeString(
3310
- 8,
3311
- f
3312
- );
3313
- }
3314
- f = message.getCreatedAt();
3315
- if (f != null) {
3316
- writer.writeMessage(
3317
- 9,
3318
- f,
3319
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
3320
- );
3321
- }
3322
- f = message.getStartedAt();
3323
- if (f != null) {
3324
- writer.writeMessage(
3325
- 10,
3326
- f,
3327
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
3328
- );
3329
- }
3330
- f = message.getFinishedAt();
3331
- if (f != null) {
3332
- writer.writeMessage(
3333
- 11,
3334
- f,
3335
- google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
3336
- );
3337
- }
3338
- };
3339
-
3340
-
3341
- /**
3342
- * optional string run_id = 1;
3343
- * @return {string}
3344
- */
3345
- proto.trb.strategy.v1.BacktestRun.prototype.getRunId = function() {
3346
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
3347
- };
3348
-
3349
-
3350
- /**
3351
- * @param {string} value
3352
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3353
- */
3354
- proto.trb.strategy.v1.BacktestRun.prototype.setRunId = function(value) {
3355
- return jspb.Message.setProto3StringField(this, 1, value);
3356
- };
3357
-
3358
-
3359
- /**
3360
- * optional string strategy_id = 2;
3361
- * @return {string}
3362
- */
3363
- proto.trb.strategy.v1.BacktestRun.prototype.getStrategyId = function() {
3364
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
3365
- };
3366
-
3367
-
3368
- /**
3369
- * @param {string} value
3370
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3371
- */
3372
- proto.trb.strategy.v1.BacktestRun.prototype.setStrategyId = function(value) {
3373
- return jspb.Message.setProto3StringField(this, 2, value);
3374
- };
3375
-
3376
-
3377
- /**
3378
- * optional StrategySpec spec = 3;
3379
- * @return {?proto.trb.strategy.v1.StrategySpec}
3380
- */
3381
- proto.trb.strategy.v1.BacktestRun.prototype.getSpec = function() {
3382
- return /** @type{?proto.trb.strategy.v1.StrategySpec} */ (
3383
- jspb.Message.getWrapperField(this, strategy_spec_pb.StrategySpec, 3));
3384
- };
3385
-
3386
-
3387
- /**
3388
- * @param {?proto.trb.strategy.v1.StrategySpec|undefined} value
3389
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3390
- */
3391
- proto.trb.strategy.v1.BacktestRun.prototype.setSpec = function(value) {
3392
- return jspb.Message.setWrapperField(this, 3, value);
3393
- };
3394
-
3395
-
3396
- /**
3397
- * Clears the message field making it undefined.
3398
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3399
- */
3400
- proto.trb.strategy.v1.BacktestRun.prototype.clearSpec = function() {
3401
- return this.setSpec(undefined);
3402
- };
3403
-
3404
-
3405
- /**
3406
- * Returns whether this field is set.
3407
- * @return {boolean}
3408
- */
3409
- proto.trb.strategy.v1.BacktestRun.prototype.hasSpec = function() {
3410
- return jspb.Message.getField(this, 3) != null;
3411
- };
3412
-
3413
-
3414
- /**
3415
- * optional BacktestConfig config = 4;
3416
- * @return {?proto.trb.strategy.v1.BacktestConfig}
3417
- */
3418
- proto.trb.strategy.v1.BacktestRun.prototype.getConfig = function() {
3419
- return /** @type{?proto.trb.strategy.v1.BacktestConfig} */ (
3420
- jspb.Message.getWrapperField(this, proto.trb.strategy.v1.BacktestConfig, 4));
3421
- };
3422
-
3423
-
3424
- /**
3425
- * @param {?proto.trb.strategy.v1.BacktestConfig|undefined} value
3426
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3427
- */
3428
- proto.trb.strategy.v1.BacktestRun.prototype.setConfig = function(value) {
3429
- return jspb.Message.setWrapperField(this, 4, value);
3430
- };
3431
-
3432
-
3433
- /**
3434
- * Clears the message field making it undefined.
3435
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3436
- */
3437
- proto.trb.strategy.v1.BacktestRun.prototype.clearConfig = function() {
3438
- return this.setConfig(undefined);
3439
- };
3440
-
3441
-
3442
- /**
3443
- * Returns whether this field is set.
3444
- * @return {boolean}
3445
- */
3446
- proto.trb.strategy.v1.BacktestRun.prototype.hasConfig = function() {
3447
- return jspb.Message.getField(this, 4) != null;
3448
- };
3449
-
3450
-
3451
- /**
3452
- * optional RunStatus status = 5;
3453
- * @return {!proto.trb.strategy.v1.RunStatus}
3454
- */
3455
- proto.trb.strategy.v1.BacktestRun.prototype.getStatus = function() {
3456
- return /** @type {!proto.trb.strategy.v1.RunStatus} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
3457
- };
3458
-
3459
-
3460
- /**
3461
- * @param {!proto.trb.strategy.v1.RunStatus} value
3462
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3463
- */
3464
- proto.trb.strategy.v1.BacktestRun.prototype.setStatus = function(value) {
3465
- return jspb.Message.setProto3EnumField(this, 5, value);
3466
- };
3467
-
3468
-
3469
- /**
3470
- * optional string error = 6;
3471
- * @return {string}
3472
- */
3473
- proto.trb.strategy.v1.BacktestRun.prototype.getError = function() {
3474
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
3475
- };
3476
-
3477
-
3478
- /**
3479
- * @param {string} value
3480
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3481
- */
3482
- proto.trb.strategy.v1.BacktestRun.prototype.setError = function(value) {
3483
- return jspb.Message.setProto3StringField(this, 6, value);
3484
- };
3485
-
3486
-
3487
- /**
3488
- * optional string engine_version = 7;
3489
- * @return {string}
3490
- */
3491
- proto.trb.strategy.v1.BacktestRun.prototype.getEngineVersion = function() {
3492
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
3493
- };
3494
-
3495
-
3496
- /**
3497
- * @param {string} value
3498
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3499
- */
3500
- proto.trb.strategy.v1.BacktestRun.prototype.setEngineVersion = function(value) {
3501
- return jspb.Message.setProto3StringField(this, 7, value);
3502
- };
3503
-
3504
-
3505
- /**
3506
- * optional string search_run_id = 8;
3507
- * @return {string}
3508
- */
3509
- proto.trb.strategy.v1.BacktestRun.prototype.getSearchRunId = function() {
3510
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
3511
- };
3512
-
3513
-
3514
- /**
3515
- * @param {string} value
3516
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3517
- */
3518
- proto.trb.strategy.v1.BacktestRun.prototype.setSearchRunId = function(value) {
3519
- return jspb.Message.setProto3StringField(this, 8, value);
3520
- };
3521
-
3522
-
3523
- /**
3524
- * optional google.protobuf.Timestamp created_at = 9;
3525
- * @return {?proto.google.protobuf.Timestamp}
3526
- */
3527
- proto.trb.strategy.v1.BacktestRun.prototype.getCreatedAt = function() {
3528
- return /** @type{?proto.google.protobuf.Timestamp} */ (
3529
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 9));
3530
- };
3531
-
3532
-
3533
- /**
3534
- * @param {?proto.google.protobuf.Timestamp|undefined} value
3535
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3536
- */
3537
- proto.trb.strategy.v1.BacktestRun.prototype.setCreatedAt = function(value) {
3538
- return jspb.Message.setWrapperField(this, 9, value);
3539
- };
3540
-
3541
-
3542
- /**
3543
- * Clears the message field making it undefined.
3544
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3545
- */
3546
- proto.trb.strategy.v1.BacktestRun.prototype.clearCreatedAt = function() {
3547
- return this.setCreatedAt(undefined);
3548
- };
3549
-
3550
-
3551
- /**
3552
- * Returns whether this field is set.
3553
- * @return {boolean}
3554
- */
3555
- proto.trb.strategy.v1.BacktestRun.prototype.hasCreatedAt = function() {
3556
- return jspb.Message.getField(this, 9) != null;
3557
- };
3558
-
3559
-
3560
- /**
3561
- * optional google.protobuf.Timestamp started_at = 10;
3562
- * @return {?proto.google.protobuf.Timestamp}
3563
- */
3564
- proto.trb.strategy.v1.BacktestRun.prototype.getStartedAt = function() {
3565
- return /** @type{?proto.google.protobuf.Timestamp} */ (
3566
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 10));
3567
- };
3568
-
3569
-
3570
- /**
3571
- * @param {?proto.google.protobuf.Timestamp|undefined} value
3572
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3573
- */
3574
- proto.trb.strategy.v1.BacktestRun.prototype.setStartedAt = function(value) {
3575
- return jspb.Message.setWrapperField(this, 10, value);
3576
- };
3577
-
3578
-
3579
- /**
3580
- * Clears the message field making it undefined.
3581
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3582
- */
3583
- proto.trb.strategy.v1.BacktestRun.prototype.clearStartedAt = function() {
3584
- return this.setStartedAt(undefined);
3585
- };
3586
-
3587
-
3588
- /**
3589
- * Returns whether this field is set.
3590
- * @return {boolean}
3591
- */
3592
- proto.trb.strategy.v1.BacktestRun.prototype.hasStartedAt = function() {
3593
- return jspb.Message.getField(this, 10) != null;
3594
- };
3595
-
3596
-
3597
- /**
3598
- * optional google.protobuf.Timestamp finished_at = 11;
3599
- * @return {?proto.google.protobuf.Timestamp}
3600
- */
3601
- proto.trb.strategy.v1.BacktestRun.prototype.getFinishedAt = function() {
3602
- return /** @type{?proto.google.protobuf.Timestamp} */ (
3603
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 11));
3604
- };
3605
-
3606
-
3607
- /**
3608
- * @param {?proto.google.protobuf.Timestamp|undefined} value
3609
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3610
- */
3611
- proto.trb.strategy.v1.BacktestRun.prototype.setFinishedAt = function(value) {
3612
- return jspb.Message.setWrapperField(this, 11, value);
3613
- };
3614
-
3615
-
3616
- /**
3617
- * Clears the message field making it undefined.
3618
- * @return {!proto.trb.strategy.v1.BacktestRun} returns this
3619
- */
3620
- proto.trb.strategy.v1.BacktestRun.prototype.clearFinishedAt = function() {
3621
- return this.setFinishedAt(undefined);
3622
- };
3623
-
3624
-
3625
- /**
3626
- * Returns whether this field is set.
3627
- * @return {boolean}
3628
- */
3629
- proto.trb.strategy.v1.BacktestRun.prototype.hasFinishedAt = function() {
3630
- return jspb.Message.getField(this, 11) != null;
3631
- };
3632
-
3633
-
3634
-
3635
-
3636
-
3637
- if (jspb.Message.GENERATE_TO_OBJECT) {
3638
- /**
3639
- * Creates an object representation of this proto.
3640
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
3641
- * Optional fields that are not set will be set to undefined.
3642
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
3643
- * For the list of reserved names please see:
3644
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
3645
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
3646
- * JSPB instance for transitional soy proto support:
3647
- * http://goto/soy-param-migration
3648
- * @return {!Object}
3649
- */
3650
- proto.trb.strategy.v1.BacktestTask.prototype.toObject = function(opt_includeInstance) {
3651
- return proto.trb.strategy.v1.BacktestTask.toObject(opt_includeInstance, this);
3652
- };
3653
-
3654
-
3655
- /**
3656
- * Static version of the {@see toObject} method.
3657
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
3658
- * the JSPB instance for transitional soy proto support:
3659
- * http://goto/soy-param-migration
3660
- * @param {!proto.trb.strategy.v1.BacktestTask} msg The msg instance to transform.
3661
- * @return {!Object}
3662
- * @suppress {unusedLocalVariables} f is only used for nested messages
3663
- */
3664
- proto.trb.strategy.v1.BacktestTask.toObject = function(includeInstance, msg) {
3665
- var f, obj = {
3666
- runId: jspb.Message.getFieldWithDefault(msg, 1, "")
3667
- };
3668
-
3669
- if (includeInstance) {
3670
- obj.$jspbMessageInstance = msg;
3671
- }
3672
- return obj;
3673
- };
3674
- }
3675
-
3676
-
3677
- /**
3678
- * Deserializes binary data (in protobuf wire format).
3679
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
3680
- * @return {!proto.trb.strategy.v1.BacktestTask}
3681
- */
3682
- proto.trb.strategy.v1.BacktestTask.deserializeBinary = function(bytes) {
3683
- var reader = new jspb.BinaryReader(bytes);
3684
- var msg = new proto.trb.strategy.v1.BacktestTask;
3685
- return proto.trb.strategy.v1.BacktestTask.deserializeBinaryFromReader(msg, reader);
3686
- };
3687
-
3688
-
3689
- /**
3690
- * Deserializes binary data (in protobuf wire format) from the
3691
- * given reader into the given message object.
3692
- * @param {!proto.trb.strategy.v1.BacktestTask} msg The message object to deserialize into.
3693
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3694
- * @return {!proto.trb.strategy.v1.BacktestTask}
3695
- */
3696
- proto.trb.strategy.v1.BacktestTask.deserializeBinaryFromReader = function(msg, reader) {
3697
- while (reader.nextField()) {
3698
- if (reader.isEndGroup()) {
3699
- break;
3700
- }
3701
- var field = reader.getFieldNumber();
3702
- switch (field) {
3703
- case 1:
3704
- var value = /** @type {string} */ (reader.readString());
3705
- msg.setRunId(value);
3706
- break;
3707
- default:
3708
- reader.skipField();
3709
- break;
3710
- }
3711
- }
3712
- return msg;
3713
- };
3714
-
3715
-
3716
- /**
3717
- * Serializes the message to binary data (in protobuf wire format).
3718
- * @return {!Uint8Array}
3719
- */
3720
- proto.trb.strategy.v1.BacktestTask.prototype.serializeBinary = function() {
3721
- var writer = new jspb.BinaryWriter();
3722
- proto.trb.strategy.v1.BacktestTask.serializeBinaryToWriter(this, writer);
3723
- return writer.getResultBuffer();
3724
- };
3725
-
3726
-
3727
- /**
3728
- * Serializes the given message to binary data (in protobuf wire
3729
- * format), writing to the given BinaryWriter.
3730
- * @param {!proto.trb.strategy.v1.BacktestTask} message
3731
- * @param {!jspb.BinaryWriter} writer
3732
- * @suppress {unusedLocalVariables} f is only used for nested messages
3733
- */
3734
- proto.trb.strategy.v1.BacktestTask.serializeBinaryToWriter = function(message, writer) {
3735
- var f = undefined;
3736
- f = message.getRunId();
3737
- if (f.length > 0) {
3738
- writer.writeString(
3739
- 1,
3740
- f
3741
- );
3742
- }
3743
- };
3744
-
3745
-
3746
- /**
3747
- * optional string run_id = 1;
3748
- * @return {string}
3749
- */
3750
- proto.trb.strategy.v1.BacktestTask.prototype.getRunId = function() {
3751
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
3752
- };
3753
-
3754
-
3755
- /**
3756
- * @param {string} value
3757
- * @return {!proto.trb.strategy.v1.BacktestTask} returns this
3758
- */
3759
- proto.trb.strategy.v1.BacktestTask.prototype.setRunId = function(value) {
3760
- return jspb.Message.setProto3StringField(this, 1, value);
3761
- };
3762
-
3763
-
3764
- /**
3765
- * @enum {number}
3766
- */
3767
- proto.trb.strategy.v1.RunStatus = {
3768
- RUN_STATUS_UNSPECIFIED: 0,
3769
- RUN_QUEUED: 1,
3770
- RUN_RUNNING: 2,
3771
- RUN_SUCCEEDED: 3,
3772
- RUN_FAILED: 4,
3773
- RUN_CANCELED: 5
3774
- };
3775
-
3776
- goog.object.extend(exports, proto.trb.strategy.v1);