@guihz/trading-vue-editor-tes 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/lib/assets/editor.worker-CT5Cb1wO.js +11 -0
  2. package/lib/assets/{parserTccWorker-Bti5p29_.js → parserTccWorker-cXJaK8VI.js} +18 -17
  3. package/lib/assets/scriptsRunWorker-Bx4RsHhS.js +66 -0
  4. package/lib/components/editor/index.d.ts +5 -0
  5. package/lib/components/editor/parseScript/buildInConstants.d.ts +51 -0
  6. package/lib/components/editor/parseScript/buildInFuncNamespace/box.d.ts +99 -0
  7. package/lib/components/editor/parseScript/buildInFuncNamespace/chartPoint.d.ts +27 -0
  8. package/lib/components/editor/parseScript/buildInFuncNamespace/index.d.ts +11 -1
  9. package/lib/components/editor/parseScript/buildInFuncNamespace/label.d.ts +77 -0
  10. package/lib/components/editor/parseScript/buildInFuncNamespace/line.d.ts +81 -0
  11. package/lib/components/editor/parseScript/buildInFuncNamespace/linefill.d.ts +37 -0
  12. package/lib/components/editor/parseScript/buildInFuncNamespace/log.d.ts +24 -0
  13. package/lib/components/editor/parseScript/buildInFuncNamespace/polyline.d.ts +31 -0
  14. package/lib/components/editor/parseScript/buildInFuncNamespace/runtime.d.ts +10 -0
  15. package/lib/components/editor/parseScript/buildInFuncNamespace/strategy.d.ts +95 -0
  16. package/lib/components/editor/parseScript/buildInFuncNamespace/ta.d.ts +3 -3
  17. package/lib/components/editor/parseScript/buildInFuncNamespace/table.d.ts +94 -0
  18. package/lib/components/editor/parseScript/constants.d.ts +16 -0
  19. package/lib/components/editor/parseScript/type.d.ts +1 -0
  20. package/lib/components/editor/parseScript/visitorParser.d.ts +1 -0
  21. package/lib/components/editor/parseScript/workerStorage.d.ts +0 -4
  22. package/lib/components/editor/type/index.d.ts +2 -0
  23. package/lib/components/editor/utils/initEditor.d.ts +4 -0
  24. package/lib/trading-vue-editor.js +3856 -3519
  25. package/lib/trading-vue-editor.umd.cjs +39 -39
  26. package/package.json +1 -1
  27. package/lib/assets/scriptsRunWorker-DvC1lFMR.js +0 -66
  28. package/lib/components/editor/parseScript/buildInVariables.d.ts +0 -124
@@ -7,6 +7,7 @@ interface IProps {
7
7
  height?: string | number;
8
8
  width?: string | number;
9
9
  theme?: Theme;
10
+ readOnly?: boolean;
10
11
  options?: editor.IStandaloneEditorConstructionOptions;
11
12
  hasDiff?: boolean;
12
13
  onCursorPositionChange?: (position: IPosition) => void;
@@ -17,6 +18,10 @@ export interface IRefs {
17
18
  saveScript: () => void;
18
19
  gotoLine: () => void;
19
20
  setScript: (code: string) => void;
21
+ getEditorLayout: () => undefined | {
22
+ contentHeight: number;
23
+ lineCount: number | undefined;
24
+ };
20
25
  }
21
26
  declare const TradingEditorComponent: import("react").ForwardRefExoticComponent<IProps & import("react").RefAttributes<IRefs>>;
22
27
  export default TradingEditorComponent;
@@ -1,4 +1,55 @@
1
1
  import { VPlotDisplay, VExtend, VFormatType, VHlineStyle, VLabelStyle, VLineStyle, VLocation, VSortOrder, VPlotStyle, VPosition, VAdjustment, VAlert, VBarmergeGaps, VScale, VSession, VShape, VSize, VStrategy, VCommission, VDirection, VOca, VText, VXloc, VYloc, VEarnings } from './enum';
2
+ export declare const COLOR_BUILD_IN: {
3
+ aqua: string;
4
+ black: string;
5
+ blue: string;
6
+ fuchsia: string;
7
+ gray: string;
8
+ green: string;
9
+ lime: string;
10
+ maroon: string;
11
+ navy: string;
12
+ olive: string;
13
+ orange: string;
14
+ purple: string;
15
+ red: string;
16
+ silver: string;
17
+ teal: string;
18
+ white: string;
19
+ yellow: string;
20
+ };
21
+ export declare const CURRENCY_BUILD_IN: {
22
+ AUD: string;
23
+ BTC: string;
24
+ CAD: string;
25
+ CHF: string;
26
+ ETH: string;
27
+ EUR: string;
28
+ GBP: string;
29
+ HKD: string;
30
+ INR: string;
31
+ JPY: string;
32
+ KRW: string;
33
+ MYR: string;
34
+ NOK: string;
35
+ NONE: string;
36
+ NZD: string;
37
+ RUB: string;
38
+ SEK: string;
39
+ SGD: string;
40
+ TRY: string;
41
+ USD: string;
42
+ USDT: string;
43
+ ZAR: string;
44
+ };
45
+ export declare const DISPLAY_BUILD_IN: {
46
+ all: VPlotDisplay[];
47
+ data_window: VPlotDisplay[];
48
+ none: never[];
49
+ pane: VPlotDisplay[];
50
+ price_scale: VPlotDisplay[];
51
+ status_line: VPlotDisplay[];
52
+ };
2
53
  export declare class BuildInConstants {
3
54
  adjustment: {
4
55
  dividends: VAdjustment;
@@ -0,0 +1,99 @@
1
+ import { BuiltInVariables } from "../buildInVariables";
2
+ import { VExtend, VLineStyle, VSize, VText, VXloc } from "../enum";
3
+ import { Point } from "./index";
4
+ export interface IBoxArgs {
5
+ id?: string;
6
+ top_left?: Point;
7
+ left?: number;
8
+ top?: number;
9
+ right?: number;
10
+ bottom?: number;
11
+ bottom_right?: Point;
12
+ border_color?: string;
13
+ border_width?: number;
14
+ border_style?: VLineStyle;
15
+ style?: VLineStyle;
16
+ xloc?: VXloc;
17
+ bgcolor?: string;
18
+ text?: string;
19
+ text_size?: VSize;
20
+ text_color?: string;
21
+ extend?: VExtend;
22
+ text_halign?: VText;
23
+ text_valign?: VText;
24
+ text_wrap?: VText;
25
+ text_font_family?: string;
26
+ color?: string;
27
+ point?: Point;
28
+ width?: number;
29
+ }
30
+ type VBoxArgs = Omit<IBoxArgs, 'id'> & {
31
+ id: Box;
32
+ };
33
+ export default class BuildInBox {
34
+ private _variables;
35
+ private _defaultBox;
36
+ constructor(variables: BuiltInVariables);
37
+ box({ x }: {
38
+ x?: Box;
39
+ }, posStr: string): Box;
40
+ new({ top_left, bottom_right, ...args }: IBoxArgs, posStr: string): Box;
41
+ copy({ id }: VBoxArgs, posStr: string): Box;
42
+ delete({ id }: VBoxArgs): void;
43
+ get_top({ id }: VBoxArgs): number | undefined;
44
+ get_bottom({ id }: VBoxArgs): number | undefined;
45
+ get_left({ id }: VBoxArgs): number | undefined;
46
+ get_right({ id }: VBoxArgs): number | undefined;
47
+ set_top({ id, ...args }: VBoxArgs): void;
48
+ set_bottom({ id, ...args }: VBoxArgs): void;
49
+ set_left({ id, ...args }: VBoxArgs): void;
50
+ set_right({ id, ...args }: VBoxArgs): void;
51
+ set_extend({ id, ...args }: VBoxArgs): void;
52
+ set_bgcolor({ id, ...args }: VBoxArgs): void;
53
+ set_border_color({ id, ...args }: VBoxArgs): void;
54
+ set_border_width({ id, ...args }: VBoxArgs): void;
55
+ set_border_style({ id, ...args }: VBoxArgs): void;
56
+ set_lefttop({ id, ...args }: VBoxArgs): void;
57
+ set_rightbottom({ id, ...args }: VBoxArgs): void;
58
+ set_text_size({ id, ...args }: VBoxArgs): void;
59
+ set_text_wrap({ id, ...args }: VBoxArgs): void;
60
+ set_text_color({ id, ...args }: VBoxArgs): void;
61
+ set_text_halign({ id, ...args }: VBoxArgs): void;
62
+ set_text_valign({ id, ...args }: VBoxArgs): void;
63
+ set_top_left_point({ id, ...args }: VBoxArgs): void;
64
+ set_bottom_right_point({ id, ...args }: VBoxArgs): void;
65
+ set_text_font_family({ id, ...args }: VBoxArgs): void;
66
+ }
67
+ export declare class Box {
68
+ private _id;
69
+ private _variables;
70
+ constructor(variables: BuiltInVariables, key: string);
71
+ copy(posStr: string): Box;
72
+ delete(): void;
73
+ get_top(): number | undefined;
74
+ set_top({ top }: IBoxArgs): void;
75
+ get_left(): number | undefined;
76
+ set_left({ left }: IBoxArgs): void;
77
+ set_text({ text }: IBoxArgs): void;
78
+ get_right(): number | undefined;
79
+ set_right({ right }: IBoxArgs): void;
80
+ get_bottom(): number | undefined;
81
+ set_bottom({ bottom }: IBoxArgs): void;
82
+ set_extend({ extend }: IBoxArgs): void;
83
+ set_bgcolor({ color }: IBoxArgs): void;
84
+ set_lefttop({ left, top }: IBoxArgs): void;
85
+ set_text_size({ text_size }: IBoxArgs): void;
86
+ set_text_wrap({ text_wrap }: IBoxArgs): void;
87
+ set_text_color({ text_color }: IBoxArgs): void;
88
+ set_rightbottom({ right, bottom }: IBoxArgs): void;
89
+ set_text_halign({ text_halign }: IBoxArgs): void;
90
+ set_text_valign({ text_valign }: IBoxArgs): void;
91
+ set_top_left_point({ point }: IBoxArgs): void;
92
+ set_border_color({ color }: IBoxArgs): void;
93
+ set_border_style({ style }: IBoxArgs): void;
94
+ set_border_width({ width }: IBoxArgs): void;
95
+ set_bottom_right_point({ point }: IBoxArgs): void;
96
+ set_text_font_family({ text_font_family }: IBoxArgs): void;
97
+ private _getBox;
98
+ }
99
+ export {};
@@ -0,0 +1,27 @@
1
+ import { BuiltInVariables } from "../buildInVariables";
2
+ interface IChartPointArgs {
3
+ id?: Point;
4
+ price?: number;
5
+ time?: number;
6
+ index?: number;
7
+ }
8
+ export default class ChartPoint {
9
+ private _variables;
10
+ constructor(variables: BuiltInVariables);
11
+ new({ price, time, index }: IChartPointArgs): Point;
12
+ now({ price }: IChartPointArgs): Point;
13
+ copy({ id }: IChartPointArgs): Point;
14
+ from_index({ price, index }: IChartPointArgs): Point;
15
+ from_time({ price, time }: IChartPointArgs): Point;
16
+ }
17
+ export declare class Point {
18
+ private _index?;
19
+ private _price?;
20
+ private _time?;
21
+ constructor(price?: number, index?: number, time?: number);
22
+ get index(): number | undefined;
23
+ get price(): number | undefined;
24
+ get time(): number | undefined;
25
+ copy(): Point;
26
+ }
27
+ export {};
@@ -7,6 +7,16 @@ import BuildInMatrix from "./matrix";
7
7
  import BuildInTimeframe from "./timeframe";
8
8
  import BuildInStr from "./string";
9
9
  import BuildInMap from "./map";
10
+ import ChartPoint, { Point } from "./chartPoint";
11
+ import BuildInLabel, { PartialLabelArgs, Label } from "./label";
12
+ import BuildInPolyline, { IPolyline, Polyline } from "./polyline";
13
+ import BuildInLine, { ILineArgs, Line } from "./line";
14
+ import BuildInLinefill, { TLinefill, Linefill } from "./linefill";
15
+ import BuildInBox, { IBoxArgs, Box } from "./box";
16
+ import BuildInTable, { ITableArgs, Table } from "./table";
17
+ import { Log } from './log';
18
+ import { Runtime } from './runtime';
10
19
  export { TccErrorListener } from './errorListener';
11
20
  export type { IColorArgs } from './color';
12
- export { BuildInArray, BuildInMath, BuildInTa, BuildInInput, BuildInColor, BuildInMatrix, BuildInTimeframe, BuildInStr, BuildInMap, PseudoArray, VInputType };
21
+ export { BuildInArray, BuildInMath, BuildInTa, BuildInInput, BuildInColor, BuildInMatrix, ChartPoint, Point, BuildInTimeframe, BuildInStr, BuildInMap, PseudoArray, VInputType, BuildInLabel, BuildInPolyline, BuildInLine, Label, Polyline, Line, BuildInLinefill, Linefill, BuildInBox, Box, BuildInTable, Table, Log, Runtime };
22
+ export type { PartialLabelArgs, IPolyline, ILineArgs, TLinefill, IBoxArgs, ITableArgs };
@@ -0,0 +1,77 @@
1
+ import { BuiltInVariables } from "../buildInVariables";
2
+ import { VLabelStyle, VSize, VText, VXloc, VYloc } from "../enum";
3
+ import { Point } from "./index";
4
+ interface ILabelArgs {
5
+ id: string;
6
+ point: Point;
7
+ text: string;
8
+ x: number;
9
+ y: number;
10
+ xloc: VXloc;
11
+ yloc: VYloc;
12
+ color: string;
13
+ size: VSize;
14
+ style: VLabelStyle;
15
+ textalign: VText;
16
+ textcolor: string;
17
+ tooltip: string;
18
+ text_font_family: string;
19
+ }
20
+ export type PartialLabelArgs = Partial<ILabelArgs>;
21
+ type TLabelArgs = Omit<PartialLabelArgs, 'id'> & {
22
+ id: Label;
23
+ };
24
+ export default class BuildInLabel {
25
+ private _variables;
26
+ private _defaultLabel;
27
+ constructor(variables: BuiltInVariables);
28
+ new(args: PartialLabelArgs, posStr: string): Label;
29
+ label(args: {
30
+ x?: Label;
31
+ }, posStr: string): Label;
32
+ copy({ id }: TLabelArgs, posStr: string): Label;
33
+ get_x({ id }: TLabelArgs, posStr: string): number | undefined;
34
+ get_y({ id }: TLabelArgs, posStr: string): number | undefined;
35
+ set_x({ id, ...args }: TLabelArgs, posStr: string): void;
36
+ set_y({ id, ...args }: TLabelArgs, posStr: string): void;
37
+ delete({ id }: TLabelArgs): void;
38
+ get_text({ id }: TLabelArgs, posStr: string): string | undefined;
39
+ set_xy({ id, ...args }: TLabelArgs, posStr: string): void;
40
+ set_size({ id, ...args }: TLabelArgs, posStr: string): void;
41
+ set_xloc({ id, ...args }: TLabelArgs, posStr: string): void;
42
+ set_yloc({ id, ...args }: TLabelArgs, posStr: string): void;
43
+ set_style({ id, ...args }: TLabelArgs, posStr: string): void;
44
+ set_color({ id, ...args }: TLabelArgs, posStr: string): void;
45
+ set_tooltip({ id, ...args }: TLabelArgs, posStr: string): void;
46
+ set_point({ id, ...args }: TLabelArgs, posStr: string): void;
47
+ set_text({ id, ...args }: TLabelArgs, posStr: string): void;
48
+ set_textcolor({ id, ...args }: TLabelArgs, posStr: string): void;
49
+ set_textalign({ id, ...args }: TLabelArgs, posStr: string): void;
50
+ set_text_font_family({ id, ...args }: TLabelArgs, posStr: string): void;
51
+ }
52
+ export declare class Label {
53
+ private _id;
54
+ private _variables;
55
+ constructor(key: string, variables: BuiltInVariables);
56
+ copy(posStr: string): Label;
57
+ get_x(posStr: string): number | undefined;
58
+ get_y(posStr: string): number | undefined;
59
+ set_x({ x }: PartialLabelArgs, posStr: string): void;
60
+ set_y({ y }: PartialLabelArgs, posStr: string): void;
61
+ delete(): void;
62
+ set_xy({ x, y }: PartialLabelArgs, posStr: string): void;
63
+ get_text(posStr: string): string | undefined;
64
+ set_size({ size }: PartialLabelArgs, posStr: string): void;
65
+ set_text({ text }: PartialLabelArgs, posStr: string): void;
66
+ set_xloc({ x, xloc }: PartialLabelArgs, posStr: string): void;
67
+ set_yloc({ yloc }: PartialLabelArgs, posStr: string): void;
68
+ set_color({ color }: PartialLabelArgs, posStr: string): void;
69
+ set_point({ point }: PartialLabelArgs, posStr: string): void;
70
+ set_style({ style }: PartialLabelArgs, posStr: string): void;
71
+ set_tooltip({ tooltip }: PartialLabelArgs, posStr: string): void;
72
+ set_textalign({ textalign }: PartialLabelArgs, posStr: string): void;
73
+ set_textcolor({ textcolor }: PartialLabelArgs, posStr: string): void;
74
+ set_text_font_family({ text_font_family }: PartialLabelArgs, posStr: string): void;
75
+ private _getLabel;
76
+ }
77
+ export {};
@@ -0,0 +1,81 @@
1
+ import { BuiltInVariables } from "../buildInVariables";
2
+ import { VExtend, VLineStyle, VXloc } from "../enum";
3
+ import { Point } from "./index";
4
+ export interface ILineArgs {
5
+ id?: string;
6
+ x?: number;
7
+ y?: number;
8
+ x1?: number;
9
+ y1?: number;
10
+ x2?: number;
11
+ y2?: number;
12
+ point?: Point;
13
+ first_point?: Point;
14
+ second_point?: Point;
15
+ xloc?: VXloc;
16
+ extend?: VExtend;
17
+ color?: string;
18
+ style?: VLineStyle;
19
+ width?: number;
20
+ linefills?: string[];
21
+ }
22
+ type LineArgs = Omit<ILineArgs, 'id'> & {
23
+ id: Line;
24
+ };
25
+ export default class BuildInLine {
26
+ private _variables;
27
+ private _defaultLine;
28
+ constructor(variables: BuiltInVariables);
29
+ new({ first_point, second_point, ...args }: ILineArgs, posStr: string): Line;
30
+ line(args: {
31
+ x?: Line;
32
+ }, posStr: string): Line;
33
+ copy({ id }: LineArgs, posStr: string): Line;
34
+ delete({ id }: LineArgs): void;
35
+ get_x1({ id }: LineArgs, posStr: string): number | undefined;
36
+ get_x2({ id }: LineArgs, posStr: string): number | undefined;
37
+ get_y1({ id }: LineArgs, posStr: string): number | undefined;
38
+ get_y2({ id }: LineArgs, posStr: string): number | undefined;
39
+ set_x1({ id, ...args }: LineArgs, posStr: string): void;
40
+ set_x2({ id, ...args }: LineArgs, posStr: string): void;
41
+ set_y1({ id, ...args }: LineArgs, posStr: string): void;
42
+ set_y2({ id, ...args }: LineArgs, posStr: string): void;
43
+ set_xy1({ id, ...args }: LineArgs, posStr: string): void;
44
+ set_xy2({ id, ...args }: LineArgs, posStr: string): void;
45
+ set_xloc({ id, ...args }: LineArgs, posStr: string): void;
46
+ get_price({ id, ...args }: LineArgs, posStr: string): number | undefined;
47
+ set_color({ id, ...args }: LineArgs, posStr: string): void;
48
+ set_style({ id, ...args }: LineArgs, posStr: string): void;
49
+ set_width({ id, ...args }: LineArgs, posStr: string): void;
50
+ set_extend({ id, ...args }: LineArgs, posStr: string): void;
51
+ set_first_point({ id, ...args }: LineArgs, posStr: string): void;
52
+ set_second_point({ id, ...args }: LineArgs, posStr: string): void;
53
+ }
54
+ export declare class Line {
55
+ private _variables;
56
+ private _id;
57
+ constructor(key: string, variables: BuiltInVariables);
58
+ get data(): ILineArgs | undefined;
59
+ copy(posStr: string): Line;
60
+ delete(): void;
61
+ get_price({ x }: ILineArgs, posStr: string): number | undefined;
62
+ get_x1(posStr: string): number | undefined;
63
+ get_x2(posStr: string): number | undefined;
64
+ get_y1(posStr: string): number | undefined;
65
+ get_y2(posStr: string): number | undefined;
66
+ set_x1({ x }: ILineArgs, posStr: string): void;
67
+ set_x2({ x }: ILineArgs, posStr: string): void;
68
+ set_y1({ y }: ILineArgs, posStr: string): void;
69
+ set_y2({ y }: ILineArgs, posStr: string): void;
70
+ set_xy1({ x, y }: ILineArgs, posStr: string): void;
71
+ set_xy2({ x, y }: ILineArgs, posStr: string): void;
72
+ set_xloc({ xloc, x1, x2 }: ILineArgs, posStr: string): void;
73
+ set_color({ color }: ILineArgs, posStr: string): void;
74
+ set_style({ style }: ILineArgs, posStr: string): void;
75
+ set_width({ width }: ILineArgs, posStr: string): void;
76
+ set_extend({ extend }: ILineArgs, posStr: string): void;
77
+ set_first_point({ point }: ILineArgs, posStr: string): void;
78
+ set_second_point({ point }: ILineArgs, posStr: string): void;
79
+ private _getLine;
80
+ }
81
+ export {};
@@ -0,0 +1,37 @@
1
+ import { BuiltInVariables } from "../buildInVariables";
2
+ import { Line, ILineArgs } from "./line";
3
+ interface ILinefillArgs {
4
+ id?: Linefill;
5
+ line1?: Line;
6
+ line2?: Line;
7
+ color?: string;
8
+ }
9
+ export type TLinefill = Omit<ILinefillArgs, 'line1' | 'line2' | 'id'> & {
10
+ id: string;
11
+ line1?: ILineArgs;
12
+ line2?: ILineArgs;
13
+ };
14
+ export default class BuildInLinefill {
15
+ private _variables;
16
+ constructor(variables: BuiltInVariables);
17
+ new({ line1, line2, color }: ILinefillArgs, posStr: string): Linefill;
18
+ delete({ id }: ILinefillArgs): void;
19
+ get_line1({ id }: ILinefillArgs): Line | undefined;
20
+ get_line2({ id }: ILinefillArgs): Line | undefined;
21
+ set_color({ id, ...args }: ILinefillArgs): void;
22
+ }
23
+ export declare class Linefill {
24
+ private _id;
25
+ private _line1?;
26
+ private _line2?;
27
+ private _variables;
28
+ constructor(variables: BuiltInVariables, key: string, line1?: Line, line2?: Line);
29
+ linefill(args: {
30
+ x?: Linefill;
31
+ }, posStr: string): Linefill;
32
+ delete(): void;
33
+ get_line1(): Line | undefined;
34
+ get_line2(): Line | undefined;
35
+ set_color({ color }: ILinefillArgs): void;
36
+ }
37
+ export {};
@@ -0,0 +1,24 @@
1
+ import { BuiltInVariables } from "../buildInVariables";
2
+ interface ILogArgs {
3
+ message?: string;
4
+ formatString?: string;
5
+ }
6
+ interface ILog {
7
+ message: string;
8
+ time: number;
9
+ barIndex: number;
10
+ type: LogType;
11
+ }
12
+ type LogType = 'error' | 'info' | 'warning';
13
+ export declare class Log {
14
+ private _logs;
15
+ private _variables;
16
+ constructor(variables: BuiltInVariables);
17
+ get logs(): ILog[];
18
+ clearLogs(): void;
19
+ info(args: ILogArgs, replaces: (string | number)[]): void;
20
+ error(args: ILogArgs, replaces: (string | number)[]): void;
21
+ warning(args: ILogArgs, replaces: (string | number)[]): void;
22
+ private _addLog;
23
+ }
24
+ export {};
@@ -0,0 +1,31 @@
1
+ import { PseudoArray } from "./index";
2
+ import { BuiltInVariables } from "../buildInVariables";
3
+ import { VLineStyle, VXloc } from "../enum";
4
+ export interface IPolyline {
5
+ id?: string;
6
+ points?: PseudoArray;
7
+ curved?: boolean;
8
+ closed?: boolean;
9
+ xloc?: VXloc;
10
+ line_color?: string;
11
+ fill_color?: string;
12
+ line_style?: VLineStyle;
13
+ line_width?: number;
14
+ }
15
+ type TPolylineArgs = Omit<IPolyline, 'id'> & {
16
+ id: Polyline;
17
+ };
18
+ export default class BuildInPolyline {
19
+ private _variables;
20
+ private _defaultPolyline;
21
+ constructor(variables: BuiltInVariables);
22
+ new(args: IPolyline, posStr: string): Polyline;
23
+ delete({ id }: TPolylineArgs): void;
24
+ }
25
+ export declare class Polyline {
26
+ private _id;
27
+ private _variables;
28
+ constructor(key: string, variables: BuiltInVariables);
29
+ delete(): void;
30
+ }
31
+ export {};
@@ -0,0 +1,10 @@
1
+ import { TccErrorListener } from "./index";
2
+ interface IRuntimeArgs {
3
+ message: string;
4
+ }
5
+ export declare class Runtime {
6
+ private _errorListener;
7
+ constructor(errorListener: TccErrorListener);
8
+ error({ message }: IRuntimeArgs, posStr: string): void;
9
+ }
10
+ export {};
@@ -0,0 +1,95 @@
1
+ import { BuiltInVariables } from "../buildInVariables";
2
+ import { VCommission, VDirection, VFormatType, VOca, VScale, VStrategy } from "../enum";
3
+ interface IStrategy {
4
+ title?: string;
5
+ shorttitle?: string;
6
+ overlay?: boolean;
7
+ format?: VFormatType;
8
+ precision?: number;
9
+ scale?: VScale;
10
+ pyramiding?: number;
11
+ calc_on_order_fills?: boolean;
12
+ calc_on_every_tick?: boolean;
13
+ max_bars_back?: number;
14
+ backtest_fill_limits_assumption?: number;
15
+ default_qty_type?: VStrategy;
16
+ default_qty_value?: number;
17
+ initial_capital: number;
18
+ currency?: string;
19
+ slippage?: number;
20
+ commission_type?: VCommission;
21
+ commission_value?: number;
22
+ process_orders_on_close?: boolean;
23
+ close_entries_rule?: CloseEntriesRuleType;
24
+ margin_long?: number;
25
+ margin_short?: number;
26
+ explicit_plot_zorder?: boolean;
27
+ max_lines_count?: number;
28
+ max_labels_count?: number;
29
+ max_boxes_count?: number;
30
+ calc_bars_count?: number;
31
+ risk_free_rate?: number;
32
+ use_bar_magnifier?: boolean;
33
+ fill_orders_on_standard_ohlc?: boolean;
34
+ max_polylines_count?: number;
35
+ }
36
+ interface IOrderArgs {
37
+ id: string;
38
+ direction: VDirection;
39
+ qty?: number;
40
+ limit?: number;
41
+ stop?: number;
42
+ oca_name?: string;
43
+ oca_type?: VOca;
44
+ comment?: string;
45
+ alert_message?: string;
46
+ disable_alert?: false;
47
+ }
48
+ type CloseEntriesRuleType = 'FIFO' | 'ANY';
49
+ export default class Strategy {
50
+ private _variables;
51
+ private _options;
52
+ private _totalChangeCapital;
53
+ private _historyOrder;
54
+ private _orders;
55
+ private _pendingOrders;
56
+ constructor(variables: BuiltInVariables);
57
+ get options(): {
58
+ title?: string | undefined;
59
+ shorttitle?: string | undefined;
60
+ overlay?: boolean | undefined;
61
+ format?: VFormatType | undefined;
62
+ precision?: number | undefined;
63
+ scale?: VScale | undefined;
64
+ pyramiding?: number | undefined;
65
+ calc_on_order_fills?: boolean | undefined;
66
+ calc_on_every_tick?: boolean | undefined;
67
+ max_bars_back?: number | undefined;
68
+ backtest_fill_limits_assumption?: number | undefined;
69
+ default_qty_type?: VStrategy | undefined;
70
+ default_qty_value?: number | undefined;
71
+ initial_capital: number;
72
+ currency?: string | undefined;
73
+ slippage?: number | undefined;
74
+ commission_type?: VCommission | undefined;
75
+ commission_value?: number | undefined;
76
+ process_orders_on_close?: boolean | undefined;
77
+ close_entries_rule?: CloseEntriesRuleType | undefined;
78
+ margin_long?: number | undefined;
79
+ margin_short?: number | undefined;
80
+ explicit_plot_zorder?: boolean | undefined;
81
+ max_lines_count?: number | undefined;
82
+ max_labels_count?: number | undefined;
83
+ max_boxes_count?: number | undefined;
84
+ calc_bars_count?: number | undefined;
85
+ risk_free_rate?: number | undefined;
86
+ use_bar_magnifier?: boolean | undefined;
87
+ fill_orders_on_standard_ohlc?: boolean | undefined;
88
+ max_polylines_count?: number | undefined;
89
+ };
90
+ updateOptions(options: IStrategy): void;
91
+ strategy(args: IStrategy): void;
92
+ order(args: IOrderArgs): void;
93
+ private _longOrderHandle;
94
+ }
95
+ export {};
@@ -59,9 +59,9 @@ export default class BuildInTa {
59
59
  cmo({ series, length }: ITaArgs, posStr: string): number | undefined;
60
60
  cog({ source, length }: ITaArgs, posStr: string): number | undefined;
61
61
  correlation({ source1, source2, length }: ITaArgs, posStr: string): number | undefined;
62
- cross({ source1, source2 }: ITaArgs, posStr: string): boolean | undefined;
63
- crossover({ source1, source2 }: ITaArgs, posStr: string): boolean | undefined;
64
- crossunder({ source1, source2 }: ITaArgs, posStr: string): boolean | undefined;
62
+ cross({ source1, source2 }: ITaArgs, posStr: string): boolean;
63
+ crossover({ source1, source2 }: ITaArgs, posStr: string): boolean;
64
+ crossunder({ source1, source2 }: ITaArgs, posStr: string): boolean;
65
65
  cum({ source }: ITaArgs, posStr: string): any;
66
66
  dev({ source, length }: ITaArgs, posStr: string): number | undefined;
67
67
  dmi({ diLength, adxSmoothing }: ITaArgs, posStr: string): (number | undefined)[];