@guihz/trading-vue-editor-tes 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,7 +38,7 @@ export default class BuildInMath {
38
38
  random({ min, max, seed }: IMathArgs): string | number;
39
39
  round({ number, precision }: IMathArgs): number;
40
40
  round_to_mintick({ number }: IMathArgs): number;
41
- sign({ number }: IMathArgs): number;
41
+ sign({ number }: IMathArgs): number | undefined;
42
42
  sqrt({ number }: IMathArgs): number;
43
43
  sum({ source, length }: IMathArgs, posStr: string): number | undefined;
44
44
  todegrees({ radians }: IMathArgs): number;
@@ -1,4 +1,5 @@
1
1
  import { BuiltInVariables } from "../buildInVariables";
2
+ import { PseudoArray } from './array';
2
3
  import BuildInTimeframe from "./timeframe";
3
4
  import BuildInMath from "./math";
4
5
  interface ITaArgs {
@@ -51,7 +52,7 @@ export default class BuildInTa {
51
52
  barssince({ condition }: ITaArgs, posStr: string): any;
52
53
  stdev({ source, length, biased }: ITaArgs, posStr: string): number | undefined;
53
54
  private _sum;
54
- bb({ series, length, mult }: ITaArgs, posStr: string): number[] | undefined;
55
+ bb({ series, length, mult }: ITaArgs, posStr: string): number[];
55
56
  bbw({ series, length, mult }: ITaArgs, posStr: string): number | undefined;
56
57
  cci({ source, length }: ITaArgs, posStr: string): number | undefined;
57
58
  change({ source, length }: ITaArgs, posStr: string): any;
@@ -86,7 +87,8 @@ export default class BuildInTa {
86
87
  percentile_linear_interpolation({ source, length, percentage }: ITaArgs, posStr: string): number | undefined;
87
88
  percentile_nearest_rank({ source, length, percentage }: ITaArgs, posStr: string): number | undefined;
88
89
  percentrank({ source, length }: ITaArgs, posStr: string): number | undefined;
89
- pivot_point_levels({ type, anchor, developing }: ITaArgs, posStr: string): number[];
90
+ pivot_point_levels({ type, anchor, developing }: ITaArgs, posStr: string): PseudoArray;
91
+ private _getPivotPointLevels;
90
92
  private _traditional;
91
93
  private _fibonacci;
92
94
  private _woodie;
@@ -44,7 +44,7 @@ export declare class BuiltInVariables {
44
44
  get timeframe(): Timeframe;
45
45
  getTimeTradingday(time: number, period: string): number;
46
46
  updateData(data: IKeyObjectValue): void;
47
- getCacheData(key: string, preIndex: number, value: any, tokenIndex: string): any;
47
+ getCacheData(key: string, preIndex: number, value: any): any;
48
48
  setCacheData(key: string, value: any): void;
49
49
  getTypeInstance(fileds: IKeyObjectValue, varipKeys: string[]): UserTypeClass;
50
50
  getVarValue(name: string, position: string, declare: string): any;
@@ -85,27 +85,29 @@ export declare class Timeframe {
85
85
  get period(): string;
86
86
  }
87
87
  export declare class Ta {
88
- private _variables;
89
88
  private _preAccdist;
90
- private _preNviObj;
91
- private _prePviObj;
92
- private _preTr;
89
+ private _preNvi;
90
+ private _prePvi;
93
91
  private _preObv;
94
92
  private _prePvt;
95
93
  private _preWad;
96
94
  private _preVwap;
97
- constructor(variables: BuiltInVariables);
95
+ private _preValue;
96
+ private _currentData;
97
+ private _preData;
98
+ constructor();
99
+ update(currentData: IKeyObjectValue): void;
98
100
  get isRealTime(): boolean;
99
- get accdist(): number;
100
- get iii(): number;
101
- get nvi(): number;
102
- get wvad(): number;
101
+ get accdist(): any;
102
+ get iii(): any;
103
+ get nvi(): any;
104
+ get wvad(): any;
103
105
  get obv(): any;
104
- get pvi(): number;
105
- get tr(): number | undefined;
106
+ get pvi(): any;
107
+ get tr(): any;
106
108
  get pvt(): any;
107
109
  get wad(): any;
108
- get vwap(): number;
110
+ get vwap(): any;
109
111
  private _getNvi;
110
112
  private _getPvi;
111
113
  }
@@ -5,8 +5,10 @@ export default class ParseToJs {
5
5
  private _prefixNameFunc;
6
6
  private _prefixNameConst;
7
7
  private _userTypes;
8
- private _memberIndexCache;
9
8
  private _isInFunc;
9
+ private _varlist;
10
+ private _memberIndexList;
11
+ private _blockCount;
10
12
  constructor(prefix: string);
11
13
  preParser(values: IKeyObjectValue[]): string | undefined;
12
14
  parser(values: IKeyObjectValue[]): string | undefined;
@@ -33,6 +35,7 @@ export default class ParseToJs {
33
35
  private _parserSingleExpression;
34
36
  private _parserAdditiveExpression;
35
37
  private _parserMemberIndexExpression;
38
+ private _getUserVarMemberIndexs;
36
39
  private _parseLiteral;
37
40
  private _colorToRgba;
38
41
  private _parserName;
@@ -1,6 +1,7 @@
1
1
  import { IKeyObjectValue } from "../type";
2
2
  export declare class WorkerStorage {
3
3
  private _cache;
4
+ private _data;
4
5
  constructor();
5
6
  set(key: string, value: IKeyObjectValue): void;
6
7
  setValue(mapKey: string, valKey: string, value: IKeyObjectValue): void;
@@ -9,4 +10,7 @@ export declare class WorkerStorage {
9
10
  has(key: string): boolean;
10
11
  delete(key: string): void;
11
12
  clear(): void;
13
+ setData(data: IKeyObjectValue[]): void;
14
+ updateData(data: IKeyObjectValue[]): void;
15
+ getData(startIndex?: number, endIndex?: number): IKeyObjectValue[];
12
16
  }
@@ -8968,6 +8968,14 @@ else
8968
8968
  ],
8969
8969
  displayType: "const int"
8970
8970
  },
8971
+ {
8972
+ name: "calc_bars_count",
8973
+ desc: `Limits the initial calculation of a script to the last number of bars specified. When specified, a "Calculated bars" field will be included in the "Calculation" section of the script's "Settings/Inputs" tab. Optional. The default is 0, in which case the script executes on all available bars.`,
8974
+ allowedTypeIDs: [
8975
+ "const int"
8976
+ ],
8977
+ displayType: "const int"
8978
+ },
8971
8979
  {
8972
8980
  name: "max_polylines_count",
8973
8981
  desc: "The number of last [polyline](#op_polyline) drawings displayed. Possible values: 1-100. The count is approximate; more drawings than the specified count may be displayed. Optional. The default is 50.",
@@ -64579,7 +64587,7 @@ class Og {
64579
64587
  });
64580
64588
  }
64581
64589
  gotoLine() {
64582
- this._editor.trigger("click", "editor.action.gotoLine", null);
64590
+ this._editor.focus(), this._editor.trigger("click", "editor.action.gotoLine", null);
64583
64591
  }
64584
64592
  onChangeCursorPosition(s) {
64585
64593
  this._changPositionListener && this._changPositionListener.dispose();
@@ -64832,11 +64840,11 @@ function Zr(n, s, a) {
64832
64840
  function Gg() {
64833
64841
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
64834
64842
  }
64835
- const Rc = new Worker(new URL("" + new URL("assets/scriptsRunWorker-CSDMAOri.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
64843
+ const Rc = new Worker(new URL("" + new URL("assets/scriptsRunWorker-7VRMTphe.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
64836
64844
  Rc.onerror = (n) => {
64837
64845
  console.error(n);
64838
64846
  };
64839
- const Xg = Dn(Rc), Kg = Dn(new Worker(new URL("" + new URL("assets/parserTccWorker-CFBnUzVu.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
64847
+ const Xg = Dn(Rc), Kg = Dn(new Worker(new URL("" + new URL("assets/parserTccWorker-D6nS9GYX.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
64840
64848
  async function Yg(n, s = !1) {
64841
64849
  const { functions: a, types: l, constants: u, variables: p, methods: m } = yr;
64842
64850
  return await Kg(n, s, { functions: Object.fromEntries(a), methods: Object.fromEntries(m), types: Object.fromEntries(l), constants: Object.fromEntries(u), variables: Object.fromEntries(p) });
@@ -64873,15 +64881,9 @@ const Zg = ({ height: n, width: s, theme: a, options: l, hasDiff: u, onChange: p
64873
64881
  }
64874
64882
  const k = Us(async (R) => {
64875
64883
  var Ne;
64876
- const L = Date.now(), { errors: Z, functions: ue, methods: J, types: Te, variables: ie, overloadsFuncs: X, preParserCode: oe } = await Yg(R, !0);
64884
+ const L = Date.now(), { errors: Z, functions: ue, methods: J, types: Te, variables: ie, overloadsFuncs: X, preParserCode: oe } = await Yg(R);
64877
64885
  try {
64878
- const ve = await Qg(oe, { isPreParser: !0, data: [{
64879
- time: 1473811200,
64880
- open: 0.7459,
64881
- high: 0.7496,
64882
- low: 0.7447,
64883
- close: 0.747
64884
- }] });
64886
+ const ve = await Qg(oe, { isPreParser: !0 });
64885
64887
  console.log(ve), m && m(ve);
64886
64888
  } catch (ve) {
64887
64889
  console.log(ve, "==================error- Run TccScript Server");