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

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ import { Theme } from '@monaco-editor/react';
2
+ import { FC } from 'react';
3
+ interface IProps {
4
+ height?: string | number;
5
+ width?: string | number;
6
+ theme?: Theme;
7
+ modified?: string;
8
+ original?: string;
9
+ renderSideBySide?: boolean;
10
+ }
11
+ declare const TradingDiffEditor: FC<IProps>;
12
+ export default TradingDiffEditor;
@@ -14,9 +14,10 @@ import BuildInLine, { ILineArgs, Line } from "./line";
14
14
  import BuildInLinefill, { TLinefill, Linefill } from "./linefill";
15
15
  import BuildInBox, { IBoxArgs, Box } from "./box";
16
16
  import BuildInTable, { ITableArgs, Table } from "./table";
17
+ import Strategy from './strategy';
17
18
  import { Log } from './log';
18
19
  import { Runtime } from './runtime';
19
20
  export { TccErrorListener } from './errorListener';
20
21
  export type { IColorArgs } from './color';
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 { 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, Strategy };
22
23
  export type { PartialLabelArgs, IPolyline, ILineArgs, TLinefill, IBoxArgs, ITableArgs };
@@ -1,3 +1,4 @@
1
+ import { IKeyObjectValue } from "../../type";
1
2
  import { BuiltInVariables } from "../buildInVariables";
2
3
  import { VCommission, VDirection, VFormatType, VOca, VScale, VStrategy } from "../enum";
3
4
  interface IStrategy {
@@ -36,60 +37,56 @@ interface IStrategy {
36
37
  interface IOrderArgs {
37
38
  id: string;
38
39
  direction: VDirection;
40
+ from_entry?: string;
39
41
  qty?: number;
40
42
  limit?: number;
43
+ loss?: number;
41
44
  stop?: number;
42
45
  oca_name?: string;
43
46
  oca_type?: VOca;
44
47
  comment?: string;
45
48
  alert_message?: string;
46
49
  disable_alert?: false;
50
+ qty_percent?: number;
51
+ immediately?: boolean;
52
+ trail_price?: number;
53
+ trail_points?: number;
54
+ trail_offset?: number;
55
+ profit?: number;
47
56
  }
48
57
  type CloseEntriesRuleType = 'FIFO' | 'ANY';
49
58
  export default class Strategy {
50
59
  private _variables;
51
60
  private _options;
52
61
  private _totalChangeCapital;
62
+ private _freezeCapital;
53
63
  private _historyOrder;
54
64
  private _orders;
55
65
  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
- };
66
+ private _mintick;
67
+ private _ocaMap;
68
+ private _funcOptions;
69
+ constructor(variables: BuiltInVariables, options: IKeyObjectValue, mintick?: number);
90
70
  updateOptions(options: IStrategy): void;
91
71
  strategy(args: IStrategy): void;
72
+ private _calcDefaultQty;
92
73
  order(args: IOrderArgs): void;
74
+ private _orderHandle;
75
+ private _ocaGroupVerify;
76
+ private _processOrders;
77
+ private _addPendingOrders;
78
+ private _orderArgsParse;
79
+ entry(args: IOrderArgs): void;
80
+ private _entryHandle;
81
+ private _entryOrder;
82
+ private _addPendingEntry;
83
+ exit(args: IOrderArgs): void;
84
+ private _pendingOrderHandle;
93
85
  private _longOrderHandle;
86
+ private _shortOrderHandle;
87
+ private _closeOrderHandle;
88
+ private _exitOrderHandle;
89
+ private _exit;
90
+ private _isNaN;
94
91
  }
95
92
  export {};
@@ -1,4 +1,5 @@
1
1
  export { default as TradingVueEditor } from '../components/editor/index';
2
+ export { default as TradingVueDiffEditor } from '../components/diffEditor/index';
2
3
  export type { IRefs as IEditorRefs } from '../components/editor/index';
3
4
  export { parseTcc, scriptsRun } from '../components/editor/utils/parserTcc';
4
5
  export type { IError, IPosition } from '../components/editor/parseScript/type';