@guihz/trading-vue-editor-tes 0.1.63 → 0.1.64
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.
- package/lib/assets/{parserTccWorker-Bpuz4vCT.js → parserTccWorker-DLW4EDz8.js} +1 -1
- package/lib/assets/{scriptsRunWorker-DvjQUdYy.js → scriptsRunWorker-CdLcsxed.js} +60 -60
- package/lib/{index-BbiLUn2Q.js → index-uQBbhisX.js} +192 -148
- package/lib/{monarchTokens-C6rWa3Gt.js → monarchTokens-D4b8bJF0.js} +1 -1
- package/lib/trading-vue-editor.es.packages.js +364 -364
- package/lib/trading-vue-editor.umd.packages.mjs +34 -34
- package/package.json +1 -1
|
@@ -98497,7 +98497,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
|
98497
98497
|
const C = `var ${E} = Date.now()`;
|
|
98498
98498
|
let K = `for (let ${s}=${q};(${this._prefixNameVar}.compareDataHandle(${s}) - ${R}) * ${z} >= 0; ${s}-=(${S || "1"}) * ${z}){
|
|
98499
98499
|
if (Date.now() - ${E} > 500) {
|
|
98500
|
-
throw new Error('${d0.loopRuntimeErr}')
|
|
98500
|
+
throw new Error('${d0.loopRuntimeErr}-${p.start.line}')
|
|
98501
98501
|
}
|
|
98502
98502
|
${x}++
|
|
98503
98503
|
${L}
|
|
@@ -45024,11 +45024,11 @@ ${z}`), z;
|
|
|
45024
45024
|
const t = e.hasOwnProperty("replacement"), { source: r, replacement: i } = e;
|
|
45025
45025
|
return r !== void 0 && !(typeof r == "number" && isNaN(r)) ? r : t ? i : 0;
|
|
45026
45026
|
}
|
|
45027
|
-
time({ timeframe: e = "", session: t, timezone: r = this._variables.syminfo.timezone, bars_back: i = 0 },
|
|
45028
|
-
return this._timeHandle(this._variables.time,
|
|
45027
|
+
time({ timeframe: e = "", session: t, timezone: r = this._variables.syminfo.timezone, bars_back: i = 0, timeframe_bars_back: s = 0 }, o) {
|
|
45028
|
+
return this._timeHandle(this._variables.time, o, e, t, r, i, s);
|
|
45029
45029
|
}
|
|
45030
|
-
time_close({ timeframe: e = "", session: t, timezone: r = this._variables.syminfo.timezone, bars_back: i = 0 },
|
|
45031
|
-
return this._timeHandle(this._variables.time,
|
|
45030
|
+
time_close({ timeframe: e = "", session: t, timezone: r = this._variables.syminfo.timezone, bars_back: i = 0, timeframe_bars_back: s = 0 }, o) {
|
|
45031
|
+
return this._timeHandle(this._variables.time, o, e, t, r, i, s, !0);
|
|
45032
45032
|
}
|
|
45033
45033
|
timestamp(e) {
|
|
45034
45034
|
const { dateString: t, timezone: r = this._variables.syminfo.timezone, year: i, month: s, day: o, hour: a = 0, minute: c = 0, second: p = 0 } = e;
|
|
@@ -45070,96 +45070,96 @@ ${z}`), z;
|
|
|
45070
45070
|
const r = this._variables.getTimeTradingday(e, this._variables.timeframe.period), i = I0(t, e) * 1e3;
|
|
45071
45071
|
return e - r - Math.floor((e - r) / i) * i;
|
|
45072
45072
|
}
|
|
45073
|
-
_timeHandle(e, t, r = "", i, s, o = 0, a = !1) {
|
|
45074
|
-
const
|
|
45075
|
-
let
|
|
45076
|
-
if (s = s?.trim(),
|
|
45077
|
-
|
|
45073
|
+
_timeHandle(e, t, r = "", i, s, o = 0, a = 0, c = !1) {
|
|
45074
|
+
const p = r || this._variables.__period, b = I0(p, e), M = I0(this._variables.__period, e);
|
|
45075
|
+
let l;
|
|
45076
|
+
if (s = s?.trim(), b <= M)
|
|
45077
|
+
l = e, c && (l += M * 1e3);
|
|
45078
45078
|
else {
|
|
45079
|
-
const
|
|
45080
|
-
if (
|
|
45081
|
-
const { unit:
|
|
45082
|
-
switch (
|
|
45079
|
+
const z = `time_${t}`, O = this._cacheData[z];
|
|
45080
|
+
if (O) {
|
|
45081
|
+
const { unit: d } = O;
|
|
45082
|
+
switch (O.type) {
|
|
45083
45083
|
case 1:
|
|
45084
|
-
const { time:
|
|
45085
|
-
e >=
|
|
45084
|
+
const { time: _, nextTime: f, preNum: A } = O;
|
|
45085
|
+
e >= f ? (l = f, this._cacheData[z] = {
|
|
45086
45086
|
type: 1,
|
|
45087
|
-
time:
|
|
45088
|
-
nextTime: p0(
|
|
45089
|
-
unit:
|
|
45090
|
-
preNum:
|
|
45091
|
-
}) :
|
|
45087
|
+
time: l,
|
|
45088
|
+
nextTime: p0(f).add(A, d).startOf(d).add(this._variables._offsetTime, "hour").valueOf(),
|
|
45089
|
+
unit: d,
|
|
45090
|
+
preNum: A
|
|
45091
|
+
}) : l = _;
|
|
45092
45092
|
break;
|
|
45093
45093
|
case 2:
|
|
45094
|
-
|
|
45094
|
+
l = p0(e).startOf(d).add(this._variables._offsetTime, "hour").valueOf();
|
|
45095
45095
|
break;
|
|
45096
45096
|
case 4:
|
|
45097
|
-
this._variables.__isWeekChange &&
|
|
45097
|
+
this._variables.__isWeekChange && d === "w" || this._variables.__isMonthChange && d === "M" ? (l = e, this._cacheData[z] = {
|
|
45098
45098
|
type: 4,
|
|
45099
|
-
time:
|
|
45100
|
-
unit:
|
|
45101
|
-
}) :
|
|
45099
|
+
time: l,
|
|
45100
|
+
unit: d
|
|
45101
|
+
}) : l = O.time;
|
|
45102
45102
|
break;
|
|
45103
45103
|
default:
|
|
45104
|
-
|
|
45104
|
+
O.currentTime + b * 1e3 - O.offset <= e ? (l = e, this._cacheData[z] = {
|
|
45105
45105
|
type: 3,
|
|
45106
45106
|
currentTime: e,
|
|
45107
45107
|
offset: 0
|
|
45108
|
-
}) :
|
|
45108
|
+
}) : l = O.currentTime;
|
|
45109
45109
|
break;
|
|
45110
45110
|
}
|
|
45111
45111
|
} else {
|
|
45112
|
-
const [
|
|
45113
|
-
if (/[DWM]/.test(
|
|
45114
|
-
if (
|
|
45115
|
-
(this._variables.__isWeekChange &&
|
|
45112
|
+
const [d, _] = Me(p);
|
|
45113
|
+
if (/[DWM]/.test(p))
|
|
45114
|
+
if (l = p0(e).startOf(_).add(this._variables._offsetTime, "hour").valueOf(), !c && d === 1 && ["w", "M"].includes(_))
|
|
45115
|
+
(this._variables.__isWeekChange && _ === "w" || this._variables.__isMonthChange && _ === "M") && (l = e), this._cacheData[z] = {
|
|
45116
45116
|
type: 4,
|
|
45117
|
-
time:
|
|
45118
|
-
unit:
|
|
45117
|
+
time: l,
|
|
45118
|
+
unit: _
|
|
45119
45119
|
};
|
|
45120
|
-
else if (
|
|
45121
|
-
const
|
|
45122
|
-
this._cacheData[
|
|
45120
|
+
else if (d > 1) {
|
|
45121
|
+
const f = p0(l).add(d, _).startOf(_).add(this._variables._offsetTime, "hour").valueOf();
|
|
45122
|
+
this._cacheData[z] = {
|
|
45123
45123
|
type: 1,
|
|
45124
|
-
time:
|
|
45125
|
-
nextTime:
|
|
45126
|
-
unit:
|
|
45127
|
-
preNum:
|
|
45124
|
+
time: l,
|
|
45125
|
+
nextTime: f,
|
|
45126
|
+
unit: _,
|
|
45127
|
+
preNum: d
|
|
45128
45128
|
};
|
|
45129
45129
|
} else
|
|
45130
|
-
this._cacheData[
|
|
45130
|
+
this._cacheData[z] = {
|
|
45131
45131
|
type: 2,
|
|
45132
|
-
unit:
|
|
45132
|
+
unit: _
|
|
45133
45133
|
};
|
|
45134
45134
|
else {
|
|
45135
|
-
const
|
|
45136
|
-
this._cacheData[
|
|
45135
|
+
const f = this._calcTimeOffset(e, p);
|
|
45136
|
+
this._cacheData[z] = {
|
|
45137
45137
|
type: 3,
|
|
45138
45138
|
currentTime: e,
|
|
45139
|
-
offset:
|
|
45140
|
-
},
|
|
45139
|
+
offset: f
|
|
45140
|
+
}, l = e;
|
|
45141
45141
|
}
|
|
45142
45142
|
}
|
|
45143
|
-
|
|
45143
|
+
c && (l += b * 1e3);
|
|
45144
45144
|
}
|
|
45145
45145
|
if (typeof o == "string" && (i === void 0 ? i = o : s = o, o = 0), i && i !== ts.regular && i !== ts.extended) {
|
|
45146
|
-
const { timePeriods:
|
|
45147
|
-
let
|
|
45148
|
-
const
|
|
45149
|
-
|
|
45150
|
-
for (const
|
|
45151
|
-
const [
|
|
45152
|
-
let
|
|
45153
|
-
const
|
|
45154
|
-
if ((
|
|
45155
|
-
|
|
45146
|
+
const { timePeriods: z, weeks: O } = this._parserSession(i, t), d = z1(e, s), _ = d.format("YYYY-MM-DD HH:mm");
|
|
45147
|
+
let f = d.format("YYYY-MM-DD");
|
|
45148
|
+
const A = Number(d.format("HHmm"));
|
|
45149
|
+
l = void 0;
|
|
45150
|
+
for (const m of z) {
|
|
45151
|
+
const [W, v] = m;
|
|
45152
|
+
let y = f;
|
|
45153
|
+
const N = Number(W?.replace(":", "")), w = Number(v?.replace(":", ""));
|
|
45154
|
+
if ((W === v || N > w) && (A >= N ? y = d.add(1, "day").format("YYYY-MM-DD") : A < w && (f = d.subtract(1, "day").format("YYYY-MM-DD"))), z1(_, s).isBetween(`${f} ${W}`, `${y} ${v}`, "minute", "[)")) {
|
|
45155
|
+
l = ps(`${f} ${W}`, s);
|
|
45156
45156
|
break;
|
|
45157
45157
|
}
|
|
45158
45158
|
}
|
|
45159
|
-
const
|
|
45160
|
-
|
|
45159
|
+
const q = this._variables.dayofweek;
|
|
45160
|
+
l && !O.includes(q) && (l = void 0);
|
|
45161
45161
|
}
|
|
45162
|
-
return Number(
|
|
45162
|
+
return Number(l && l - o * M * 1e3 - a * b * 1e3);
|
|
45163
45163
|
}
|
|
45164
45164
|
_seriesColorHandle(e, t, r) {
|
|
45165
45165
|
if (r && t?.length)
|
|
@@ -24499,93 +24499,93 @@ else
|
|
|
24499
24499
|
// "series string"
|
|
24500
24500
|
// ]
|
|
24501
24501
|
// },
|
|
24502
|
-
{
|
|
24503
|
-
|
|
24504
|
-
|
|
24505
|
-
|
|
24506
|
-
|
|
24507
|
-
|
|
24508
|
-
|
|
24509
|
-
|
|
24510
|
-
|
|
24511
|
-
|
|
24512
|
-
|
|
24513
|
-
|
|
24514
|
-
|
|
24515
|
-
|
|
24516
|
-
|
|
24517
|
-
|
|
24518
|
-
|
|
24519
|
-
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24524
|
-
|
|
24525
|
-
|
|
24526
|
-
|
|
24527
|
-
|
|
24528
|
-
|
|
24529
|
-
|
|
24530
|
-
|
|
24531
|
-
|
|
24532
|
-
|
|
24533
|
-
|
|
24534
|
-
|
|
24535
|
-
|
|
24536
|
-
|
|
24537
|
-
|
|
24538
|
-
|
|
24539
|
-
|
|
24540
|
-
|
|
24541
|
-
|
|
24542
|
-
|
|
24543
|
-
|
|
24544
|
-
|
|
24545
|
-
|
|
24546
|
-
|
|
24547
|
-
|
|
24548
|
-
|
|
24549
|
-
|
|
24550
|
-
|
|
24551
|
-
|
|
24552
|
-
|
|
24553
|
-
|
|
24554
|
-
|
|
24555
|
-
|
|
24556
|
-
|
|
24557
|
-
|
|
24558
|
-
|
|
24559
|
-
|
|
24560
|
-
|
|
24561
|
-
|
|
24562
|
-
|
|
24563
|
-
|
|
24564
|
-
|
|
24565
|
-
|
|
24566
|
-
|
|
24567
|
-
|
|
24568
|
-
|
|
24569
|
-
|
|
24570
|
-
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
24574
|
-
|
|
24575
|
-
|
|
24576
|
-
|
|
24577
|
-
|
|
24578
|
-
|
|
24579
|
-
|
|
24580
|
-
|
|
24581
|
-
|
|
24582
|
-
|
|
24583
|
-
|
|
24584
|
-
|
|
24585
|
-
|
|
24586
|
-
|
|
24587
|
-
|
|
24588
|
-
},
|
|
24502
|
+
// {
|
|
24503
|
+
// "name": "time",
|
|
24504
|
+
// "desc": [
|
|
24505
|
+
// "time函数返回指定时间范围和交易时段的当前K线的UNIX时间,如果时间点不在交易时段中,则返回NaN。"
|
|
24506
|
+
// ],
|
|
24507
|
+
// "args": [
|
|
24508
|
+
// {
|
|
24509
|
+
// "name": "timeframe",
|
|
24510
|
+
// "desc": "时间周期。空字符串被解释为图表的当前时间周期。",
|
|
24511
|
+
// "required": true,
|
|
24512
|
+
// "allowedTypeIDs": [
|
|
24513
|
+
// "series string",
|
|
24514
|
+
// "simple string",
|
|
24515
|
+
// "input string",
|
|
24516
|
+
// "const string"
|
|
24517
|
+
// ],
|
|
24518
|
+
// "displayType": "series string"
|
|
24519
|
+
// },
|
|
24520
|
+
// {
|
|
24521
|
+
// "name": "bars_back",
|
|
24522
|
+
// "desc": "可选。脚本主时间周期内的K线偏移量。如果该值为正数,则该函数检索主时间周期内相对于当前K线的N根K线的时间戳。如果该值为-1到-500之间的负数,则该函数检索该时间周期内未来K线的预期时间。默认值为0。",
|
|
24523
|
+
// "allowedTypeIDs": [
|
|
24524
|
+
// "series int",
|
|
24525
|
+
// "simple int",
|
|
24526
|
+
// "input int",
|
|
24527
|
+
// "const int"
|
|
24528
|
+
// ],
|
|
24529
|
+
// "displayType": "series int"
|
|
24530
|
+
// }
|
|
24531
|
+
// ],
|
|
24532
|
+
// "detailedDesc": [
|
|
24533
|
+
// {
|
|
24534
|
+
// "desc": [],
|
|
24535
|
+
// "examples": [
|
|
24536
|
+
// "//@version=6",
|
|
24537
|
+
// "indicator(\"Time\", overlay=true)",
|
|
24538
|
+
// "// Try this on chart AAPL,1",
|
|
24539
|
+
// "timeinrange(res, sess) => not na(time(res, sess, \"America/New_York\")) ? 1 : 0",
|
|
24540
|
+
// "plot(timeinrange(\"1\", \"1300-1400\"), color=color.red)",
|
|
24541
|
+
// "",
|
|
24542
|
+
// "// This plots 1.0 at every start of 10 minute bar on a 1 minute chart:",
|
|
24543
|
+
// "newbar(res) => ta.change(time(res)) == 0 ? 0 : 1",
|
|
24544
|
+
// "plot(newbar(\"10\"))"
|
|
24545
|
+
// ]
|
|
24546
|
+
// },
|
|
24547
|
+
// {
|
|
24548
|
+
// "desc": [
|
|
24549
|
+
// "当设置某个会话时,您不仅可以指定小时与分钟,也可以指定某一周内的日期。",
|
|
24550
|
+
// "如果没有指定日期,则认为交易时段设置为从星期日 (1) 到星期六 (7),即“1100-2000”与“1100-1200:1234567”相同。",
|
|
24551
|
+
// "",
|
|
24552
|
+
// "您可以通过指定日期来更改它。例如,对于每周7天交易且24小时交易时段的商品,以下脚本不会为周六和周日着色:"
|
|
24553
|
+
// ],
|
|
24554
|
+
// "examples": [
|
|
24555
|
+
// "//@version=6",
|
|
24556
|
+
// "indicator(\"Time\", overlay=true)",
|
|
24557
|
+
// "t1 = time(timeframe.period, \"0000-0000:23456\")",
|
|
24558
|
+
// "bgcolor(not na(t1) ? color.new(color.blue, 90) : na)"
|
|
24559
|
+
// ]
|
|
24560
|
+
// },
|
|
24561
|
+
// {
|
|
24562
|
+
// "desc": [
|
|
24563
|
+
// "一个`session`参数可以包含多个不同的交易时段,以逗号分隔。例如,以下脚本将突出显示从10:00到11:00以及从14:00到15:00(仅限工作日)的K线图:"
|
|
24564
|
+
// ],
|
|
24565
|
+
// "examples": [
|
|
24566
|
+
// "//@version=6",
|
|
24567
|
+
// "indicator(\"Time\", overlay=true)",
|
|
24568
|
+
// "t1 = time(timeframe.period, \"1000-1100,1400-1500:23456\")",
|
|
24569
|
+
// "bgcolor(not na(t1) ? color.new(color.blue, 90) : na)"
|
|
24570
|
+
// ]
|
|
24571
|
+
// }
|
|
24572
|
+
// ],
|
|
24573
|
+
// "returns": [
|
|
24574
|
+
// "Unix时间。"
|
|
24575
|
+
// ],
|
|
24576
|
+
// "remarks": [
|
|
24577
|
+
// "UNIX时间是自1970年1月1日UTC 00:00:00起已经过去的毫秒数。"
|
|
24578
|
+
// ],
|
|
24579
|
+
// "seeAlso": [
|
|
24580
|
+
// "[time](#var_time) (variable)"
|
|
24581
|
+
// ],
|
|
24582
|
+
// "syntax": [
|
|
24583
|
+
// "time(timeframe, bars_back) → series int"
|
|
24584
|
+
// ],
|
|
24585
|
+
// "returnedTypes": [
|
|
24586
|
+
// "series int"
|
|
24587
|
+
// ]
|
|
24588
|
+
// },
|
|
24589
24589
|
{
|
|
24590
24590
|
name: "time",
|
|
24591
24591
|
desc: [
|
|
@@ -24626,6 +24626,17 @@ else
|
|
|
24626
24626
|
"const int"
|
|
24627
24627
|
],
|
|
24628
24628
|
displayType: "series int"
|
|
24629
|
+
},
|
|
24630
|
+
{
|
|
24631
|
+
name: "timeframe_bars_back",
|
|
24632
|
+
desc: "可选。在由timeframe参数指定的时间周期上,额外的K线偏移量。如果该值为正数,则函数会检索与bars_back偏移量对应的K线前Ntimeframe个K线的时间戳。如果该值为-1到-500之间的负数,则函数会计算对应bars_back偏移量的timeframe根K线之后Ntimeframe根K线的预期时间戳。默认值为0。",
|
|
24633
|
+
allowedTypeIDs: [
|
|
24634
|
+
"series int",
|
|
24635
|
+
"simple int",
|
|
24636
|
+
"input int",
|
|
24637
|
+
"const int"
|
|
24638
|
+
],
|
|
24639
|
+
displayType: "series int"
|
|
24629
24640
|
}
|
|
24630
24641
|
],
|
|
24631
24642
|
detailedDesc: [
|
|
@@ -24679,7 +24690,7 @@ else
|
|
|
24679
24690
|
"[time](#var_time) (variable)"
|
|
24680
24691
|
],
|
|
24681
24692
|
syntax: [
|
|
24682
|
-
"time(timeframe, session, bars_back) → series int"
|
|
24693
|
+
"time(timeframe, session, bars_back, timeframe_bars_back) → series int"
|
|
24683
24694
|
],
|
|
24684
24695
|
returnedTypes: [
|
|
24685
24696
|
"series int"
|
|
@@ -24737,6 +24748,17 @@ else
|
|
|
24737
24748
|
"const int"
|
|
24738
24749
|
],
|
|
24739
24750
|
displayType: "series int"
|
|
24751
|
+
},
|
|
24752
|
+
{
|
|
24753
|
+
name: "timeframe_bars_back",
|
|
24754
|
+
desc: "可选。在由timeframe参数指定的时间周期上,额外的K线偏移量。如果该值为正数,则函数会检索与bars_back偏移量对应的K线前Ntimeframe个K线的时间戳。如果该值为-1到-500之间的负数,则函数会计算对应bars_back偏移量的timeframe根K线之后Ntimeframe根K线的预期时间戳。默认值为0。",
|
|
24755
|
+
allowedTypeIDs: [
|
|
24756
|
+
"series int",
|
|
24757
|
+
"simple int",
|
|
24758
|
+
"input int",
|
|
24759
|
+
"const int"
|
|
24760
|
+
],
|
|
24761
|
+
displayType: "series int"
|
|
24740
24762
|
}
|
|
24741
24763
|
],
|
|
24742
24764
|
detailedDesc: [
|
|
@@ -24790,69 +24812,69 @@ else
|
|
|
24790
24812
|
"[time](#var_time) (variable)"
|
|
24791
24813
|
],
|
|
24792
24814
|
syntax: [
|
|
24793
|
-
"time(timeframe, session, timezone, bars_back) → series int"
|
|
24794
|
-
],
|
|
24795
|
-
returnedTypes: [
|
|
24796
|
-
"series int"
|
|
24797
|
-
]
|
|
24798
|
-
},
|
|
24799
|
-
{
|
|
24800
|
-
name: "time_close",
|
|
24801
|
-
desc: [
|
|
24802
|
-
"返回指定时间周期和时段内当前K线收盘的UNIX时间,如果时间点不在时段内,则返回na。在报价图和基于价格的图表,例如砖形图、新价线、卡吉图、点数图和范围图上,此函数返回最新实时K线的[na](#var_na)时间戳(因为未来的收盘时间不可预测),但返回任何前一根K线的有效时间戳。"
|
|
24803
|
-
],
|
|
24804
|
-
args: [
|
|
24805
|
-
{
|
|
24806
|
-
name: "timeframe",
|
|
24807
|
-
desc: "时间周期。空字符串将被解释为图表的当前时间周期。",
|
|
24808
|
-
required: !0,
|
|
24809
|
-
allowedTypeIDs: [
|
|
24810
|
-
"series string",
|
|
24811
|
-
"simple string",
|
|
24812
|
-
"input string",
|
|
24813
|
-
"const string"
|
|
24814
|
-
],
|
|
24815
|
-
displayType: "series string"
|
|
24816
|
-
},
|
|
24817
|
-
{
|
|
24818
|
-
name: "bars_back",
|
|
24819
|
-
desc: "可选。脚本主时间周期内的K线偏移量。如果该值为正数,则该函数检索主时间周期内相对于当前K线的N根K线的时间戳。如果该值为-1到-500之间的负数,则该函数检索该时间周期内未来K线的预期时间。默认值为0。",
|
|
24820
|
-
allowedTypeIDs: [
|
|
24821
|
-
"series int",
|
|
24822
|
-
"simple int",
|
|
24823
|
-
"input int",
|
|
24824
|
-
"const int"
|
|
24825
|
-
],
|
|
24826
|
-
displayType: "series int"
|
|
24827
|
-
}
|
|
24828
|
-
],
|
|
24829
|
-
detailedDesc: [
|
|
24830
|
-
{
|
|
24831
|
-
desc: [],
|
|
24832
|
-
examples: [
|
|
24833
|
-
"//@version=6",
|
|
24834
|
-
'indicator("Time", overlay=true)',
|
|
24835
|
-
't1 = time_close(timeframe.period, "1200-1300", "America/New_York")',
|
|
24836
|
-
"bgcolor(not na(t1) ? color.new(color.blue, 90) : na)"
|
|
24837
|
-
]
|
|
24838
|
-
}
|
|
24839
|
-
],
|
|
24840
|
-
returns: [
|
|
24841
|
-
"Unix时间。"
|
|
24842
|
-
],
|
|
24843
|
-
remarks: [
|
|
24844
|
-
"UNIX时间是自1970年1月1日UTC 00:00:00起已经过去的毫秒数。"
|
|
24845
|
-
],
|
|
24846
|
-
seeAlso: [
|
|
24847
|
-
"[time_close](#var_time_close) (variable)"
|
|
24848
|
-
],
|
|
24849
|
-
syntax: [
|
|
24850
|
-
"time_close(timeframe, bars_back) → series int"
|
|
24815
|
+
"time(timeframe, session, timezone, bars_back, timeframe_bars_back) → series int"
|
|
24851
24816
|
],
|
|
24852
24817
|
returnedTypes: [
|
|
24853
24818
|
"series int"
|
|
24854
24819
|
]
|
|
24855
24820
|
},
|
|
24821
|
+
// {
|
|
24822
|
+
// "name": "time_close",
|
|
24823
|
+
// "desc": [
|
|
24824
|
+
// "返回指定时间周期和时段内当前K线收盘的UNIX时间,如果时间点不在时段内,则返回na。在报价图和基于价格的图表,例如砖形图、新价线、卡吉图、点数图和范围图上,此函数返回最新实时K线的[na](#var_na)时间戳(因为未来的收盘时间不可预测),但返回任何前一根K线的有效时间戳。"
|
|
24825
|
+
// ],
|
|
24826
|
+
// "args": [
|
|
24827
|
+
// {
|
|
24828
|
+
// "name": "timeframe",
|
|
24829
|
+
// "desc": "时间周期。空字符串将被解释为图表的当前时间周期。",
|
|
24830
|
+
// "required": true,
|
|
24831
|
+
// "allowedTypeIDs": [
|
|
24832
|
+
// "series string",
|
|
24833
|
+
// "simple string",
|
|
24834
|
+
// "input string",
|
|
24835
|
+
// "const string"
|
|
24836
|
+
// ],
|
|
24837
|
+
// "displayType": "series string"
|
|
24838
|
+
// },
|
|
24839
|
+
// {
|
|
24840
|
+
// "name": "bars_back",
|
|
24841
|
+
// "desc": "可选。脚本主时间周期内的K线偏移量。如果该值为正数,则该函数检索主时间周期内相对于当前K线的N根K线的时间戳。如果该值为-1到-500之间的负数,则该函数检索该时间周期内未来K线的预期时间。默认值为0。",
|
|
24842
|
+
// "allowedTypeIDs": [
|
|
24843
|
+
// "series int",
|
|
24844
|
+
// "simple int",
|
|
24845
|
+
// "input int",
|
|
24846
|
+
// "const int"
|
|
24847
|
+
// ],
|
|
24848
|
+
// "displayType": "series int"
|
|
24849
|
+
// }
|
|
24850
|
+
// ],
|
|
24851
|
+
// "detailedDesc": [
|
|
24852
|
+
// {
|
|
24853
|
+
// "desc": [],
|
|
24854
|
+
// "examples": [
|
|
24855
|
+
// "//@version=6",
|
|
24856
|
+
// "indicator(\"Time\", overlay=true)",
|
|
24857
|
+
// "t1 = time_close(timeframe.period, \"1200-1300\", \"America/New_York\")",
|
|
24858
|
+
// "bgcolor(not na(t1) ? color.new(color.blue, 90) : na)"
|
|
24859
|
+
// ]
|
|
24860
|
+
// }
|
|
24861
|
+
// ],
|
|
24862
|
+
// "returns": [
|
|
24863
|
+
// "Unix时间。"
|
|
24864
|
+
// ],
|
|
24865
|
+
// "remarks": [
|
|
24866
|
+
// "UNIX时间是自1970年1月1日UTC 00:00:00起已经过去的毫秒数。"
|
|
24867
|
+
// ],
|
|
24868
|
+
// "seeAlso": [
|
|
24869
|
+
// "[time_close](#var_time_close) (variable)"
|
|
24870
|
+
// ],
|
|
24871
|
+
// "syntax": [
|
|
24872
|
+
// "time_close(timeframe, bars_back) → series int"
|
|
24873
|
+
// ],
|
|
24874
|
+
// "returnedTypes": [
|
|
24875
|
+
// "series int"
|
|
24876
|
+
// ]
|
|
24877
|
+
// },
|
|
24856
24878
|
{
|
|
24857
24879
|
name: "time_close",
|
|
24858
24880
|
desc: [
|
|
@@ -24893,6 +24915,17 @@ else
|
|
|
24893
24915
|
"const int"
|
|
24894
24916
|
],
|
|
24895
24917
|
displayType: "series int"
|
|
24918
|
+
},
|
|
24919
|
+
{
|
|
24920
|
+
name: "timeframe_bars_back",
|
|
24921
|
+
desc: "可选。在由timeframe参数指定的时间周期上,额外的K线偏移量。如果该值为正数,则函数会检索与bars_back偏移量对应的K线前Ntimeframe个K线的时间戳。如果该值为-1到-500之间的负数,则函数会计算对应bars_back偏移量的timeframe根K线之后Ntimeframe根K线的预期时间戳。默认值为0。",
|
|
24922
|
+
allowedTypeIDs: [
|
|
24923
|
+
"series int",
|
|
24924
|
+
"simple int",
|
|
24925
|
+
"input int",
|
|
24926
|
+
"const int"
|
|
24927
|
+
],
|
|
24928
|
+
displayType: "series int"
|
|
24896
24929
|
}
|
|
24897
24930
|
],
|
|
24898
24931
|
detailedDesc: [
|
|
@@ -24916,7 +24949,7 @@ else
|
|
|
24916
24949
|
"[time_close](#var_time_close) (variable)"
|
|
24917
24950
|
],
|
|
24918
24951
|
syntax: [
|
|
24919
|
-
"time_close(timeframe, session, bars_back) → series int"
|
|
24952
|
+
"time_close(timeframe, session, bars_back, timeframe_bars_back) → series int"
|
|
24920
24953
|
],
|
|
24921
24954
|
returnedTypes: [
|
|
24922
24955
|
"series int"
|
|
@@ -24974,6 +25007,17 @@ else
|
|
|
24974
25007
|
"const int"
|
|
24975
25008
|
],
|
|
24976
25009
|
displayType: "series int"
|
|
25010
|
+
},
|
|
25011
|
+
{
|
|
25012
|
+
name: "timeframe_bars_back",
|
|
25013
|
+
desc: "可选。在由timeframe参数指定的时间周期上,额外的K线偏移量。如果该值为正数,则函数会检索与bars_back偏移量对应的K线前Ntimeframe个K线的时间戳。如果该值为-1到-500之间的负数,则函数会计算对应bars_back偏移量的timeframe根K线之后Ntimeframe根K线的预期时间戳。默认值为0。",
|
|
25014
|
+
allowedTypeIDs: [
|
|
25015
|
+
"series int",
|
|
25016
|
+
"simple int",
|
|
25017
|
+
"input int",
|
|
25018
|
+
"const int"
|
|
25019
|
+
],
|
|
25020
|
+
displayType: "series int"
|
|
24977
25021
|
}
|
|
24978
25022
|
],
|
|
24979
25023
|
detailedDesc: [
|
|
@@ -24997,7 +25041,7 @@ else
|
|
|
24997
25041
|
"[time_close](#var_time_close) (variable)"
|
|
24998
25042
|
],
|
|
24999
25043
|
syntax: [
|
|
25000
|
-
"time_close(timeframe, session, timezone, bars_back) → series int"
|
|
25044
|
+
"time_close(timeframe, session, timezone, bars_back, timeframe_bars_back) → series int"
|
|
25001
25045
|
],
|
|
25002
25046
|
returnedTypes: [
|
|
25003
25047
|
"series int"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KEY_LIST as l } from "./index-
|
|
1
|
+
import { KEY_LIST as l } from "./index-uQBbhisX.js";
|
|
2
2
|
const g = "tccScript", u = {
|
|
3
3
|
// builtinFunctions: /strategy\.closedtrades\.max_drawdown_percent|strategy\.opentrades\.max_drawdown_percent|strategy\.risk\.max_intraday_filled_orders|strategy\.closedtrades\.max_runup_percent|array\.percentile_linear_interpolation|strategy\.closedtrades\.entry_bar_index|strategy\.opentrades\.max_runup_percent|strategy\.closedtrades\.exit_bar_index|strategy\.closedtrades\.profit_percent|strategy\.closedtrades\.entry_comment|strategy\.opentrades\.entry_bar_index|strategy\.closedtrades\.exit_comment|strategy\.closedtrades\.max_drawdown|strategy\.opentrades\.profit_percent|ta\.percentile_linear_interpolation|strategy\.closedtrades\.entry_price|strategy\.opentrades\.entry_comment|strategy\.closedtrades\.commission|strategy\.closedtrades\.entry_time|strategy\.closedtrades\.exit_price|strategy\.opentrades\.max_drawdown|strategy\.risk\.max_cons_loss_days|strategy\.closedtrades\.exit_time|strategy\.closedtrades\.max_runup|strategy\.opentrades\.entry_price|strategy\.risk\.max_intraday_loss|strategy\.risk\.max_position_size|table\.cell_set_text_font_family|strategy\.closedtrades\.entry_id|strategy\.opentrades\.commission|strategy\.opentrades\.entry_time|array\.binary_search_rightmost|array\.percentile_nearest_rank|strategy\.closedtrades\.exit_id|strategy\.opentrades\.max_runup|array\.binary_search_leftmost|strategy\.closedtrades\.profit|strategy\.opentrades\.entry_id|strategy\.risk\.allow_entry_in|strategy\.convert_to_account|box\.set_bottom_right_point|label\.set_text_font_family|strategy\.closedtrades\.size|strategy\.convert_to_symbol|strategy\.default_entry_qty|strategy\.opentrades\.profit|strategy\.risk\.max_drawdown|ta\.percentile_nearest_rank|table\.cell_set_text_halign|table\.cell_set_text_valign|request\.security_lower_tf|table\.cell_set_text_color|box\.set_text_font_family|strategy\.opentrades\.size|table\.cell_set_text_size|matrix\.is_antisymmetric|box\.set_top_left_point|chart\.point\.from_index|matrix\.is_antidiagonal|table\.cell_set_bgcolor|table\.cell_set_tooltip|table\.set_border_color|table\.set_border_width|timeframe\.from_seconds|chart\.point\.from_time|line\.set_second_point|math\.round_to_mintick|matrix\.elements_count|request\.currency_rate|ta\.pivot_point_levels|table\.cell_set_height|table\.set_frame_color|table\.set_frame_width|box\.set_border_color|box\.set_border_style|box\.set_border_width|line\.set_first_point|matrix\.is_stochastic|matrix\.is_triangular|table\.cell_set_width|timeframe\.in_seconds|array\.binary_search|box\.set_rightbottom|box\.set_text_halign|box\.set_text_valign|color\.from_gradient|label\.set_textalign|label\.set_textcolor|matrix\.eigenvectors|matrix\.is_symmetric|matrix\.swap_columns|strategy\.cancel_all|table\.cell_set_text|array\.new_linefill|array\.sort_indices|box\.set_text_color|linefill\.get_line1|linefill\.get_line2|linefill\.set_color|matrix\.eigenvalues|matrix\.is_diagonal|matrix\.is_identity|strategy\.close_all|table\.set_position|ticker\.pointfigure|array\.lastindexof|array\.percentrank|array\.standardize|box\.set_text_size|box\.set_text_wrap|label\.set_tooltip|matrix\.remove_col|matrix\.remove_row|request\.dividends|request\.financial|table\.merge_cells|table\.set_bgcolor|ticker\.heikinashi|array\.covariance|array\.new_string|chart\.point\.copy|matrix\.is_binary|matrix\.is_square|matrix\.submatrix|matrix\.swap_rows|matrix\.transpose|request\.earnings|request\.economic|request\.security|ticker\.linebreak|timeframe\.change|array\.new_color|array\.new_float|array\.new_label|array\.new_table|box\.set_bgcolor|box\.set_lefttop|chart\.point\.new|chart\.point\.now|input\.text_area|input\.timeframe|label\.set_color|label\.set_point|label\.set_style|line\.set_extend|linefill\.delete|polyline\.delete|str\.format_time|str\.replace_all|strategy\.cancel|ticker\.standard|alertcondition|array\.includes|array\.new_bool|array\.new_line|array\.variance|box\.get_bottom|box\.set_bottom|box\.set_extend|label\.get_text|label\.set_size|label\.set_text|label\.set_xloc|label\.set_yloc|line\.get_price|line\.set_color|line\.set_style|line\.set_width|math\.todegrees|math\.toradians|matrix\.add_col|matrix\.add_row|matrix\.columns|matrix\.is_zero|matrix\.reshape|matrix\.reverse|request\.quandl|request\.splits|str\.startswith|strategy\.close|strategy\.entry|strategy\.order|syminfo\.prefix|syminfo\.ticker|ta\.correlation|ta\.highestbars|ta\.percentrank|ticker\.inherit|array\.indexof|array\.new_box|array\.new_int|array\.reverse|array\.unshift|box\.get_right|box\.set_right|input\.session|line\.set_xloc|matrix\.concat|matrix\.median|max_bars_back|runtime\.error|str\.substring|strategy\.exit|ta\.crossunder|ta\.lowestbars|ta\.supertrend|ticker\.modify|array\.concat|array\.insert|array\.median|array\.remove|box\.get_left|box\.set_left|box\.set_text|input\.source|input\.string|input\.symbol|label\.delete|label\.set_xy|line\.set_xy1|line\.set_xy2|linefill\.new|map\.contains|matrix\.trace|polyline\.new|request\.seed|str\.contains|str\.endswith|str\.tonumber|str\.tostring|ta\.barssince|ta\.crossover|ta\.pivothigh|ta\.valuewhen|table\.delete|ticker\.renko|array\.clear|array\.every|array\.first|array\.range|array\.shift|array\.slice|array\.stdev|box\.get_top|box\.set_top|input\.color|input\.float|input\.price|label\.get_x|label\.get_y|label\.set_x|label\.set_y|line\.delete|line\.get_x1|line\.get_x2|line\.get_y1|line\.get_y2|line\.set_x1|line\.set_x2|line\.set_y1|line\.set_y2|log\.warning|map\.put_all|math\.random|matrix\.copy|matrix\.diff|matrix\.fill|matrix\.kron|matrix\.mode|matrix\.mult|matrix\.pinv|matrix\.rank|matrix\.rows|matrix\.sort|str\.replace|ta\.pivotlow|ta\.variance|table\.clear|ticker\.kagi|array\.copy|array\.fill|array\.from|array\.join|array\.last|array\.mode|array\.push|array\.size|array\.some|array\.sort|box\.delete|dayofmonth|input\.bool|input\.time|label\.copy|map\.remove|map\.values|math\.floor|math\.log10|math\.round|matrix\.avg|matrix\.col|matrix\.det|matrix\.get|matrix\.inv|matrix\.max|matrix\.min|matrix\.new|matrix\.pow|matrix\.row|matrix\.set|matrix\.sum|plotcandle|str\.format|str\.length|ta\.falling|ta\.highest|table\.cell|ticker\.new|time_close|weekofyear|array\.abs|array\.avg|array\.get|array\.max|array\.min|array\.new|array\.pop|array\.set|array\.sum|color\.new|color\.rgb|dayofweek|indicator|input\.int|label\.new|line\.copy|log\.error|map\.clear|math\.acos|math\.asin|math\.atan|input\.enum|math\.ceil|math\.sign|math\.sqrt|plotarrow|plotshape|str\.lower|str\.match|str\.split|str\.upper|ta\.change|ta\.linreg|ta\.lowest|ta\.median|ta\.rising|table\.new|timestamp|barcolor|box\.copy|line\.new|linefill|log\.info|map\.copy|map\.keys|map\.size|math\.abs|math\.avg|math\.cos|math\.exp|math\.log|math\.max|math\.min|math\.pow|math\.sin|math\.sum|math\.tan|plotchar|strategy|ta\.cross|ta\.range|ta\.stdev|ta\.stoch|bgcolor|box\.new|color\.b|color\.g|color\.r|color\.t|library|map\.get|map\.new|map\.put|plotbar|str\.pos|ta\.alma|ta\.macd|ta\.mode|ta\.swma|ta\.vwap|ta\.vwma|fixnan|minute|second|string|ta\.atr|ta\.bbw|ta\.cci|ta\.cmo|ta\.cog|ta\.cum|ta\.dev|ta\.dmi|ta\.ema|ta\.hma|ta\.kcw|ta\.max|ta\.mfi|ta\.min|ta\.mom|ta\.rma|ta\.roc|ta\.rsi|ta\.sar|ta\.sma|ta\.tsi|ta\.wma|ta\.wpr|alert|color|float|hline|input|label|month|ta\.bb|ta\.kc|ta\.tr|table|bool|fill|hour|line|plot|time|year|box|int|na|nz/,
|
|
4
4
|
builtinFunctions: new RegExp(i(l.functions)),
|