@marleena/trb-proto 1.0.55 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,388 @@
1
+ import * as jspb from 'google-protobuf'
2
+
3
+ import * as indicators_params_pb from '../indicators/params_pb'; // proto import: "indicators/params.proto"
4
+
5
+
6
+ export class IndicatorRef extends jspb.Message {
7
+ getId(): string;
8
+ setId(value: string): IndicatorRef;
9
+
10
+ getSettings(): indicators_params_pb.IndicatorSettings | undefined;
11
+ setSettings(value?: indicators_params_pb.IndicatorSettings): IndicatorRef;
12
+ hasSettings(): boolean;
13
+ clearSettings(): IndicatorRef;
14
+
15
+ getOutputKey(): string;
16
+ setOutputKey(value: string): IndicatorRef;
17
+
18
+ getAppliedTo(): PriceField;
19
+ setAppliedTo(value: PriceField): IndicatorRef;
20
+
21
+ serializeBinary(): Uint8Array;
22
+ toObject(includeInstance?: boolean): IndicatorRef.AsObject;
23
+ static toObject(includeInstance: boolean, msg: IndicatorRef): IndicatorRef.AsObject;
24
+ static serializeBinaryToWriter(message: IndicatorRef, writer: jspb.BinaryWriter): void;
25
+ static deserializeBinary(bytes: Uint8Array): IndicatorRef;
26
+ static deserializeBinaryFromReader(message: IndicatorRef, reader: jspb.BinaryReader): IndicatorRef;
27
+ }
28
+
29
+ export namespace IndicatorRef {
30
+ export type AsObject = {
31
+ id: string,
32
+ settings?: indicators_params_pb.IndicatorSettings.AsObject,
33
+ outputKey: string,
34
+ appliedTo: PriceField,
35
+ }
36
+ }
37
+
38
+ export class ArithExpr extends jspb.Message {
39
+ getLeft(): Operand | undefined;
40
+ setLeft(value?: Operand): ArithExpr;
41
+ hasLeft(): boolean;
42
+ clearLeft(): ArithExpr;
43
+
44
+ getOp(): ArithOp;
45
+ setOp(value: ArithOp): ArithExpr;
46
+
47
+ getRight(): Operand | undefined;
48
+ setRight(value?: Operand): ArithExpr;
49
+ hasRight(): boolean;
50
+ clearRight(): ArithExpr;
51
+
52
+ serializeBinary(): Uint8Array;
53
+ toObject(includeInstance?: boolean): ArithExpr.AsObject;
54
+ static toObject(includeInstance: boolean, msg: ArithExpr): ArithExpr.AsObject;
55
+ static serializeBinaryToWriter(message: ArithExpr, writer: jspb.BinaryWriter): void;
56
+ static deserializeBinary(bytes: Uint8Array): ArithExpr;
57
+ static deserializeBinaryFromReader(message: ArithExpr, reader: jspb.BinaryReader): ArithExpr;
58
+ }
59
+
60
+ export namespace ArithExpr {
61
+ export type AsObject = {
62
+ left?: Operand.AsObject,
63
+ op: ArithOp,
64
+ right?: Operand.AsObject,
65
+ }
66
+ }
67
+
68
+ export class Operand extends jspb.Message {
69
+ getShift(): number;
70
+ setShift(value: number): Operand;
71
+
72
+ getIndicatorId(): string;
73
+ setIndicatorId(value: string): Operand;
74
+
75
+ getPrice(): PriceField;
76
+ setPrice(value: PriceField): Operand;
77
+
78
+ getConstant(): number;
79
+ setConstant(value: number): Operand;
80
+
81
+ getArith(): ArithExpr | undefined;
82
+ setArith(value?: ArithExpr): Operand;
83
+ hasArith(): boolean;
84
+ clearArith(): Operand;
85
+
86
+ getOperandCase(): Operand.OperandCase;
87
+
88
+ serializeBinary(): Uint8Array;
89
+ toObject(includeInstance?: boolean): Operand.AsObject;
90
+ static toObject(includeInstance: boolean, msg: Operand): Operand.AsObject;
91
+ static serializeBinaryToWriter(message: Operand, writer: jspb.BinaryWriter): void;
92
+ static deserializeBinary(bytes: Uint8Array): Operand;
93
+ static deserializeBinaryFromReader(message: Operand, reader: jspb.BinaryReader): Operand;
94
+ }
95
+
96
+ export namespace Operand {
97
+ export type AsObject = {
98
+ shift: number,
99
+ indicatorId: string,
100
+ price: PriceField,
101
+ constant: number,
102
+ arith?: ArithExpr.AsObject,
103
+ }
104
+
105
+ export enum OperandCase {
106
+ OPERAND_NOT_SET = 0,
107
+ INDICATOR_ID = 1,
108
+ PRICE = 2,
109
+ CONSTANT = 3,
110
+ ARITH = 4,
111
+ }
112
+ }
113
+
114
+ export class Comparison extends jspb.Message {
115
+ getLeft(): Operand | undefined;
116
+ setLeft(value?: Operand): Comparison;
117
+ hasLeft(): boolean;
118
+ clearLeft(): Comparison;
119
+
120
+ getOp(): CompareOp;
121
+ setOp(value: CompareOp): Comparison;
122
+
123
+ getRight(): Operand | undefined;
124
+ setRight(value?: Operand): Comparison;
125
+ hasRight(): boolean;
126
+ clearRight(): Comparison;
127
+
128
+ serializeBinary(): Uint8Array;
129
+ toObject(includeInstance?: boolean): Comparison.AsObject;
130
+ static toObject(includeInstance: boolean, msg: Comparison): Comparison.AsObject;
131
+ static serializeBinaryToWriter(message: Comparison, writer: jspb.BinaryWriter): void;
132
+ static deserializeBinary(bytes: Uint8Array): Comparison;
133
+ static deserializeBinaryFromReader(message: Comparison, reader: jspb.BinaryReader): Comparison;
134
+ }
135
+
136
+ export namespace Comparison {
137
+ export type AsObject = {
138
+ left?: Operand.AsObject,
139
+ op: CompareOp,
140
+ right?: Operand.AsObject,
141
+ }
142
+ }
143
+
144
+ export class BoolExpr extends jspb.Message {
145
+ getCompare(): Comparison | undefined;
146
+ setCompare(value?: Comparison): BoolExpr;
147
+ hasCompare(): boolean;
148
+ clearCompare(): BoolExpr;
149
+
150
+ getAll(): BoolList | undefined;
151
+ setAll(value?: BoolList): BoolExpr;
152
+ hasAll(): boolean;
153
+ clearAll(): BoolExpr;
154
+
155
+ getAny(): BoolList | undefined;
156
+ setAny(value?: BoolList): BoolExpr;
157
+ hasAny(): boolean;
158
+ clearAny(): BoolExpr;
159
+
160
+ getNegate(): BoolExpr | undefined;
161
+ setNegate(value?: BoolExpr): BoolExpr;
162
+ hasNegate(): boolean;
163
+ clearNegate(): BoolExpr;
164
+
165
+ getLiteral(): boolean;
166
+ setLiteral(value: boolean): BoolExpr;
167
+
168
+ getNodeCase(): BoolExpr.NodeCase;
169
+
170
+ serializeBinary(): Uint8Array;
171
+ toObject(includeInstance?: boolean): BoolExpr.AsObject;
172
+ static toObject(includeInstance: boolean, msg: BoolExpr): BoolExpr.AsObject;
173
+ static serializeBinaryToWriter(message: BoolExpr, writer: jspb.BinaryWriter): void;
174
+ static deserializeBinary(bytes: Uint8Array): BoolExpr;
175
+ static deserializeBinaryFromReader(message: BoolExpr, reader: jspb.BinaryReader): BoolExpr;
176
+ }
177
+
178
+ export namespace BoolExpr {
179
+ export type AsObject = {
180
+ compare?: Comparison.AsObject,
181
+ all?: BoolList.AsObject,
182
+ any?: BoolList.AsObject,
183
+ negate?: BoolExpr.AsObject,
184
+ literal: boolean,
185
+ }
186
+
187
+ export enum NodeCase {
188
+ NODE_NOT_SET = 0,
189
+ COMPARE = 1,
190
+ ALL = 2,
191
+ ANY = 3,
192
+ NEGATE = 4,
193
+ LITERAL = 5,
194
+ }
195
+ }
196
+
197
+ export class BoolList extends jspb.Message {
198
+ getOperandsList(): Array<BoolExpr>;
199
+ setOperandsList(value: Array<BoolExpr>): BoolList;
200
+ clearOperandsList(): BoolList;
201
+ addOperands(value?: BoolExpr, index?: number): BoolExpr;
202
+
203
+ serializeBinary(): Uint8Array;
204
+ toObject(includeInstance?: boolean): BoolList.AsObject;
205
+ static toObject(includeInstance: boolean, msg: BoolList): BoolList.AsObject;
206
+ static serializeBinaryToWriter(message: BoolList, writer: jspb.BinaryWriter): void;
207
+ static deserializeBinary(bytes: Uint8Array): BoolList;
208
+ static deserializeBinaryFromReader(message: BoolList, reader: jspb.BinaryReader): BoolList;
209
+ }
210
+
211
+ export namespace BoolList {
212
+ export type AsObject = {
213
+ operandsList: Array<BoolExpr.AsObject>,
214
+ }
215
+ }
216
+
217
+ export class PositionSizing extends jspb.Message {
218
+ getFixedCash(): number;
219
+ setFixedCash(value: number): PositionSizing;
220
+
221
+ getPercentEquity(): number;
222
+ setPercentEquity(value: number): PositionSizing;
223
+
224
+ getFixedUnits(): number;
225
+ setFixedUnits(value: number): PositionSizing;
226
+
227
+ getRiskPerTrade(): number;
228
+ setRiskPerTrade(value: number): PositionSizing;
229
+
230
+ getMaxOpenPositions(): number;
231
+ setMaxOpenPositions(value: number): PositionSizing;
232
+
233
+ getAllowPyramiding(): boolean;
234
+ setAllowPyramiding(value: boolean): PositionSizing;
235
+
236
+ getMethodCase(): PositionSizing.MethodCase;
237
+
238
+ serializeBinary(): Uint8Array;
239
+ toObject(includeInstance?: boolean): PositionSizing.AsObject;
240
+ static toObject(includeInstance: boolean, msg: PositionSizing): PositionSizing.AsObject;
241
+ static serializeBinaryToWriter(message: PositionSizing, writer: jspb.BinaryWriter): void;
242
+ static deserializeBinary(bytes: Uint8Array): PositionSizing;
243
+ static deserializeBinaryFromReader(message: PositionSizing, reader: jspb.BinaryReader): PositionSizing;
244
+ }
245
+
246
+ export namespace PositionSizing {
247
+ export type AsObject = {
248
+ fixedCash: number,
249
+ percentEquity: number,
250
+ fixedUnits: number,
251
+ riskPerTrade: number,
252
+ maxOpenPositions: number,
253
+ allowPyramiding: boolean,
254
+ }
255
+
256
+ export enum MethodCase {
257
+ METHOD_NOT_SET = 0,
258
+ FIXED_CASH = 1,
259
+ PERCENT_EQUITY = 2,
260
+ FIXED_UNITS = 3,
261
+ RISK_PER_TRADE = 4,
262
+ }
263
+ }
264
+
265
+ export class RiskControls extends jspb.Message {
266
+ getStopLossPct(): number;
267
+ setStopLossPct(value: number): RiskControls;
268
+
269
+ getTakeProfitPct(): number;
270
+ setTakeProfitPct(value: number): RiskControls;
271
+
272
+ getTrailingStop(): boolean;
273
+ setTrailingStop(value: boolean): RiskControls;
274
+
275
+ getTrailingPct(): number;
276
+ setTrailingPct(value: number): RiskControls;
277
+
278
+ getTimeStopBars(): number;
279
+ setTimeStopBars(value: number): RiskControls;
280
+
281
+ serializeBinary(): Uint8Array;
282
+ toObject(includeInstance?: boolean): RiskControls.AsObject;
283
+ static toObject(includeInstance: boolean, msg: RiskControls): RiskControls.AsObject;
284
+ static serializeBinaryToWriter(message: RiskControls, writer: jspb.BinaryWriter): void;
285
+ static deserializeBinary(bytes: Uint8Array): RiskControls;
286
+ static deserializeBinaryFromReader(message: RiskControls, reader: jspb.BinaryReader): RiskControls;
287
+ }
288
+
289
+ export namespace RiskControls {
290
+ export type AsObject = {
291
+ stopLossPct: number,
292
+ takeProfitPct: number,
293
+ trailingStop: boolean,
294
+ trailingPct: number,
295
+ timeStopBars: number,
296
+ }
297
+ }
298
+
299
+ export class StrategySearchSpec extends jspb.Message {
300
+ getVersion(): number;
301
+ setVersion(value: number): StrategySearchSpec;
302
+
303
+ getIndicatorsList(): Array<IndicatorRef>;
304
+ setIndicatorsList(value: Array<IndicatorRef>): StrategySearchSpec;
305
+ clearIndicatorsList(): StrategySearchSpec;
306
+ addIndicators(value?: IndicatorRef, index?: number): IndicatorRef;
307
+
308
+ getEntryLong(): BoolExpr | undefined;
309
+ setEntryLong(value?: BoolExpr): StrategySearchSpec;
310
+ hasEntryLong(): boolean;
311
+ clearEntryLong(): StrategySearchSpec;
312
+
313
+ getExitLong(): BoolExpr | undefined;
314
+ setExitLong(value?: BoolExpr): StrategySearchSpec;
315
+ hasExitLong(): boolean;
316
+ clearExitLong(): StrategySearchSpec;
317
+
318
+ getEntryShort(): BoolExpr | undefined;
319
+ setEntryShort(value?: BoolExpr): StrategySearchSpec;
320
+ hasEntryShort(): boolean;
321
+ clearEntryShort(): StrategySearchSpec;
322
+
323
+ getExitShort(): BoolExpr | undefined;
324
+ setExitShort(value?: BoolExpr): StrategySearchSpec;
325
+ hasExitShort(): boolean;
326
+ clearExitShort(): StrategySearchSpec;
327
+
328
+ getSizing(): PositionSizing | undefined;
329
+ setSizing(value?: PositionSizing): StrategySearchSpec;
330
+ hasSizing(): boolean;
331
+ clearSizing(): StrategySearchSpec;
332
+
333
+ getRisk(): RiskControls | undefined;
334
+ setRisk(value?: RiskControls): StrategySearchSpec;
335
+ hasRisk(): boolean;
336
+ clearRisk(): StrategySearchSpec;
337
+
338
+ getWarmupBars(): number;
339
+ setWarmupBars(value: number): StrategySearchSpec;
340
+
341
+ serializeBinary(): Uint8Array;
342
+ toObject(includeInstance?: boolean): StrategySearchSpec.AsObject;
343
+ static toObject(includeInstance: boolean, msg: StrategySearchSpec): StrategySearchSpec.AsObject;
344
+ static serializeBinaryToWriter(message: StrategySearchSpec, writer: jspb.BinaryWriter): void;
345
+ static deserializeBinary(bytes: Uint8Array): StrategySearchSpec;
346
+ static deserializeBinaryFromReader(message: StrategySearchSpec, reader: jspb.BinaryReader): StrategySearchSpec;
347
+ }
348
+
349
+ export namespace StrategySearchSpec {
350
+ export type AsObject = {
351
+ version: number,
352
+ indicatorsList: Array<IndicatorRef.AsObject>,
353
+ entryLong?: BoolExpr.AsObject,
354
+ exitLong?: BoolExpr.AsObject,
355
+ entryShort?: BoolExpr.AsObject,
356
+ exitShort?: BoolExpr.AsObject,
357
+ sizing?: PositionSizing.AsObject,
358
+ risk?: RiskControls.AsObject,
359
+ warmupBars: number,
360
+ }
361
+ }
362
+
363
+ export enum PriceField {
364
+ PRICE_CLOSE = 0,
365
+ PRICE_OPEN = 1,
366
+ PRICE_HIGH = 2,
367
+ PRICE_LOW = 3,
368
+ PRICE_VOLUME = 4,
369
+ PRICE_HL2 = 5,
370
+ PRICE_HLC3 = 6,
371
+ PRICE_OHLC4 = 7,
372
+ }
373
+ export enum ArithOp {
374
+ ARITH_OP_ADD = 0,
375
+ ARITH_OP_SUB = 1,
376
+ ARITH_OP_MUL = 2,
377
+ ARITH_OP_DIV = 3,
378
+ }
379
+ export enum CompareOp {
380
+ COMPARE_OP_GT = 0,
381
+ COMPARE_OP_GE = 1,
382
+ COMPARE_OP_LT = 2,
383
+ COMPARE_OP_LE = 3,
384
+ COMPARE_OP_EQ = 4,
385
+ COMPARE_OP_NE = 5,
386
+ COMPARE_OP_CROSSES_ABOVE = 6,
387
+ COMPARE_OP_CROSSES_BELOW = 7,
388
+ }