forex-tester-custom-robot-api 2.0.2

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,1607 @@
1
+ export declare enum SymbolNumberProperty {
2
+ PRICE_BID = 1,
3
+ PRICE_ASK = 4,
4
+ POINT = 11,
5
+ DIGITS = 12,
6
+ SPREAD = 18,
7
+ FLOATING_SPREAD = 41,
8
+ TICK_VALUE = 16,
9
+ TICK_SIZE = 17,
10
+ QUOTE_TIME = 15,
11
+ SELECTED = 0,
12
+ VISIBLE = 785,
13
+ TRADE_CONTRACT_SIZE = 28,
14
+ TRADE_MODE = 30,
15
+ TRADE_STOPS_LEVEL = 31,
16
+ TRADE_FREEZE_LEVEL = 32,
17
+ VOLUME_MIN = 34,
18
+ VOLUME_MAX = 35,
19
+ VOLUME_STEP = 36,
20
+ TRADE_START_TIME = 51,
21
+ TRADE_EXPIRATION_TIME = 52,
22
+ SWAP_LONG = 38,
23
+ SWAP_SHORT = 39,
24
+ SWAP_CALCULATION_MODE = 37,
25
+ SWAP_TRIPLE_DAY = 40,
26
+ PROFIT_CALCULATION_MODE = 29,
27
+ MARGIN_INITIAL = 42,
28
+ MARGIN_MAINTENANCE = 43
29
+ }
30
+ export declare enum SymbolStringProperty {
31
+ CURRENCY_BASE = 22,
32
+ CURRENCY_PROFIT = 23,
33
+ CURRENCY_MARGIN = 24,
34
+ DESCRIPTION = 20,
35
+ PATH = 21
36
+ }
37
+ export declare enum MarketInfoProperty {
38
+ PRICE_DAY_LOW = 1,
39
+ PRICE_DAY_HIGH = 2,
40
+ PRICE_BID = 9,
41
+ PRICE_ASK = 10,
42
+ POINT = 11,
43
+ DIGITS = 12,
44
+ SPREAD = 13,
45
+ TICK_VALUE = 16,
46
+ TICK_SIZE = 17,
47
+ TRADE_STOPS_LEVEL = 14,
48
+ TRADE_FREEZE_LEVEL = 33,
49
+ TRADE_CONTRACT_SIZE = 15,
50
+ VOLUME_MIN = 23,
51
+ VOLUME_STEP = 24,
52
+ VOLUME_MAX = 25,
53
+ TRADE_ALLOWED = 22,
54
+ TRADE_CLOSE_BY_ALLOWED = 34,
55
+ TRADE_START_TIME = 20,
56
+ TRADE_EXPIRATION_TIME = 21,
57
+ SWAP_LONG = 18,
58
+ SWAP_SHORT = 19,
59
+ SWAP_CALCULATION_MODE = 26,
60
+ PROFIT_CALCULATION_MODE = 27,
61
+ MARGIN_CALCULATION_MODE = 28,
62
+ MARGIN_INITIAL = 29,
63
+ MARGIN_MAINTENANCE = 30,
64
+ MARGIN_HEDGED = 31,
65
+ MARGIN_REQUIRED = 32
66
+ }
67
+ export declare enum Timeframe {
68
+ CURRENT = 0,// Current timeframe
69
+ M1 = 1,// 1 minute
70
+ M5 = 5,// 5 minutes
71
+ M15 = 15,// 15 minutes
72
+ M30 = 30,// 30 minutes
73
+ H1 = 60,// 1 hour
74
+ H4 = 240,// 4 hours
75
+ D1 = 1440,// 1 day
76
+ W1 = 10080,// 1 week
77
+ MN1 = 43200,// 1 month
78
+ M2 = 2,// 2 minutes
79
+ M3 = 3,// 3 minutes
80
+ M4 = 4,// 4 minutes
81
+ M6 = 6,// 6 minutes
82
+ M10 = 10,// 10 minutes
83
+ M12 = 12,// 12 minutes
84
+ M20 = 20,// 20 minutes
85
+ H2 = 120,// 2 hours
86
+ H3 = 180,// 3 hours
87
+ H6 = 360,// 6 hours
88
+ H8 = 480,// 8 hours
89
+ H12 = 720
90
+ }
91
+ export declare enum TestStatistic {
92
+ DEPOSIT_INITIAL = 0,
93
+ NET_PROFIT = 2,
94
+ GROSS_PROFIT = 3,
95
+ GROSS_LOSS = 4,
96
+ TRADE_PROFIT_MAX = 5,
97
+ TRADE_LOSS_MAX = 6,
98
+ CONSECUTIVE_PROFIT_MAX = 7,
99
+ CONSECUTIVE_PROFIT_MAX_TRADES = 35,
100
+ CONSECUTIVE_PROFIT_LONGEST = 8,
101
+ CONSECUTIVE_PROFIT_TRADES_MAX = 36,
102
+ CONSECUTIVE_LOSS_MAX = 9,
103
+ CONSECUTIVE_LOSS_MAX_TRADES = 37,
104
+ CONSECUTIVE_LOSS_LONGEST = 10,
105
+ CONSECUTIVE_LOSS_TRADES_MAX = 38,
106
+ BALANCE_MIN = 11,
107
+ BALANCE_DRAWDOWN = 12,
108
+ BALANCE_DRAWDOWN_PERCENT = 13,
109
+ BALANCE_DRAWDOWN_RELATIVE_PERCENT = 15,
110
+ BALANCE_DRAWDOWN_RELATIVE = 14,
111
+ EQUITY_MIN = 16,
112
+ EQUITY_DRAWDOWN = 17,
113
+ EQUITY_DRAWDOWN_PERCENT = 18,
114
+ EQUITY_DRAWDOWN_RELATIVE_PERCENT = 20,
115
+ EQUITY_DRAWDOWN_RELATIVE = 19,
116
+ EXPECTED_PAYOFF = 21,
117
+ PROFIT_FACTOR = 22,
118
+ MARGIN_LEVEL_MIN = 25,
119
+ OPTIMIZATION_CUSTOM = 26,
120
+ TRADES_TOTAL = 28,
121
+ TRADES_PROFITABLE = 29,
122
+ TRADES_LOSING = 30,
123
+ TRADES_SHORT = 31,
124
+ TRADES_LONG = 32,
125
+ TRADES_SHORT_PROFITABLE = 33,
126
+ TRADES_LONG_PROFITABLE = 34,
127
+ CONSECUTIVE_PROFIT_TRADES_AVG = 39,
128
+ CONSECUTIVE_LOSS_TRADES_AVG = 40
129
+ }
130
+ export declare enum TimeZoneMode {
131
+ PROJECT = 0,
132
+ UTC = 1
133
+ }
134
+ export declare enum TimeUnit {
135
+ SECONDS = 0,
136
+ MILLISECONDS = 1
137
+ }
138
+ export declare enum ProfitType {
139
+ MONEY = 0,
140
+ PIPS = 1
141
+ }
142
+ export declare class FTODate {
143
+ private _date;
144
+ private _timeZoneMode;
145
+ protected constructor(value: string | number | Date, unit?: TimeUnit, timeZoneMode?: TimeZoneMode);
146
+ valueOf(timeUnit?: TimeUnit): number;
147
+ toMilliseconds(timeZoneMode?: TimeZoneMode): number;
148
+ toSeconds(timeZoneMode?: TimeZoneMode): number;
149
+ toString(timeZoneMode?: TimeZoneMode): string;
150
+ toJSDate(timeZoneMode?: TimeZoneMode): Date;
151
+ dayOfMonth(timeZoneMode?: TimeZoneMode): number;
152
+ monthOf(timeZoneMode?: TimeZoneMode): number;
153
+ weekOf(timeZoneMode?: TimeZoneMode): number;
154
+ yearOf(timeZoneMode?: TimeZoneMode): number;
155
+ dayOfYear(timeZoneMode?: TimeZoneMode): number;
156
+ dayOfWeek(timeZoneMode?: TimeZoneMode): number;
157
+ hour(timeZoneMode?: TimeZoneMode): number;
158
+ minute(timeZoneMode?: TimeZoneMode): number;
159
+ second(timeZoneMode?: TimeZoneMode): number;
160
+ addMilliseconds(milliseconds: number): FTODate;
161
+ addSeconds(seconds: number): FTODate;
162
+ addMinutes(minutes: number): FTODate;
163
+ addHours(hours: number): FTODate;
164
+ addDays(days: number): FTODate;
165
+ addMonths(months: number): FTODate;
166
+ addYears(years: number): FTODate;
167
+ private convertByTimeZoneModeToMilliseconds;
168
+ private calculateWeekOfYear;
169
+ }
170
+ /** Plain rect DTO exposed via GetChartInformation().paintRect (not the full TRect class). */
171
+ export interface ChartPaintRect {
172
+ left: number;
173
+ top: number;
174
+ right: number;
175
+ bottom: number;
176
+ width: number;
177
+ height: number;
178
+ }
179
+ export declare enum PenStyle {
180
+ SOLID = 0,
181
+ DASH = 1,
182
+ DOT = 2,
183
+ DASH_DOT = 3,
184
+ DASH_DOT_DOT = 4,
185
+ CLEAR = 5,
186
+ INSIDE_FRAME = 6,
187
+ USER_STYLE = 7,
188
+ ALTERNATE = 8
189
+ }
190
+ export declare class ChartInfo {
191
+ firstIndex: number;
192
+ lastIndex: number;
193
+ barWidth: number;
194
+ currZoom: number;
195
+ paintRect: ChartPaintRect;
196
+ rightOffsetBars: number;
197
+ windowPriceMax: number;
198
+ windowPriceMin: number;
199
+ windowTimeStart: FTODate;
200
+ windowTimeEnd: FTODate;
201
+ protected constructor();
202
+ }
203
+ export declare enum OrderType {
204
+ BUY = 0,
205
+ SELL = 1,
206
+ BUY_LIMIT = 2,
207
+ SELL_LIMIT = 3,
208
+ BUY_STOP = 4,
209
+ SELL_STOP = 5
210
+ }
211
+ /**
212
+ * Display mode for price data on charts.
213
+ * User-facing label: "Adjustment Mode: Adj. / Orig."
214
+ */
215
+ export declare enum AdjustmentMode {
216
+ /** Prices adjusted for rollover gaps */
217
+ BACK_ADJUSTED = "back-adjusted",
218
+ /** Original unadjusted prices */
219
+ ORIGINAL = "original"
220
+ }
221
+ export declare enum ChartMode {
222
+ CANDLES = 0,
223
+ LINE = 1,
224
+ BARS = 2,
225
+ HEIKIN_ASHI = 3
226
+ }
227
+ export interface IChartInterfaceProcRec {
228
+ ConvertChartIndexToScreenX: (index: number) => number;
229
+ ConvertPriceToScreenY: (price: number) => number;
230
+ ConvertScreenXToChartIndex: (x: number) => number;
231
+ ConvertScreenYToPrice: (y: number) => number;
232
+ GetChartInformation: () => ChartInfo | null;
233
+ GetChartBackgroundColor: () => string;
234
+ RefreshChartDisplay: () => void;
235
+ GetChartMode: () => ChartMode;
236
+ SetChartMode: (style: ChartMode) => void;
237
+ GetAdjustmentMode: () => AdjustmentMode | undefined;
238
+ }
239
+ export interface IVeryBasicProcRec {
240
+ }
241
+ export interface IDateTimeProcRec extends IVeryBasicProcRec {
242
+ /**
243
+ * Builds an FTODate from a string or Unix number. Not a user input — no settings row is registered.
244
+ * Numeric input defaults to Unix seconds; pass TimeUnit.MILLISECONDS for JS timestamps.
245
+ * Although Date is in the signature, passing a native Date currently throws — use date.getTime() with MILLISECONDS.
246
+ */
247
+ CreateFTODate: (value: string | number | Date, unit?: TimeUnit, timeZoneMode?: TimeZoneMode) => FTODate;
248
+ GetDayOfMonthByDateTime: (time: FTODate) => number;
249
+ GetWeekByDateTime: (time: FTODate) => number;
250
+ GetMonthByDateTime: (time: FTODate) => number;
251
+ GetYearByDateTime: (time: FTODate) => number;
252
+ TimeCurrent: () => FTODate;
253
+ Day: () => number;
254
+ DayOfWeek: () => number;
255
+ DayOfYear: () => number;
256
+ Hour: () => number;
257
+ Minute: () => number;
258
+ Month: () => number;
259
+ Second: () => number;
260
+ Year: () => number;
261
+ StructToTime: (time: FTODate) => number;
262
+ TimeDay: (unixTimeSeconds: number) => number;
263
+ TimeDaylightSavings: () => number;
264
+ TimeZoneSeconds: () => number;
265
+ TimeDayOfWeek: (unixTimeSeconds: number) => number;
266
+ TimeDayOfYear: (unixTimeSeconds: number) => number;
267
+ TimeGMT: () => number;
268
+ TimeLocal: () => number;
269
+ TimeGMTOffset: () => number;
270
+ TimeHour: (unixTimeSeconds: number) => number;
271
+ TimeMinute: (unixTimeSeconds: number) => number;
272
+ TimeMonth: (unixTimeSeconds: number) => number;
273
+ TimeSeconds: (unixTimeSeconds: number) => number;
274
+ TimeYear: (unixTimeSeconds: number) => number;
275
+ }
276
+ export interface ICommandParams {
277
+ source: string;
278
+ }
279
+ export declare abstract class Command {
280
+ abstract execute(commandParams?: ICommandParams): void;
281
+ protected constructor();
282
+ }
283
+ export declare enum ActionButtonPosition {
284
+ CHART_TOP_LEFT = 0,
285
+ CHART_TOP_RIGHT = 1,
286
+ CHART_BOTTOM_LEFT = 2,
287
+ CHART_BOTTOM_RIGHT = 3,
288
+ CHART_PRICE_LEFT = 4,
289
+ CHART_PRICE_RIGHT = 5,
290
+ OBJECT_TOP_LEFT = 6,
291
+ OBJECT_TOP_CENTER = 7,
292
+ OBJECT_TOP_RIGHT = 8,
293
+ OBJECT_CENTER_LEFT = 9,
294
+ OBJECT_CENTER = 10,
295
+ OBJECT_CENTER_RIGHT = 11,
296
+ OBJECT_BOTTOM_LEFT = 12,
297
+ OBJECT_BOTTOM_CENTER = 13,
298
+ OBJECT_BOTTOM_RIGHT = 14
299
+ }
300
+ export interface ActionButtonColors {
301
+ border?: string;
302
+ text?: string;
303
+ background?: string;
304
+ }
305
+ export interface ActionButtonState {
306
+ text?: string;
307
+ hoverText?: string;
308
+ icon?: HTMLImageElement | HTMLCanvasElement | string;
309
+ hoverIcon?: HTMLImageElement | HTMLCanvasElement | string;
310
+ onClick: (() => void) | Command;
311
+ onHover?: (() => void) | Command;
312
+ onLeave?: (() => void) | Command;
313
+ colors?: ActionButtonColors;
314
+ hoverColors?: ActionButtonColors;
315
+ font?: {
316
+ size?: number;
317
+ };
318
+ hoverFont?: {
319
+ size?: number;
320
+ };
321
+ tooltip?: {
322
+ text: string;
323
+ position?: 'top' | 'bottom' | 'left' | 'right';
324
+ };
325
+ }
326
+ export interface ActionButtonTemplate {
327
+ id: string;
328
+ states: ActionButtonState[];
329
+ position?: ActionButtonPosition;
330
+ x?: number;
331
+ y?: number;
332
+ width?: number;
333
+ height?: number;
334
+ }
335
+ export type Color = string;
336
+ export declare enum FontSize {
337
+ Tiny = 8,
338
+ Small = 10,
339
+ Normal = 12,
340
+ Large = 14,
341
+ Huge = 16
342
+ }
343
+ export declare enum MovingAverageType {
344
+ SMA = 0,
345
+ EMA = 1,
346
+ SMMA = 2,
347
+ LWMA = 3
348
+ }
349
+ export declare enum PriceType {
350
+ CLOSE = 0,
351
+ OPEN = 1,
352
+ HIGH = 2,
353
+ LOW = 3,
354
+ HL2 = 4,
355
+ HLC3 = 5,
356
+ HLCC4 = 6,
357
+ OHLC4 = 7
358
+ }
359
+ export declare enum PriceSeries {
360
+ OPEN = 0,
361
+ HIGH = 1,
362
+ LOW = 2,
363
+ CLOSE = 3,
364
+ VOLUME = 4
365
+ }
366
+ export interface SymbolInfo {
367
+ name: string;
368
+ digits: number;
369
+ spread: number;
370
+ pointSize: number;
371
+ lotSize: number;
372
+ lotCurrency: string;
373
+ swapLong: number;
374
+ swapShort: number;
375
+ }
376
+ export declare enum ObjectType {
377
+ ANY_OBJECT = 0,
378
+ V_LINE = 1,
379
+ H_LINE = 2,
380
+ TREND_LINE = 3,
381
+ RAY = 4,
382
+ POLYLINE = 5,
383
+ FIBO_RETRACEMENT = 6,
384
+ FIBO_TIME_ZONES = 7,
385
+ FIBO_ARC = 8,
386
+ FIBO_FAN = 9,
387
+ ANDREWS_PITCHFORK = 10,
388
+ TEXT = 11,
389
+ TEXT_LABEL = 12,
390
+ RECTANGLE = 13,
391
+ ELLIPSE = 14,
392
+ TRIANGLE = 15,
393
+ FIBO_CHANNEL = 16,
394
+ LR_CHANNEL = 17,
395
+ FIBO_EXTENSION = 18,
396
+ GANN_BOX = 19,
397
+ H_RAY = 20,
398
+ ARROW = 21,
399
+ ARROW_UP = 22,
400
+ ARROW_DOWN = 23,
401
+ PRICE_LABEL = 24,
402
+ PRICE_LABEL_RIGHT = 25,
403
+ PRICE_LABEL_LEFT = 26,
404
+ LABEL_UP = 27,
405
+ LABEL_DOWN = 28,
406
+ LABEL_LEFT = 29,
407
+ LABEL_RIGHT = 30
408
+ }
409
+ export declare enum TimeValue {
410
+ '00:00' = "00:00",
411
+ '00:15' = "00:15",
412
+ '00:30' = "00:30",
413
+ '00:45' = "00:45",
414
+ '01:00' = "01:00",
415
+ '01:15' = "01:15",
416
+ '01:30' = "01:30",
417
+ '01:45' = "01:45",
418
+ '02:00' = "02:00",
419
+ '02:15' = "02:15",
420
+ '02:30' = "02:30",
421
+ '02:45' = "02:45",
422
+ '03:00' = "03:00",
423
+ '03:15' = "03:15",
424
+ '03:30' = "03:30",
425
+ '03:45' = "03:45",
426
+ '04:00' = "04:00",
427
+ '04:15' = "04:15",
428
+ '04:30' = "04:30",
429
+ '04:45' = "04:45",
430
+ '05:00' = "05:00",
431
+ '05:15' = "05:15",
432
+ '05:30' = "05:30",
433
+ '05:45' = "05:45",
434
+ '06:00' = "06:00",
435
+ '06:15' = "06:15",
436
+ '06:30' = "06:30",
437
+ '06:45' = "06:45",
438
+ '07:00' = "07:00",
439
+ '07:15' = "07:15",
440
+ '07:30' = "07:30",
441
+ '07:45' = "07:45",
442
+ '08:00' = "08:00",
443
+ '08:15' = "08:15",
444
+ '08:30' = "08:30",
445
+ '08:45' = "08:45",
446
+ '09:00' = "09:00",
447
+ '09:15' = "09:15",
448
+ '09:30' = "09:30",
449
+ '09:45' = "09:45",
450
+ '10:00' = "10:00",
451
+ '10:15' = "10:15",
452
+ '10:30' = "10:30",
453
+ '10:45' = "10:45",
454
+ '11:00' = "11:00",
455
+ '11:15' = "11:15",
456
+ '11:30' = "11:30",
457
+ '11:45' = "11:45",
458
+ '12:00' = "12:00",
459
+ '12:15' = "12:15",
460
+ '12:30' = "12:30",
461
+ '12:45' = "12:45",
462
+ '13:00' = "13:00",
463
+ '13:15' = "13:15",
464
+ '13:30' = "13:30",
465
+ '13:45' = "13:45",
466
+ '14:00' = "14:00",
467
+ '14:15' = "14:15",
468
+ '14:30' = "14:30",
469
+ '14:45' = "14:45",
470
+ '15:00' = "15:00",
471
+ '15:15' = "15:15",
472
+ '15:30' = "15:30",
473
+ '15:45' = "15:45",
474
+ '16:00' = "16:00",
475
+ '16:15' = "16:15",
476
+ '16:30' = "16:30",
477
+ '16:45' = "16:45",
478
+ '17:00' = "17:00",
479
+ '17:15' = "17:15",
480
+ '17:30' = "17:30",
481
+ '17:45' = "17:45",
482
+ '18:00' = "18:00",
483
+ '18:15' = "18:15",
484
+ '18:30' = "18:30",
485
+ '18:45' = "18:45",
486
+ '19:00' = "19:00",
487
+ '19:15' = "19:15",
488
+ '19:30' = "19:30",
489
+ '19:45' = "19:45",
490
+ '20:00' = "20:00",
491
+ '20:15' = "20:15",
492
+ '20:30' = "20:30",
493
+ '20:45' = "20:45",
494
+ '21:00' = "21:00",
495
+ '21:15' = "21:15",
496
+ '21:30' = "21:30",
497
+ '21:45' = "21:45",
498
+ '22:00' = "22:00",
499
+ '22:15' = "22:15",
500
+ '22:30' = "22:30",
501
+ '22:45' = "22:45",
502
+ '23:00' = "23:00",
503
+ '23:15' = "23:15",
504
+ '23:30' = "23:30",
505
+ '23:45' = "23:45",
506
+ '23:59' = "23:59"
507
+ }
508
+ export declare enum InputType {
509
+ LONGWORD = 0,
510
+ INTEGER = 1,
511
+ DOUBLE = 2,
512
+ STRING = 3,
513
+ BOOLEAN = 4,
514
+ ENUM = 5,
515
+ TIMEFRAME = 6,
516
+ CURRENCY = 7,
517
+ LINE_STYLE = 8,
518
+ SEPARATOR = 9,
519
+ INDICATOR = 10,
520
+ COLOR = 11,
521
+ DATE_TIME = 12,
522
+ LEVELS = 13,
523
+ SESSION = 14,
524
+ SESSIONS_ARRAY = 15,
525
+ LINE = 16,
526
+ DATE_ONLY = 17,
527
+ TIME_ONLY = 18,
528
+ WIDTH = 19,
529
+ STYLE = 20,
530
+ COLOR_STYLE = 21,
531
+ COLOR_WIDTH = 22,
532
+ STYLE_WIDTH = 23,
533
+ FILL = 24
534
+ }
535
+ export declare enum InputTab {
536
+ STYLE = 0,
537
+ INPUTS = 1,
538
+ SESSIONS = 2,
539
+ TIMEFRAMES = 3,
540
+ LEVELS = 4,
541
+ CUSTOM = 5
542
+ }
543
+ export declare abstract class InputBase {
544
+ abstract getLocalizationIndependentValue(): string;
545
+ protected constructor();
546
+ }
547
+ export declare class InputString extends InputBase {
548
+ value: string;
549
+ getLocalizationIndependentValue(): string;
550
+ protected constructor(value: string);
551
+ }
552
+ export declare class InputNumber extends InputBase {
553
+ protected fValue: number;
554
+ protected constructor(value: number);
555
+ get value(): number;
556
+ set value(value: number);
557
+ getLocalizationIndependentValue(): string;
558
+ }
559
+ export declare class InputBool extends InputBase {
560
+ value: boolean;
561
+ protected constructor(value: boolean);
562
+ getLocalizationIndependentValue(): string;
563
+ }
564
+ export declare class InputEnum<T extends number = number> extends InputBase {
565
+ private fIndex;
566
+ private readonly valuesByIndex;
567
+ private readonly indexByValue;
568
+ protected constructor(defaultValue: T, enumObj: Record<string, T | string>, members?: readonly T[]);
569
+ protected constructor(defaultValue: T, values: readonly T[]);
570
+ get value(): T;
571
+ set value(newValue: T);
572
+ get index(): number;
573
+ set index(newIndex: number);
574
+ get count(): number;
575
+ getLocalizationIndependentValue(): string;
576
+ private static isEnumObject;
577
+ private static extractNumericValues;
578
+ private initFromValues;
579
+ }
580
+ export declare class InputTimeframe extends InputBase {
581
+ private fIndex;
582
+ private persistedMinutes;
583
+ private sortedMinutes;
584
+ private chartTimeframeResolver?;
585
+ protected constructor(defaultToCurrent?: boolean);
586
+ get value(): number;
587
+ get index(): number;
588
+ set index(newIndex: number);
589
+ get count(): number;
590
+ getLocalizationIndependentValue(): string;
591
+ private buildLabels;
592
+ private syncIndexFromPersistedMinutes;
593
+ }
594
+ export declare class InputDateOnly extends InputBase {
595
+ value: FTODate;
596
+ protected constructor(value: FTODate);
597
+ getLocalizationIndependentValue(): string;
598
+ }
599
+ export declare class InputTimeOnly extends InputBase {
600
+ value: TimeValue;
601
+ protected constructor(value: TimeValue);
602
+ getLocalizationIndependentValue(): string;
603
+ toString(): string;
604
+ static updateFromString(str: string, opt: InputTimeOnly): void;
605
+ static copyFromString(str: string): InputTimeOnly;
606
+ }
607
+ export declare class InputDateTime extends InputBase {
608
+ value: FTODate;
609
+ protected constructor(value: FTODate);
610
+ getLocalizationIndependentValue(): string;
611
+ }
612
+ export declare class InputStroke extends InputBase {
613
+ isVisible: boolean;
614
+ ignoreColor: boolean;
615
+ color: Color;
616
+ style: PenStyle;
617
+ width: number;
618
+ opacity: number;
619
+ protected constructor(isVisible: boolean, color: Color, style: PenStyle, width: number, ignoreColor?: boolean, opacity?: number);
620
+ toString(): string;
621
+ getLocalizationIndependentValue(): string;
622
+ static copyFromString(str: string): InputStroke;
623
+ updateFromString(str: string): void;
624
+ }
625
+ export declare class InputColor extends InputBase {
626
+ value: Color;
627
+ getLocalizationIndependentValue(): string;
628
+ protected constructor(value: Color);
629
+ }
630
+ export declare class InputWidth extends InputBase {
631
+ isVisible: boolean;
632
+ width: number;
633
+ hideIsVisibleCheckbox: boolean;
634
+ protected constructor(isVisible: boolean, width: number, hideIsVisibleCheckbox?: boolean);
635
+ toString(): string;
636
+ getLocalizationIndependentValue(): string;
637
+ static copyFromString(str: string): InputWidth;
638
+ updateFromString(str: string): void;
639
+ }
640
+ export declare class InputStyle extends InputBase {
641
+ isVisible: boolean;
642
+ style: PenStyle;
643
+ hideIsVisibleCheckbox: boolean;
644
+ protected constructor(isVisible: boolean, style: PenStyle, hideIsVisibleCheckbox?: boolean);
645
+ toString(): string;
646
+ getLocalizationIndependentValue(): string;
647
+ static copyFromString(str: string): InputStyle;
648
+ updateFromString(str: string): void;
649
+ }
650
+ export declare class InputColorStyle extends InputBase {
651
+ isVisible: boolean;
652
+ color: Color;
653
+ style: PenStyle;
654
+ opacity: number;
655
+ hideIsVisibleCheckbox: boolean;
656
+ protected constructor(isVisible: boolean, color: Color, style: PenStyle, opacity?: number, hideIsVisibleCheckbox?: boolean);
657
+ toString(): string;
658
+ getLocalizationIndependentValue(): string;
659
+ static copyFromString(str: string): InputColorStyle;
660
+ updateFromString(str: string): void;
661
+ }
662
+ export declare class InputColorWidth extends InputBase {
663
+ isVisible: boolean;
664
+ color: Color;
665
+ width: number;
666
+ opacity: number;
667
+ hideIsVisibleCheckbox: boolean;
668
+ protected constructor(isVisible: boolean, color: Color, width: number, opacity?: number, hideIsVisibleCheckbox?: boolean);
669
+ toString(): string;
670
+ getLocalizationIndependentValue(): string;
671
+ static copyFromString(str: string): InputColorWidth;
672
+ updateFromString(str: string): void;
673
+ }
674
+ export declare class InputStyleWidth extends InputBase {
675
+ isVisible: boolean;
676
+ style: PenStyle;
677
+ width: number;
678
+ hideIsVisibleCheckbox: boolean;
679
+ protected constructor(isVisible: boolean, style: PenStyle, width: number, hideIsVisibleCheckbox?: boolean);
680
+ toString(): string;
681
+ getLocalizationIndependentValue(): string;
682
+ static copyFromString(str: string): InputStyleWidth;
683
+ updateFromString(str: string): void;
684
+ }
685
+ export declare class InputFill extends InputBase {
686
+ bufferIndex1: number;
687
+ bufferIndex2: number;
688
+ color1: Color;
689
+ color2?: Color;
690
+ isEnabled: boolean;
691
+ protected constructor(bufferIndex1: number, bufferIndex2: number, color1: Color, color2?: Color, isEnabled?: boolean);
692
+ getLocalizationIndependentValue(): string;
693
+ SaveToStr(): string;
694
+ LoadFromStr(s: string): void;
695
+ clone(): InputFill;
696
+ static copyFromString(str: string): InputFill;
697
+ }
698
+ export declare class InputSessionsArray extends InputBase {
699
+ sessions: InputSession[];
700
+ allowAddingSessions: boolean;
701
+ protected constructor(sessions: InputSession[], allowAddingSessions?: boolean);
702
+ getSessions(): InputSession[];
703
+ toString(): string;
704
+ getLocalizationIndependentValue(): string;
705
+ static copyFromString(str: string): InputSessionsArray;
706
+ static updateFromString(str: string, opt: InputSessionsArray): void;
707
+ }
708
+ export declare class InputSession extends InputBase {
709
+ isEnabled: boolean;
710
+ name: string;
711
+ startTime: TimeValue;
712
+ endTime: TimeValue;
713
+ color: string;
714
+ ianaTimezone?: string;
715
+ protected constructor(isEnable: boolean, name: string, startTime: TimeValue, endTime: TimeValue, color: string, ianaTimezone?: string);
716
+ toString(): string;
717
+ getLocalizationIndependentValue(): string;
718
+ static copyFromString(str: string): InputSession;
719
+ static updateFromString(str: string, opt: InputSession): void;
720
+ }
721
+ export interface ICurrentSymbolAndTFInfoProcRec {
722
+ Symbol: () => string;
723
+ Timeframe: () => number;
724
+ Bid: () => number;
725
+ Ask: () => number;
726
+ LastPrice: () => number;
727
+ Digits: () => number;
728
+ Point: () => number;
729
+ Open: (index: number) => number;
730
+ Close: (index: number) => number;
731
+ High: (index: number) => number;
732
+ Low: (index: number) => number;
733
+ Volume: (index: number) => number;
734
+ GetVolumeRange: (idxStart: number, count: number) => number[];
735
+ Time: (index: number, timeZoneMode?: TimeZoneMode) => FTODate;
736
+ Bars: () => number;
737
+ GetPrice: (index: number, priceType: PriceType) => number;
738
+ GetPriceRange: (idxStart: number, count: number, priceType: PriceType) => number[];
739
+ GetHighestValue: (ValueType: PriceSeries, StartIndex: number, count: number) => number;
740
+ GetLowestValue: (ValueType: PriceSeries, StartIndex: number, count: number) => number;
741
+ }
742
+ export interface IOptionsProcRec {
743
+ /**
744
+ * Registers an input in the indicator settings using a pre-created value wrapper.
745
+ * Prefer typed Create*Input helpers when possible.
746
+ * @param inputName Display name of the input in the settings dialog.
747
+ * @param inputType Input type that defines the UI control and stored value format.
748
+ * @param optionPtr Typed value wrapper bound to this input.
749
+ * @param tab Settings tab where the input is shown. Defaults to OptionTab.INPUTS.
750
+ * @example
751
+ * const period = new InputNumber(14);
752
+ * api.CreateInput('Period', InputType.INTEGER, period);
753
+ */
754
+ CreateInput: (inputName: string, inputType: InputType, optionPtr: InputBase, tab?: InputTab) => void;
755
+ /**
756
+ * Sets the allowed numeric range for an integer or double input.
757
+ * @param inputName Name of a previously registered input.
758
+ * @param minValue Minimum allowed value.
759
+ * @param maxValue Maximum allowed value.
760
+ * @example
761
+ * api.SetInputRange('Period', 1, 500);
762
+ */
763
+ SetInputRange: (inputName: string, minValue: number, maxValue: number) => void;
764
+ /**
765
+ * Sets the number of decimal digits shown for a double input.
766
+ * @param inputName Name of a previously registered double input.
767
+ * @param digits Number of digits after the decimal point.
768
+ * @example
769
+ * api.SetInputDigits('Multiplier', 2);
770
+ */
771
+ SetInputDigits: (inputName: string, digits: number) => void;
772
+ /**
773
+ * Sets the increment step for an integer or double input spinner.
774
+ * @param inputName Name of a previously registered numeric input.
775
+ * @param step Value added or subtracted on each step change.
776
+ * @example
777
+ * api.SetInputStep('Period', 1);
778
+ */
779
+ SetInputStep: (inputName: string, step: number) => void;
780
+ /**
781
+ * Sets a tooltip shown when the user hovers over the input in settings.
782
+ * @param inputName Name of a previously registered input.
783
+ * @param tooltip Tooltip text.
784
+ * @example
785
+ * api.SetInputTooltip('Period', 'Number of bars used in the calculation.');
786
+ */
787
+ SetInputTooltip: (inputName: string, tooltip: string) => void;
788
+ /**
789
+ * Controls whether the input value is appended to the indicator name on the chart.
790
+ * By default, inputs are included in the name; pass false to hide a specific input.
791
+ * @param inputName Name of a previously registered input.
792
+ * @param showNameWithParams True to show the value in the indicator name, false to hide it.
793
+ * @example
794
+ * api.SetInputShowNameWithParams('Line Color', false);
795
+ */
796
+ SetInputShowNameWithParams: (inputName: string, showNameWithParams: boolean) => void;
797
+ /**
798
+ * Hides the visibility checkbox for style inputs that support show/hide toggling.
799
+ * @param inputName Name of a previously registered style input.
800
+ * @param hideIsVisibleCheckbox When true, the visibility checkbox is hidden. Defaults to true.
801
+ * @example
802
+ * api.SetInputHideIsVisibleCheckbox('Main Line');
803
+ */
804
+ SetInputHideIsVisibleCheckbox: (inputName: string, hideIsVisibleCheckbox?: boolean) => void;
805
+ /**
806
+ * Adds a selectable value to an enum input dropdown.
807
+ * Call once per enum item after registering the input.
808
+ * @param inputName Name of a previously registered enum input.
809
+ * @param value Text shown for this choice in the dropdown.
810
+ * @example
811
+ * api.AddEnumValue('Timeframe', 'H1');
812
+ */
813
+ AddEnumValue: (inputName: string, value: string) => void;
814
+ /**
815
+ * Adds a visual separator between groups of inputs in the settings dialog.
816
+ * @param separatorName Label shown for the separator.
817
+ * @param tab Settings tab where the separator is shown. Defaults to OptionTab.INPUTS.
818
+ * @example
819
+ * api.AddSeparator('Style', OptionTab.STYLE);
820
+ */
821
+ AddSeparator: (separatorName: string, tab?: InputTab) => void;
822
+ /**
823
+ * Creates and registers an integer input with optional range and step constraints.
824
+ * @param inputName Display name of the input.
825
+ * @param defaultValue Initial value.
826
+ * @param min Minimum allowed value.
827
+ * @param max Maximum allowed value.
828
+ * @param step Spinner increment step.
829
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
830
+ * @returns Typed wrapper bound to the registered input.
831
+ * @example
832
+ * this.Period = api.CreateIntegerInput('Period', 14, 1, 500, 1);
833
+ */
834
+ CreateIntegerInput: (inputName: string, defaultValue: number, min?: number, max?: number, step?: number, tab?: InputTab) => InputNumber;
835
+ /**
836
+ * Controls whether a registered input can be edited in the settings dialog.
837
+ * The stored value is unchanged; pass false to grey the control out.
838
+ * @param inputName Display name of the input.
839
+ * @param editable True to keep the control interactive, false to grey it out.
840
+ * @example
841
+ * api.SetInputEditable('Period', false);
842
+ */
843
+ SetInputEditable: (inputName: string, editable: boolean) => void;
844
+ /**
845
+ * Creates and registers a floating-point input with optional range, step, and precision.
846
+ * @param inputName Display name of the input.
847
+ * @param defaultValue Initial value.
848
+ * @param min Minimum allowed value.
849
+ * @param max Maximum allowed value.
850
+ * @param step Spinner increment step.
851
+ * @param digits Number of decimal digits displayed.
852
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
853
+ * @returns Typed wrapper bound to the registered input.
854
+ * @example
855
+ * this.Multiplier = api.CreateDoubleInput('Multiplier', 2.0, 0.1, 10, 0.1, 2);
856
+ */
857
+ CreateDoubleInput: (inputName: string, defaultValue: number, min?: number, max?: number, step?: number, digits?: number, tab?: InputTab) => InputNumber;
858
+ /**
859
+ * Creates and registers a color picker input.
860
+ * @param inputName Display name of the input.
861
+ * @param defaultValue Initial color value.
862
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
863
+ * @returns Typed wrapper bound to the registered input.
864
+ * @example
865
+ * this.LineColor = api.CreateColorInput('Line Color', '#ff0000');
866
+ */
867
+ CreateColorInput: (inputName: string, defaultValue: Color, tab?: InputTab) => InputColor;
868
+ /**
869
+ * Creates and registers a free-text string input.
870
+ * @param inputName Display name of the input.
871
+ * @param defaultValue Initial text value.
872
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
873
+ * @returns Typed wrapper bound to the registered input.
874
+ * @example
875
+ * this.Levels = api.CreateStringInput('Levels', '0; 50; 100');
876
+ */
877
+ CreateStringInput: (inputName: string, defaultValue: string, tab?: InputTab) => InputString;
878
+ /**
879
+ * Creates and registers a boolean checkbox input.
880
+ * @param inputName Display name of the input.
881
+ * @param defaultValue Initial checked state.
882
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
883
+ * @returns Typed wrapper bound to the registered input.
884
+ * @example
885
+ * this.ShowLabels = api.CreateBoolInput('Show Labels', true);
886
+ */
887
+ CreateBoolInput: (inputName: string, defaultValue: boolean, tab?: InputTab) => InputBool;
888
+ /**
889
+ * Creates and registers a dropdown enum input from a TypeScript enum object.
890
+ * Enum values are extracted automatically from {@link enumObj}; pass {@link members} only for a subset or custom order.
891
+ * Label order must match the order of enum values in the dropdown.
892
+ * @param inputName Display name of the input.
893
+ * @param defaultValue Initial semantic enum value.
894
+ * @param enumObj Runtime enum object (for example `PriceType`, not the type name).
895
+ * @param labels Localized display labels for dropdown items.
896
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
897
+ * @returns Typed wrapper bound to the registered input.
898
+ * @example
899
+ * enum InversionTrigger { Close, Wick, FullBody }
900
+ * this.TriggerType = api.CreateEnumInput(
901
+ * t('...inversionTrigger'),
902
+ * InversionTrigger.Close,
903
+ * InversionTrigger,
904
+ * [t('...close'), t('...wick'), t('...fullBody')]
905
+ * );
906
+ */
907
+ CreateEnumInput: {
908
+ <T extends number>(inputName: string, defaultValue: T, enumObj: Record<string, T | string>, labels: readonly string[], members: readonly T[], tab?: InputTab): InputEnum<T>;
909
+ <T extends number>(inputName: string, defaultValue: T, enumObj: Record<string, T | string>, labels: readonly string[], tab?: InputTab): InputEnum<T>;
910
+ };
911
+ /**
912
+ * Creates and registers a dropdown enum input by zero-based index when no TS enum object is used.
913
+ * `.value` and `.index` both equal the selected index (0 … labels.length - 1).
914
+ * @param inputName Display name of the input.
915
+ * @param defaultIndex Initial selected index.
916
+ * @param labels List of display labels for dropdown items.
917
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
918
+ * @returns Typed wrapper bound to the registered input.
919
+ * @example
920
+ * this.Method = api.CreateIndexedEnumInput('Method', 0, ['Simple', 'Exponential']);
921
+ */
922
+ CreateIndexedEnumInput: (inputName: string, defaultIndex: number, labels: readonly string[], tab?: InputTab) => InputEnum<number>;
923
+ /**
924
+ * Creates and registers a moving-average type selector with predefined MA choices.
925
+ * @param inputName Display name of the input. Uses a default label when omitted.
926
+ * @param defaultValue Initial MA type. Defaults to MovingAverageType.SMA.
927
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
928
+ * @returns Typed wrapper bound to the registered input.
929
+ * @example
930
+ * this.MAType = api.CreateMATypeInput();
931
+ */
932
+ CreateMATypeInput: (inputName?: string, defaultValue?: MovingAverageType, tab?: InputTab) => InputEnum<MovingAverageType>;
933
+ /**
934
+ * Creates and registers an apply-to-price selector with predefined price source choices.
935
+ * @param inputName Display name of the input. Uses a default label when omitted.
936
+ * @param defaultValue Initial price source. Defaults to PriceType.CLOSE.
937
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
938
+ * @returns Typed wrapper bound to the registered input.
939
+ * @example
940
+ * this.ApplyTo = api.CreateApplyToPriceInput();
941
+ */
942
+ CreateApplyToPriceInput: (inputName?: string, defaultValue?: PriceType, tab?: InputTab) => InputEnum<PriceType>;
943
+ /**
944
+ * Creates and registers a 5-level label font size selector (8–16 px).
945
+ * @param inputName Display name of the input.
946
+ * @param defaultValue Initial font size. Defaults to FontSize.Small.
947
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
948
+ */
949
+ CreateFontSizeInput: (inputName: string, defaultValue?: FontSize, tab?: InputTab) => InputEnum<FontSize>;
950
+ /**
951
+ * Creates and registers a timeframe dropdown (Current + all chart timeframes).
952
+ * `.value` returns the selected timeframe in minutes; index 0 (Current) resolves from the chart timeframe at runtime.
953
+ * Prefer this factory over manual registration.
954
+ * @param inputName Display name of the input.
955
+ * @param defaultToCurrent When true, the initial selection is Current (chart timeframe). Defaults to true.
956
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
957
+ * @returns Typed wrapper bound to the registered input.
958
+ * @example
959
+ * // Path A (recommended)
960
+ * this.Timeframe = api.CreateTimeframeInput('Input Name');
961
+ * const minutes = this.Timeframe.value;
962
+ * @example
963
+ * // Path B — manual wrapper + CreateInput (framework binds chart TF and fills dropdown labels)
964
+ * public Timeframe = new InputTimeframe();
965
+ * api.CreateInput('Input Name', inputType.TIMEFRAME, this.Timeframe);
966
+ */
967
+ CreateTimeframeInput: (inputName: string, defaultToCurrent?: boolean, tab?: InputTab) => InputTimeframe;
968
+ /**
969
+ * Creates and registers a line style input with visibility, color, pen style, and width.
970
+ * @param inputName Display name of the input.
971
+ * @param isVisible Initial visibility state.
972
+ * @param color Initial line color.
973
+ * @param style Initial pen style.
974
+ * @param width Initial line width in pixels.
975
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
976
+ * @returns Typed wrapper bound to the registered input.
977
+ * @example
978
+ * this.MainLine = api.CreateStrokeInput('Main Line', true, '#0000ff', PenStyle.SOLID, 1);
979
+ */
980
+ CreateStrokeInput: (inputName: string, isVisible: boolean, color: Color, style: PenStyle, width: number, tab?: InputTab) => InputStroke;
981
+ /**
982
+ * Creates and registers a line width input with an optional visibility toggle.
983
+ * @param inputName Display name of the input.
984
+ * @param isVisible Initial visibility state.
985
+ * @param width Initial line width in pixels.
986
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
987
+ * @returns Typed wrapper bound to the registered input.
988
+ * @example
989
+ * this.LineWidth = api.CreateWidthInput('Line Width', true, 2);
990
+ */
991
+ CreateWidthInput: (inputName: string, isVisible: boolean, width: number, tab?: InputTab) => InputWidth;
992
+ /**
993
+ * Creates and registers a pen style input with an optional visibility toggle.
994
+ * @param inputName Display name of the input.
995
+ * @param isVisible Initial visibility state.
996
+ * @param style Initial pen style.
997
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
998
+ * @returns Typed wrapper bound to the registered input.
999
+ * @example
1000
+ * this.LineStyle = api.CreateStyleInput('Line Style', true, PenStyle.DASH);
1001
+ */
1002
+ CreateStyleInput: (inputName: string, isVisible: boolean, style: PenStyle, tab?: InputTab) => InputStyle;
1003
+ /**
1004
+ * Creates and registers a combined color and pen style input with an optional visibility toggle.
1005
+ * @param inputName Display name of the input.
1006
+ * @param isVisible Initial visibility state.
1007
+ * @param color Initial color.
1008
+ * @param style Initial pen style.
1009
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
1010
+ * @returns Typed wrapper bound to the registered input.
1011
+ * @example
1012
+ * this.SignalLine = api.CreateColorStyleInput('Signal Line', true, '#00ff00', PenStyle.DOT);
1013
+ */
1014
+ CreateColorStyleInput: (inputName: string, isVisible: boolean, color: Color, style: PenStyle, tab?: InputTab) => InputColorStyle;
1015
+ /**
1016
+ * Creates and registers a combined color and width input with an optional visibility toggle.
1017
+ * @param inputName Display name of the input.
1018
+ * @param isVisible Initial visibility state.
1019
+ * @param color Initial color.
1020
+ * @param width Initial line width in pixels.
1021
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
1022
+ * @returns Typed wrapper bound to the registered input.
1023
+ * @example
1024
+ * this.UpperBand = api.CreateColorWidthInput('Upper Band', true, '#ff0000', 1);
1025
+ */
1026
+ CreateColorWidthInput: (inputName: string, isVisible: boolean, color: Color, width: number, tab?: InputTab) => InputColorWidth;
1027
+ /**
1028
+ * Creates and registers a combined pen style and width input with an optional visibility toggle.
1029
+ * @param inputName Display name of the input.
1030
+ * @param isVisible Initial visibility state.
1031
+ * @param style Initial pen style.
1032
+ * @param width Initial line width in pixels.
1033
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
1034
+ * @returns Typed wrapper bound to the registered input.
1035
+ * @example
1036
+ * this.LowerBand = api.CreateStyleWidthInput('Lower Band', true, PenStyle.DASH, 2);
1037
+ */
1038
+ CreateStyleWidthInput: (inputName: string, isVisible: boolean, style: PenStyle, width: number, tab?: InputTab) => InputStyleWidth;
1039
+ /**
1040
+ * Creates and registers a date-and-time input.
1041
+ * @param inputName Display name of the input.
1042
+ * @param defaultValue Initial date/time value.
1043
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
1044
+ * @returns Typed wrapper bound to the registered input.
1045
+ * @example
1046
+ * this.StartDate = api.CreateDateTimeInput('Start Date', FTODate.now());
1047
+ */
1048
+ CreateDateTimeInput: (inputName: string, defaultValue: FTODate, tab?: InputTab) => InputDateTime;
1049
+ /**
1050
+ * Creates and registers a date-only input; the time portion is ignored.
1051
+ * @param inputName Display name of the input.
1052
+ * @param defaultValue Initial date value.
1053
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
1054
+ * @returns Typed wrapper bound to the registered input.
1055
+ * @example
1056
+ * this.ExpiryDate = api.CreateDateOnlyInput('Expiry Date', FTODate.now());
1057
+ */
1058
+ CreateDateOnlyInput: (inputName: string, defaultValue: FTODate, tab?: InputTab) => InputDateOnly;
1059
+ /**
1060
+ * Creates and registers a time-only input; the date portion is ignored.
1061
+ * @param inputName Display name of the input.
1062
+ * @param defaultValue Initial time value.
1063
+ * @param tab Settings tab. Defaults to OptionTab.INPUTS.
1064
+ * @returns Typed wrapper bound to the registered input.
1065
+ * @example
1066
+ * this.SessionStart = api.CreateTimeOnlyInput('Session Start', { hours: 9, minutes: 30 });
1067
+ */
1068
+ CreateTimeOnlyInput: (inputName: string, defaultValue: TimeValue, tab?: InputTab) => InputTimeOnly;
1069
+ /**
1070
+ * Creates and registers a trading session input with time range, color, and optional timezone.
1071
+ * @param inputName Display name of the input.
1072
+ * @param isEnabled Initial enabled state.
1073
+ * @param sessionName Label shown for the session.
1074
+ * @param startTime Session start time.
1075
+ * @param endTime Session end time.
1076
+ * @param color Highlight color for the session on the chart.
1077
+ * @param ianaTimezone IANA timezone identifier. Uses the chart timezone when omitted.
1078
+ * @param tab Settings tab. Defaults to OptionTab.SESSIONS.
1079
+ * @returns Typed wrapper bound to the registered input.
1080
+ * @example
1081
+ * this.LondonSession = api.CreateSessionInput('London', true, 'London', { hours: 8, minutes: 0 }, { hours: 16, minutes: 0 }, '#3366ff');
1082
+ */
1083
+ CreateSessionInput: (inputName: string, isEnabled: boolean, sessionName: string, startTime: TimeValue, endTime: TimeValue, color: Color, ianaTimezone?: string, tab?: InputTab) => InputSession;
1084
+ /**
1085
+ * Builds an unregistered InputSession for seeding CreateSessionsArrayInput.
1086
+ * Does not add a settings row. Use CreateSessionInput to register a standalone session.
1087
+ * @param isEnabled Initial enabled state.
1088
+ * @param name Label shown for the session.
1089
+ * @param startTime Session start time.
1090
+ * @param endTime Session end time.
1091
+ * @param color Highlight color for the session on the chart.
1092
+ * @param ianaTimezone IANA timezone identifier. Defaults to America/New_York when omitted.
1093
+ * @returns Unregistered InputSession suitable as an array default.
1094
+ * @example
1095
+ * this.CustomSessions = api.CreateSessionsArrayInput('Custom Sessions', [
1096
+ * api.CreateSessionValue(true, 'London', TimeValue['08:00'], TimeValue['16:00'], '#3366ff', 'Europe/London')
1097
+ * ], false);
1098
+ */
1099
+ CreateSessionValue: (isEnabled: boolean, name: string, startTime: TimeValue, endTime: TimeValue, color: Color, ianaTimezone?: string) => InputSession;
1100
+ /**
1101
+ * Creates and registers a list of trading sessions that can be edited in settings.
1102
+ * @param inputName Display name of the input.
1103
+ * @param defaultValue Initial list of session inputs from CreateSessionValue. Do not pass sessions already registered via CreateSessionInput.
1104
+ * @param allowAddingSessions Whether the user can add new sessions in the UI. Defaults to true.
1105
+ * @param tab Settings tab. Defaults to OptionTab.SESSIONS.
1106
+ * @returns Typed wrapper bound to the registered input.
1107
+ * @example
1108
+ * this.Sessions = api.CreateSessionsArrayInput('Custom Sessions', [
1109
+ * api.CreateSessionValue(true, 'London', TimeValue['08:00'], TimeValue['16:00'], '#3366ff', 'Europe/London')
1110
+ * ], false);
1111
+ */
1112
+ CreateSessionsArrayInput: (inputName: string, defaultValue: InputSession[], allowAddingSessions?: boolean, tab?: InputTab) => InputSessionsArray;
1113
+ /**
1114
+ * Creates and registers a fill-between-buffers input for shading the area between two indicator buffers.
1115
+ * @param inputName Display name of the input.
1116
+ * @param bufferIndex1 Index of the first buffer.
1117
+ * @param bufferIndex2 Index of the second buffer.
1118
+ * @param color1 Fill color for the upper side of the band.
1119
+ * @param color2 Fill color for the lower side. Uses color1 when omitted.
1120
+ * @param isEnabled Initial enabled state. Defaults to true.
1121
+ * @param tab Settings tab. Defaults to OptionTab.STYLE.
1122
+ * @returns Typed wrapper bound to the registered input.
1123
+ * @example
1124
+ * this.BandFill = api.CreateFillInput('Band Fill', 0, 1, '#00ff0033', '#ff000033');
1125
+ */
1126
+ CreateFillInput: (inputName: string, bufferIndex1: number, bufferIndex2: number, color1: Color, color2?: Color, isEnabled?: boolean, tab?: InputTab) => InputFill;
1127
+ }
1128
+ export interface ITechnicalIndicatorsProcRec {
1129
+ /**
1130
+ * Calculates a moving average for the current symbol and timeframe.
1131
+ * @param index Bar index to calculate from, where 0 is the current bar.
1132
+ * @param maShift Moving average shift in bars.
1133
+ * @param period Moving average period.
1134
+ * @param maType Moving average calculation method.
1135
+ * @param applyToPrice Price type used as the calculation source.
1136
+ * @param prev Previous moving average value, used by recursive MA methods when available.
1137
+ * @returns Moving average value.
1138
+ */
1139
+ GetMA: (index: number, maShift: number, period: number, maType: MovingAverageType, applyToPrice: PriceType, prev?: number) => number;
1140
+ /**
1141
+ * Calculates Linear Regression Channel values for the current symbol and timeframe.
1142
+ * @param shift Bar index to start the calculation from.
1143
+ * @param period Number of bars included in the regression calculation.
1144
+ * @param applyToPrice Price type used as the calculation source.
1145
+ * @returns Regression line start/end values, channel height, and top/bottom boundaries.
1146
+ */
1147
+ LRCChannelParams: (shift: number, period: number, applyToPrice: PriceType) => {
1148
+ StartValue: number;
1149
+ EndValue: number;
1150
+ Height: number;
1151
+ Top: number;
1152
+ Bottom: number;
1153
+ };
1154
+ /**
1155
+ * Calculates Accelerator Oscillator (AC) for the specified symbol and timeframe.
1156
+ * @param symbol Symbol name.
1157
+ * @param timeframe Timeframe in minutes.
1158
+ * @param index Bar index to calculate from, where 0 is the current bar.
1159
+ * @param periodFast Fast moving average period.
1160
+ * @param periodSlow Slow moving average period.
1161
+ * @param periodAC Accelerator smoothing period.
1162
+ * @param maType Moving average calculation method.
1163
+ * @param applyToPrice Price type used as the calculation source.
1164
+ * @param bufferIndex Visible buffer index: 0 = up histogram, 1 = down histogram.
1165
+ * @returns Accelerator Oscillator buffer value.
1166
+ */
1167
+ iAC: (symbol: string, timeframe: number, index: number, periodFast: number, periodSlow: number, periodAC: number, maType: MovingAverageType, applyToPrice: PriceType, bufferIndex: 0 | 1) => number;
1168
+ /**
1169
+ * Calculates Average Directional Index (ADX) for the specified symbol and timeframe.
1170
+ * @param symbol Symbol name.
1171
+ * @param timeframe Timeframe in minutes.
1172
+ * @param index Bar index to calculate from, where 0 is the current bar.
1173
+ * @param period ADX period.
1174
+ * @param applyToPrice Price type used as the calculation source.
1175
+ * @param bufferIndex Visible buffer index: 0 = ADX line, 1 = +DI line, 2 = -DI line.
1176
+ * @returns ADX indicator buffer value.
1177
+ */
1178
+ iADX: (symbol: string, timeframe: number, index: number, period: number, applyToPrice: PriceType, bufferIndex: 0 | 1 | 2) => number;
1179
+ /**
1180
+ * Calculates Awesome Oscillator (AO) for the specified symbol and timeframe.
1181
+ * @param symbol Symbol name.
1182
+ * @param timeframe Timeframe in minutes.
1183
+ * @param index Bar index to calculate from, where 0 is the current bar.
1184
+ * @param periodFast Fast moving average period.
1185
+ * @param periodSlow Slow moving average period.
1186
+ * @param maType Moving average calculation method.
1187
+ * @param applyToPrice Price type used as the calculation source.
1188
+ * @param bufferIndex Visible buffer index: 0 = up histogram, 1 = down histogram.
1189
+ * @returns Awesome Oscillator buffer value.
1190
+ */
1191
+ iAO: (symbol: string, timeframe: number, index: number, periodFast: number, periodSlow: number, maType: MovingAverageType, applyToPrice: PriceType, bufferIndex: 0 | 1) => number;
1192
+ /**
1193
+ * Calculates Average True Range (ATR) for the specified symbol and timeframe.
1194
+ * @param symbol Symbol name.
1195
+ * @param timeframe Timeframe in minutes.
1196
+ * @param index Bar index (0 = current bar).
1197
+ * @param period ATR period.
1198
+ * @param applyToPrice Price type to use.
1199
+ * @returns ATR value.
1200
+ */
1201
+ iATR: (symbol: string, timeframe: number, index: number, period: number, applyToPrice: PriceType) => number;
1202
+ /**
1203
+ * Calculates Bollinger Bands for the specified symbol and timeframe.
1204
+ * @param symbol Symbol name.
1205
+ * @param timeframe Timeframe in minutes.
1206
+ * @param index Bar index to calculate from, where 0 is the current bar.
1207
+ * @param period Moving average period.
1208
+ * @param deviation Standard deviation multiplier.
1209
+ * @param bandsShift Visual shift of the bands in bars.
1210
+ * @param maType Moving average calculation method.
1211
+ * @param stdDevType Standard deviation source: 0 = source price, 1 = moving average.
1212
+ * @param applyToPrice Price type used as the calculation source.
1213
+ * @param bufferIndex Visible buffer index: 0 = upper band, 1 = moving average line, 2 = lower band.
1214
+ * @returns Bollinger Bands buffer value.
1215
+ */
1216
+ iBands: (symbol: string, timeframe: number, index: number, period: number, deviation: number, bandsShift: number, maType: MovingAverageType, stdDevType: 0 | 1, applyToPrice: PriceType, bufferIndex: 0 | 1 | 2) => number;
1217
+ /**
1218
+ * Calculates Bears Power for the specified symbol and timeframe.
1219
+ * @param symbol Symbol name.
1220
+ * @param timeframe Timeframe in minutes.
1221
+ * @param index Bar index to calculate from, where 0 is the current bar.
1222
+ * @param period Bears Power EMA period.
1223
+ * @returns Bears Power value.
1224
+ */
1225
+ iBearsPower: (symbol: string, timeframe: number, index: number, period: number) => number;
1226
+ /**
1227
+ * Calculates Bulls Power for the specified symbol and timeframe.
1228
+ * @param symbol Symbol name.
1229
+ * @param timeframe Timeframe in minutes.
1230
+ * @param index Bar index to calculate from, where 0 is the current bar.
1231
+ * @param period Bulls Power EMA period.
1232
+ * @returns Bulls Power value.
1233
+ */
1234
+ iBullsPower: (symbol: string, timeframe: number, index: number, period: number) => number;
1235
+ /**
1236
+ * Calculates Commodity Channel Index (CCI) for the specified symbol and timeframe.
1237
+ * @param symbol Symbol name.
1238
+ * @param timeframe Timeframe in minutes.
1239
+ * @param index Bar index to calculate from, where 0 is the current bar.
1240
+ * @param period CCI period.
1241
+ * @returns CCI value.
1242
+ */
1243
+ iCCI: (symbol: string, timeframe: number, index: number, period: number) => number;
1244
+ /**
1245
+ * Returns a value from a custom indicator created for the specified symbol and timeframe.
1246
+ * @param symbol Symbol name.
1247
+ * @param timeframe Timeframe in minutes.
1248
+ * @param index Bar index to read from, where 0 is the current bar.
1249
+ * @param name Custom indicator file name.
1250
+ * @param params Serialized custom indicator parameters.
1251
+ * @param bufferIndex Custom indicator buffer index to read.
1252
+ * @returns Custom indicator buffer value.
1253
+ */
1254
+ iCustom: (symbol: string, timeframe: number, index: number, name: string, params: string, bufferIndex: number) => number;
1255
+ /**
1256
+ * Calculates Envelopes for the specified symbol and timeframe.
1257
+ * @param symbol Symbol name.
1258
+ * @param timeframe Timeframe in minutes.
1259
+ * @param index Bar index to calculate from, where 0 is the current bar.
1260
+ * @param period Moving average period.
1261
+ * @param shift Visual shift of the envelopes in bars.
1262
+ * @param deviation Envelope deviation in percent.
1263
+ * @param maType Moving average calculation method.
1264
+ * @param applyToPrice Price type used as the calculation source.
1265
+ * @param bufferIndex Visible buffer index: 0 = upper envelope, 1 = lower envelope, 2 = moving average line.
1266
+ * @returns Envelopes buffer value.
1267
+ */
1268
+ iEnvelopes: (symbol: string, timeframe: number, index: number, period: number, shift: number, deviation: number, maType: MovingAverageType, applyToPrice: PriceType, bufferIndex: 0 | 1 | 2) => number;
1269
+ /**
1270
+ * Calculates Fractals for the specified symbol and timeframe.
1271
+ * @param symbol Symbol name.
1272
+ * @param timeframe Timeframe in minutes.
1273
+ * @param index Bar index to calculate from, where 0 is the current bar.
1274
+ * @param period Fractal period.
1275
+ * @param bufferIndex Visible buffer index: 0 = upper fractal, 1 = lower fractal.
1276
+ * @returns Fractals buffer value.
1277
+ */
1278
+ iFractals: (symbol: string, timeframe: number, index: number, period: number, bufferIndex: 0 | 1) => number;
1279
+ /**
1280
+ * Calculates Ichimoku values for the specified symbol and timeframe.
1281
+ * @param symbol Symbol name.
1282
+ * @param timeframe Timeframe in minutes.
1283
+ * @param index Bar index to calculate from, where 0 is the current bar.
1284
+ * @param tenkanSenPeriod Tenkan-sen period.
1285
+ * @param kijunSenPeriod Kijun-sen period.
1286
+ * @param senkouSpanPeriod Senkou Span B period.
1287
+ * @param chinkouSpanPeriod Chikou Span shift period.
1288
+ * @param bufferIndex Visible buffer index: 0 = Tenkan-sen, 1 = Kijun-sen, 2 = Chikou Span, 3 = Senkou Span A, 4 = Senkou Span B.
1289
+ * @returns Ichimoku buffer value.
1290
+ */
1291
+ iIchimoku: (symbol: string, timeframe: number, index: number, tenkanSenPeriod: number, kijunSenPeriod: number, senkouSpanPeriod: number, chinkouSpanPeriod: number, bufferIndex: 0 | 1 | 2 | 3 | 4) => number;
1292
+ /**
1293
+ * Calculates Moving Average for the specified symbol and timeframe.
1294
+ * @param symbol Symbol name.
1295
+ * @param timeframe Timeframe in minutes.
1296
+ * @param period Moving average period.
1297
+ * @param maShift Moving average shift in bars.
1298
+ * @param maType Moving average calculation method.
1299
+ * @param applyToPrice Price type used as the calculation source.
1300
+ * @param index Bar index to calculate from, where 0 is the current bar.
1301
+ * @returns Moving Average value.
1302
+ */
1303
+ iMA: (symbol: string, timeframe: number, period: number, maShift: number, maType: MovingAverageType, applyToPrice: PriceType, index: number) => number;
1304
+ /**
1305
+ * Calculates Moving Average Convergence/Divergence (MACD) for the specified symbol and timeframe.
1306
+ * @param symbol Symbol name.
1307
+ * @param timeframe Timeframe in minutes.
1308
+ * @param index Bar index to calculate from, where 0 is the current bar.
1309
+ * @param fastEmaPeriod Fast EMA period.
1310
+ * @param slowEmaPeriod Slow EMA period.
1311
+ * @param signalPeriod Signal line SMA period.
1312
+ * @param applyToPrice Price type used as the calculation source.
1313
+ * @param bufferIndex Visible buffer index: 0 = histogram, 1 = MACD line, 2 = signal line.
1314
+ * @returns MACD buffer value.
1315
+ */
1316
+ iMACD: (symbol: string, timeframe: number, index: number, fastEmaPeriod: number, slowEmaPeriod: number, signalPeriod: number, applyToPrice: PriceType, bufferIndex: 0 | 1 | 2) => number;
1317
+ /**
1318
+ * Calculates Momentum for the specified symbol and timeframe.
1319
+ * @param symbol Symbol name.
1320
+ * @param timeframe Timeframe in minutes.
1321
+ * @param index Bar index to calculate from, where 0 is the current bar.
1322
+ * @param period Momentum period.
1323
+ * @param applyToPrice Price type used as the calculation source.
1324
+ * @returns Momentum value.
1325
+ */
1326
+ iMomentum: (symbol: string, timeframe: number, index: number, period: number, applyToPrice: PriceType) => number;
1327
+ /**
1328
+ * Calculates Relative Strength Index (RSI) for the specified symbol and timeframe.
1329
+ * @param symbol Symbol name.
1330
+ * @param timeframe Timeframe in minutes.
1331
+ * @param index Bar index to calculate from, where 0 is the current bar.
1332
+ * @param period RSI period.
1333
+ * @param applyToPrice Price type used as the calculation source.
1334
+ * @param bufferIndex Visible buffer index: 0 = RSI line, 1 = RSI moving average line.
1335
+ * @returns RSI buffer value.
1336
+ */
1337
+ iRSI: (symbol: string, timeframe: number, index: number, period: number, applyToPrice: PriceType, bufferIndex: 0 | 1) => number;
1338
+ /**
1339
+ * Calculates Parabolic SAR for the specified symbol and timeframe.
1340
+ * @param symbol Symbol name.
1341
+ * @param timeframe Timeframe in minutes.
1342
+ * @param index Bar index to calculate from, where 0 is the current bar.
1343
+ * @param start Initial acceleration factor.
1344
+ * @param step Acceleration factor step.
1345
+ * @param maximum Maximum acceleration factor.
1346
+ * @returns Parabolic SAR value.
1347
+ */
1348
+ iSAR: (symbol: string, timeframe: number, index: number, start: number, step: number, maximum: number) => number;
1349
+ /**
1350
+ * Calculates Stochastic Oscillator for the specified symbol and timeframe.
1351
+ * @param symbol Symbol name.
1352
+ * @param timeframe Timeframe in minutes.
1353
+ * @param index Bar index to calculate from, where 0 is the current bar.
1354
+ * @param kPeriod %K period.
1355
+ * @param dPeriod %D period.
1356
+ * @param slowing %K slowing period.
1357
+ * @param priceMode Price calculation mode: 0 = Low/High, 1 = Close/Close.
1358
+ * @param bufferIndex Visible buffer index: 0 = %K line, 1 = %D line.
1359
+ * @returns Stochastic buffer value.
1360
+ */
1361
+ iStochastic: (symbol: string, timeframe: number, index: number, kPeriod: number, dPeriod: number, slowing: number, priceMode: 0 | 1, bufferIndex: 0 | 1) => number;
1362
+ /**
1363
+ * Calculates Williams Percent Range (WPR) for the specified symbol and timeframe.
1364
+ * @param symbol Symbol name.
1365
+ * @param timeframe Timeframe in minutes.
1366
+ * @param index Bar index to calculate from, where 0 is the current bar.
1367
+ * @param period WPR period.
1368
+ * @param applyToPrice Price type used as the calculation source.
1369
+ * @returns WPR value.
1370
+ */
1371
+ iWPR: (symbol: string, timeframe: number, index: number, period: number, applyToPrice: PriceType) => number;
1372
+ /**
1373
+ * Calculates ZigZag for the specified symbol and timeframe.
1374
+ * @param symbol Symbol name.
1375
+ * @param timeframe Timeframe in minutes.
1376
+ * @param index Bar index to calculate from, where 0 is the current bar.
1377
+ * @param period ZigZag period.
1378
+ * @param deviation ZigZag deviation.
1379
+ * @param backstep ZigZag backstep.
1380
+ * @param maxBars The maximum number of bars to look back when calculating the ZigZag.
1381
+ * @returns ZigZag value.
1382
+ */
1383
+ iZigZag: (symbol: string, timeframe: number, index: number, period: number, deviation: number, backstep: number, maxBars: number) => number;
1384
+ }
1385
+ export interface ITimeseriesProcRec {
1386
+ iOpen: (symbol: string, timeframe: number, index: number) => number;
1387
+ iClose: (symbol: string, timeframe: number, index: number) => number;
1388
+ iHigh: (symbol: string, timeframe: number, index: number) => number;
1389
+ iLow: (symbol: string, timeframe: number, index: number) => number;
1390
+ iVolume: (symbol: string, timeframe: number, index: number) => number;
1391
+ iTime: (symbol: string, timeframe: number, index: number, timeZoneMode?: TimeZoneMode) => FTODate;
1392
+ iBars: (symbol: string, timeframe: number) => number;
1393
+ iBarShift: (symbol: string, timeframe: number, time: FTODate, exact?: boolean) => number;
1394
+ iHighest: (symbol: string, timeframe: number, type: PriceSeries, count: number, index: number) => number;
1395
+ iLowest: (symbol: string, timeframe: number, type: PriceSeries, count: number, index: number) => number;
1396
+ iPivotHigh(symbol: string, timeframe: number, leftLength: number, rightLength: number, index: number): boolean;
1397
+ iPivotHigh(symbol: string, timeframe: number, type: PriceSeries, leftLength: number, rightLength: number, index: number): boolean;
1398
+ iPivotLow(symbol: string, timeframe: number, leftLength: number, rightLength: number, index: number): boolean;
1399
+ iPivotLow(symbol: string, timeframe: number, type: PriceSeries, leftLength: number, rightLength: number, index: number): boolean;
1400
+ }
1401
+ export interface IAccountInfoProcRec {
1402
+ GetAccountBalance: () => number;
1403
+ GetAccountEquity: () => number;
1404
+ GetAccountMargin: () => number;
1405
+ GetAvailableMargin: () => number;
1406
+ GetLeverageRatio: () => number;
1407
+ GetCurrentProfit: () => number;
1408
+ GetAccountNumberProperty: (propertyId: number) => number;
1409
+ GetAccountStringProperty: (propertyId: number) => string;
1410
+ GetBrokerName: () => string;
1411
+ GetAccountCurrency: () => string;
1412
+ GetAvailableMarginAfterOrder: (symbol: string, tradeType: number, volume: number) => number;
1413
+ GetAccountName: () => string;
1414
+ }
1415
+ export interface IErrorHandlingProcRec {
1416
+ GetLastError: () => string;
1417
+ SetLastError: (error: string) => void;
1418
+ ResetLastError: () => void;
1419
+ }
1420
+ export interface IDataInfoProcRec {
1421
+ GetSymbolInfo: (symbolName: string) => SymbolInfo | null;
1422
+ }
1423
+ export interface ITestingProcRec {
1424
+ IsTestingRunning: () => boolean;
1425
+ PauseTesting: () => void;
1426
+ }
1427
+ export interface Tick {
1428
+ time: FTODate;
1429
+ bid: number;
1430
+ ask: number;
1431
+ last?: number;
1432
+ volume: number;
1433
+ }
1434
+ export interface ICommonFunctionsProcRec {
1435
+ Alert: (...args: any[]) => void;
1436
+ Print: (...args: any[]) => void;
1437
+ InfoToast: (title: string, message: string) => void;
1438
+ PeriodSeconds: (period: Timeframe) => number;
1439
+ TesterStatistics: (statistic_id: TestStatistic) => number;
1440
+ }
1441
+ export interface IMarketInfoProcRec {
1442
+ GetMarketInformation(symbol: string, type: MarketInfoProperty, orderType?: OrderType): number;
1443
+ GetAvailableSymbolCount(): number;
1444
+ GetSymbolName(index: number): string;
1445
+ SelectTradingSymbol(name: string, select: boolean): boolean;
1446
+ GetSymbolNumberProperty(name: string, prop_id: SymbolNumberProperty, orderType?: OrderType): number;
1447
+ GetSymbolStringProperty(name: string, prop_id: SymbolStringProperty): string;
1448
+ GetSymbolTickInfo(symbol: string): Tick;
1449
+ GetLastProcessedTickTime(symbol: string): FTODate;
1450
+ }
1451
+ export declare enum ObjectProperty {
1452
+ TIME1 = 0,
1453
+ PRICE1 = 1,
1454
+ FILL_COLOR = 2,
1455
+ COLOR = 3,
1456
+ STYLE = 4,
1457
+ WIDTH = 5,
1458
+ TIME2 = 6,
1459
+ PRICE2 = 7,
1460
+ TIME3 = 8,
1461
+ PRICE3 = 9,
1462
+ LEVEL_VALUE = 10,
1463
+ LEVEL_COLOR = 11,
1464
+ LEVEL_STYLE = 12,
1465
+ LEVEL_WIDTH = 13,
1466
+ FONT_NAME = 14,
1467
+ FONT_SIZE = 15,
1468
+ NAME = 16,
1469
+ FILL_INSIDE = 17,
1470
+ FIBO_LEVELS = 18,
1471
+ SCREEN_COORDS = 19,
1472
+ TEXT = 20,
1473
+ HALIGNMENT = 21,
1474
+ YDISTANCE = 22,
1475
+ VALIGNMENT = 23,
1476
+ XDISTANCE = 24,
1477
+ FIBO_LEVELN = 25,
1478
+ BORDER = 26,
1479
+ TEXT_PARAMS = 27,
1480
+ MIDDLE_LINE = 28,
1481
+ EXTEND_RIGHT = 29,
1482
+ ANCHOR_POINT = 30,
1483
+ BACK = 31,
1484
+ XSIZE = 32,
1485
+ YSIZE = 33,
1486
+ OPACITY = 34,
1487
+ ANGLE = 35,
1488
+ SHOW_PRICE_LABEL = 36,
1489
+ SNAP_TO_BARTIME = 37,
1490
+ LOCKED = 38,
1491
+ TEXT_AUTOFIT = 39,
1492
+ ARROW_CODE = 40,
1493
+ TEXT_COLOR = 41,
1494
+ TIME = 42,
1495
+ PRICE = 43
1496
+ }
1497
+ export type GetObjectPropertyArgs = [chartId: number, name: string, propId: ObjectProperty, isStatic?: boolean] | [chartId: number, name: string, propId: ObjectProperty, propModifier: number, isStatic?: boolean];
1498
+ export type SetObjectPropertyArgs = [chartId: number, name: string, propId: ObjectProperty, value: any, isStatic?: boolean] | [chartId: number, name: string, propId: ObjectProperty, propModifier: number, value: any, isStatic?: boolean];
1499
+ export interface IObjectsProcRec {
1500
+ GetChartId: () => number;
1501
+ GetCurrentSubwindow: () => number;
1502
+ CreateObject: (chartId: number, name: string, objType: ObjectType, subwindow: number, time1?: FTODate, price1?: number, time2?: FTODate, price2?: number, time3?: FTODate, price3?: number, isStatic?: boolean) => boolean;
1503
+ DeleteObject: (chartId: number, name: string, isStatic?: boolean) => void;
1504
+ DeleteAllObjects: (chartId: number, subwindow: number, objType: ObjectType, isStatic?: boolean) => void;
1505
+ DeleteObjectsByPrefix: (chartId: number, prefix: string, subwindow?: number, isStatic?: boolean) => void;
1506
+ DoesObjectExist: (chartId: number, name: string, isStatic?: boolean) => boolean;
1507
+ FindObject: (chartId: number, name: string) => number;
1508
+ GetObjectCount: (chartId: number, subwindow?: number, objType?: ObjectType, isStatic?: boolean) => number;
1509
+ GetObjectName: (chartId: number, pos: number, subwindow?: number, objType?: ObjectType, isStatic?: boolean) => string;
1510
+ GetFiboLevelDescription: (chartId: number, name: string, index: number) => string;
1511
+ GetObjectDescription: (chartId: number, name: string, isStatic?: boolean) => string;
1512
+ GetObjectNumberProperty: (chartId: number, name: string, propId: ObjectProperty, isStatic?: boolean) => number;
1513
+ GetObjectProperty: (...args: GetObjectPropertyArgs) => number | string;
1514
+ GetObjectStringProperty: (chartId: number, name: string, propId: ObjectProperty, isStatic?: boolean) => string;
1515
+ GetObjectText: (chartId: number, name: string, isStatic?: boolean) => string;
1516
+ GetObjectType: (chartId: number, name: string, isStatic?: boolean) => ObjectType;
1517
+ MoveObjectPoint: (chartId: number, name: string, pointIndex: number, time: FTODate | number, price: number, isStatic?: boolean) => boolean;
1518
+ SetFiboLevelDescription: (chartId: number, name: string, index: number, text: string) => boolean;
1519
+ SetObjectProperty: (...args: SetObjectPropertyArgs) => boolean;
1520
+ SetObjectText: (chartId: number, name: string, text: string, fontSize?: number, fontName?: string, color?: Color, isStatic?: boolean) => boolean;
1521
+ AddActionButton: (chartId: number, name: string, template: ActionButtonTemplate, isStatic?: boolean) => boolean;
1522
+ SetActionButtonState: (chartId: number, toolName: string, buttonName: string, stateIndex: number, isStatic?: boolean) => boolean;
1523
+ MeasureText: (text: string) => {
1524
+ width: number;
1525
+ height: number;
1526
+ };
1527
+ }
1528
+ export type AnyFn = (...args: any[]) => any;
1529
+ export type WithChartError<T> = {
1530
+ [K in keyof T]: T[K] extends AnyFn ? (...a: Parameters<T[K]>) => ReturnType<T[K]> | null : T[K];
1531
+ };
1532
+ export type IObjectsProcRecSafe = WithChartError<IObjectsProcRec>;
1533
+ export interface ISharedProcRec extends ITechnicalIndicatorsProcRec, ITimeseriesProcRec, IDateTimeProcRec, IOptionsProcRec, ICurrentSymbolAndTFInfoProcRec, IChartInterfaceProcRec, IObjectsProcRecSafe, IDataInfoProcRec, ITestingProcRec, IAccountInfoProcRec, IErrorHandlingProcRec, ICommonFunctionsProcRec, IMarketInfoProcRec {
1534
+ }
1535
+ export declare enum OrderSelectMode {
1536
+ POSITION = 0,
1537
+ TICKET = 1
1538
+ }
1539
+ export declare enum OrderSearchMode {
1540
+ TRADES = 0,
1541
+ HISTORY = 1
1542
+ }
1543
+ export interface OrderInfo {
1544
+ ticket: number;
1545
+ openTime: FTODate;
1546
+ closeTime: FTODate | null;
1547
+ orderType: OrderType;
1548
+ volume: number;
1549
+ symbol: string;
1550
+ openPrice: number;
1551
+ closePrice: number;
1552
+ stopLoss: number;
1553
+ takeProfit: number;
1554
+ commission: number;
1555
+ swap: number;
1556
+ profit: number;
1557
+ profitPips: number;
1558
+ comment: string;
1559
+ margin: number;
1560
+ hedgedMargin: number;
1561
+ magicNumber: number;
1562
+ }
1563
+ export interface IOrdersProcRec {
1564
+ GetActiveOrderCount: () => number;
1565
+ GetHistoricalOrderCount: () => number;
1566
+ SelectOrder: (index: number, selectionMode: OrderSelectMode, searchMode?: OrderSearchMode) => boolean;
1567
+ GetOrderMagicNumber: () => number;
1568
+ GetOrderType: () => OrderType;
1569
+ GetOrderTicket: () => number;
1570
+ CloseOrder: (ticket: number) => boolean;
1571
+ PlaceOrder: (symbol: string, orderType: OrderType, price: number, volume: number, stopLoss: number, takeProfit: number, comment: string, magicNumber: number) => number;
1572
+ ModifyOrder: (ticket: number, price: number, stopLoss: number, takeProfit: number, volume?: number, comment?: string) => boolean;
1573
+ CancelOrder: (ticket: number) => boolean;
1574
+ ClosePartial: (ticket: number, volume: number) => boolean;
1575
+ GetOrderProfit: (profitType?: ProfitType) => number;
1576
+ IsOrderClosed: (ticket: number) => boolean;
1577
+ GetOrderOpenTime: () => FTODate;
1578
+ GetOrderCloseTime: () => FTODate | null;
1579
+ GetOrderVolume: () => number;
1580
+ GetOrderStopLoss: () => number;
1581
+ GetOrderTakeProfit: () => number;
1582
+ GetOrderOpenPrice: () => number;
1583
+ GetOrderClosePrice: () => number;
1584
+ GetOrderSymbol: () => string;
1585
+ GetOrderComment: () => string;
1586
+ GetOrderSwap: () => number;
1587
+ GetOrderInfo: (ticket: number) => OrderInfo;
1588
+ GetOrderCommission: () => number;
1589
+ PrintOrderDetails: () => void;
1590
+ }
1591
+ export declare class IndicatorReference {
1592
+ private id;
1593
+ protected constructor(id: string);
1594
+ getId(): string;
1595
+ }
1596
+ export interface IIndicatorsForStrategyProcRec {
1597
+ CreateIndicator: (symbolName: string, timeframe: number, indicatorFile: string, indicatorParams: string) => IndicatorReference;
1598
+ GetIndicatorValue: (indicator: IndicatorReference, bufferIndex: number, barIndex: number) => number;
1599
+ }
1600
+ export interface IBasicStrategyParamsProcRec {
1601
+ SetRobotShortName: (shortName: string) => void;
1602
+ SetRobotDescription: (description: string) => void;
1603
+ SetRobotSymbolAndTimeframe: (symbol: string, timeframe: number) => boolean;
1604
+ }
1605
+ interface RobotApi extends ISharedProcRec, IOrdersProcRec, IBasicStrategyParamsProcRec, IIndicatorsForStrategyProcRec {
1606
+ }
1607
+ export type { RobotApi as default };