@guihz/trading-vue-editor-tes 0.1.25 → 0.1.27
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-B6TDhYXx.js → parserTccWorker-DOV8B1dj.js} +19 -9
- package/lib/assets/{scriptsRunWorker-Dpg-1H14.js → scriptsRunWorker-BGGO_qbx.js} +76 -53
- package/lib/components/editor/v3/parseScript/buildInVarNamespace/ta.d.ts +3 -0
- package/lib/{index-B2LF-839.js → index-D22ipYhi.js} +210 -209
- package/lib/{monarchTokens-Dzsc5GLx.js → monarchTokens-BkGYzRcP.js} +1 -1
- package/lib/trading-vue-editor.es.packages.js +4 -4
- package/lib/trading-vue-editor.umd.packages.mjs +31 -31
- package/package.json +1 -1
@@ -46,8 +46,8 @@ const n = {
|
|
46
46
|
name: "if",
|
47
47
|
desc: [
|
48
48
|
"If语句定义了在满足表达式条件时必须执行的语句块。",
|
49
|
-
"要访问和使用if语句,应在代码的第一行中指定>= 2的
|
50
|
-
"
|
49
|
+
"要访问和使用if语句,应在代码的第一行中指定>= 2的Mine Script®语言版本,例如://@version=6",
|
50
|
+
"Mine Script®语言的第四版允许您使用“else if”语法。",
|
51
51
|
"通用编码来自:"
|
52
52
|
],
|
53
53
|
syntax: [
|
@@ -438,7 +438,7 @@ else
|
|
438
438
|
{
|
439
439
|
desc: [
|
440
440
|
"哪里:",
|
441
|
-
"**variable_name** -
|
441
|
+
"**variable_name** - Mine Script®中允许的用户变量的任何名称(可以包含大写和小写拉丁字符、数字和下划线 (_),但不能以数字开头)。",
|
442
442
|
"**expression** - 任何算术表达式,就像定义常规变量一样。 将计算表达式并将其分配给变量一次。"
|
443
443
|
],
|
444
444
|
examples: [
|
@@ -485,7 +485,7 @@ else
|
|
485
485
|
desc: [
|
486
486
|
"哪里:",
|
487
487
|
"**variable_type** - 可选的基本类型([int](#type_int)、[float](#type_float)、[bool](#type_bool)、[color](#type_color)、[string](#type_string))或用户定义的类型,或者这些类型之一的数组或矩阵。特殊类型与此关键字不兼容。",
|
488
|
-
"**variable_name** - [有效标识符](https://www.
|
488
|
+
"**variable_name** - [有效标识符](https://www.tradingvue.com/mine-script-docs/language/identifiers/)。该变量也可以是从UDT创建的对象。",
|
489
489
|
"**expression** - 任何算术表达式,就像定义常规变量一样。表达式将仅在第一根K线上计算一次并分配给变量。",
|
490
490
|
"**UDT_identifier, field_type, field_name, value** - 与用户定义类型相关的构造,如[type](#kw_type)部分中所述。"
|
491
491
|
],
|
@@ -526,7 +526,7 @@ else
|
|
526
526
|
],
|
527
527
|
remarks: [
|
528
528
|
"当使用[varip](#kw_varip)声明策略中可能在每个历史图表K线上执行多次的变量时,这些变量的值将在同一根K线上的脚本连续迭代中保留。",
|
529
|
-
"[varip](#kw_varip)的作用,消除了在同一根K线上每次连续执行脚本之前变量的[回滚](https://www.
|
529
|
+
"[varip](#kw_varip)的作用,消除了在同一根K线上每次连续执行脚本之前变量的[回滚](https://www.tradingvue.com/mine-script-docs/language/execution-model/#calculation-based-on-realtime-bars)。"
|
530
530
|
]
|
531
531
|
},
|
532
532
|
{
|
@@ -570,7 +570,7 @@ else
|
|
570
570
|
"plot(y)"
|
571
571
|
],
|
572
572
|
remarks: [
|
573
|
-
"允许使用替换内置命名空间的别名,例如math.*或strategy.*,但如果脚本库包含隐藏
|
573
|
+
"允许使用替换内置命名空间的别名,例如math.*或strategy.*,但如果脚本库包含隐藏 Mine Script®内置函数的函数名称,则内置函数将不可用。同一版本的脚本库只能导入一次。 每个导入的脚本库别名必须不同。调用脚本库函数时,不允许将其参数转换为其声明类型以外的类型。import语句不能使用“as”或“import”作为`username`、`libraryName` 或`alias`标识符。"
|
574
574
|
],
|
575
575
|
seeAlso: [
|
576
576
|
"[library](#fun_library)",
|
@@ -677,7 +677,7 @@ else
|
|
677
677
|
"如果导出函数是阵列、可变变量(使用`:=`重新分配)或“input”形式的变量,则导出函数不能使用全局范围内的变量。",
|
678
678
|
"导出的函数不能使用 `request.*()` 函数。",
|
679
679
|
"导出的函数必须显式声明每个参数的类型,并且所有参数都必须在函数体中使用。默认情况下,传递给导出函数的所有参数都是[series](#type_series)形式,除非它们在函数的签名中明确指定为[simple](#type_simple)。",
|
680
|
-
"@description、@function、@param、@type、@field和@returns编译器注释用于自动生成库的描述和发行说明,以及
|
680
|
+
"@description、@function、@param、@type、@field和@returns编译器注释用于自动生成库的描述和发行说明,以及Mine Script®编辑器的工具提示。"
|
681
681
|
],
|
682
682
|
seeAlso: [
|
683
683
|
"[library](#fun_library)",
|
@@ -702,8 +702,8 @@ else
|
|
702
702
|
desc: [
|
703
703
|
"一旦定义了UDT,脚本就可以使用`UDT_identifier.new()`构造从中实例化对象。创建新类型实例时,生成的对象的字段将使用UDT定义中的默认值进行初始化。任何没有指定默认值的类型字段都将初始化为[na](#var_na)。或者,用户可以在`*.new()`方法中将初始值作为参数传递,以覆盖类型的默认值。例如,`newFooObject = foo.new(x = true)`将新的`foo`对象分配给`newFooObject` 变量,其`x`字段使用[true](#const_true)值进行初始化。",
|
704
704
|
"字段声明可以包含[varip](#kw_varip)关键字,在这种情况下,字段值在同一根K线上的连续脚本迭代之间保持不变。",
|
705
|
-
"有关详细信息,请参阅用户手册中关于[定义 UDT](https://www.
|
706
|
-
"脚本库可以导出UDT。请参阅我们的用户手册的[脚本库](https://www.
|
705
|
+
"有关详细信息,请参阅用户手册中关于[定义 UDT](https://www.tradingvue.com/mine-script-docs/language/type-system#user-defined-types)和[使用对象](https://www.tradingvue.com/mine-script-docs/language/objects/)的部分。",
|
706
|
+
"脚本库可以导出UDT。请参阅我们的用户手册的[脚本库](https://www.tradingvue.com/mine-script-docs/concepts/libraries/#user-defined-types-and-objects)页面,了解更多信息。"
|
707
707
|
],
|
708
708
|
examples: [
|
709
709
|
"//@version=6",
|
@@ -779,7 +779,7 @@ else
|
|
779
779
|
"// maintainArray(prices, 50, close)",
|
780
780
|
"",
|
781
781
|
"// This calls the `array.avg()` built-in using dot notation with the `prices` array.",
|
782
|
-
"// It is possible because built-in functions belonging to some namespaces that are a special
|
782
|
+
"// It is possible because built-in functions belonging to some namespaces that are a special Mine type",
|
783
783
|
"// can be invoked with method notation when the function's first parameter is an ID of that type.",
|
784
784
|
"// Those namespaces are: `array`, `matrix`, `line`, `linefill`, `label`, `box`, and `table`.",
|
785
785
|
"plot(prices.avg())"
|
@@ -1066,7 +1066,7 @@ else
|
|
1066
1066
|
"整数或浮点值,或一系列值。"
|
1067
1067
|
],
|
1068
1068
|
remarks: [
|
1069
|
-
"在
|
1069
|
+
"在Mine Script®中,计算整数余数时,商数会被截断,即向最低绝对值舍入。结果值将与股息具有相同的符号。",
|
1070
1070
|
"示例:`-1 % 9 = -1 - 9 * int(-1/9) = -1 - 9 * int(-0.111) = -1 - 9 * 0 = -1.`"
|
1071
1071
|
]
|
1072
1072
|
},
|
@@ -1197,7 +1197,7 @@ else
|
|
1197
1197
|
detailedDesc: [
|
1198
1198
|
{
|
1199
1199
|
desc: [
|
1200
|
-
"<local_block>是零个或多个
|
1200
|
+
"<local_block>是零个或多个Mine Script®语句。",
|
1201
1201
|
"<function_result>是一个变量、一个表达式或一个元组。"
|
1202
1202
|
],
|
1203
1203
|
examples: [
|
@@ -1215,7 +1215,7 @@ else
|
|
1215
1215
|
}
|
1216
1216
|
],
|
1217
1217
|
remarks: [
|
1218
|
-
"您可以在用户手册的[声明函数](https://www.
|
1218
|
+
"您可以在用户手册的[声明函数](https://www.tradingvue.com/mine-script-docs/language/user-defined-functions/)和[脚本库](https://www.tradingvue.com/mine-script-docs/concepts/libraries/)页面中了解有关用户定义函数的更多信息。"
|
1219
1219
|
]
|
1220
1220
|
}
|
1221
1221
|
],
|
@@ -1335,7 +1335,7 @@ else
|
|
1335
1335
|
remarks: [
|
1336
1336
|
"请注意,**bar_index**已替换版本4中的**n**变量。",
|
1337
1337
|
"请注意,K线索引从第一根历史K线起算为0。",
|
1338
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
1338
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
1339
1339
|
],
|
1340
1340
|
seeAlso: [
|
1341
1341
|
"[last_bar_index](#var_last_bar_index)",
|
@@ -1365,7 +1365,7 @@ else
|
|
1365
1365
|
"收盘的最后历史K线索引,或开盘的实时K线索引。"
|
1366
1366
|
],
|
1367
1367
|
remarks: [
|
1368
|
-
"请注意,使用此变量可能会导致[指标重绘](https://www.
|
1368
|
+
"请注意,使用此变量可能会导致[指标重绘](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
1369
1369
|
],
|
1370
1370
|
seeAlso: [
|
1371
1371
|
"[bar_index](#var_bar_index)",
|
@@ -1381,7 +1381,7 @@ else
|
|
1381
1381
|
"最后一根图表K线的UNIX格式的时间。它是自1970年1月1日00:00:00 UTC以来经过的毫秒数。"
|
1382
1382
|
],
|
1383
1383
|
remarks: [
|
1384
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
1384
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。",
|
1385
1385
|
"请注意,此变量根据K线的开盘时间返回时间戳。"
|
1386
1386
|
],
|
1387
1387
|
seeAlso: [
|
@@ -1422,7 +1422,7 @@ else
|
|
1422
1422
|
"plot(nz(close[1], close))"
|
1423
1423
|
],
|
1424
1424
|
remarks: [
|
1425
|
-
"请勿将此变量与[比较运算符](https://www.
|
1425
|
+
"请勿将此变量与[比较运算符](https://www.tradingvue.com/mine-script-docs/language/operators/#comparison-operators)一起使用来测试`na`的值,因为这可能会导致意外行为。相反,请使用[na](#fun_na)函数。请注意,当初始化语句还指定变量的类型时,可以使用`na`来初始化变量。"
|
1426
1426
|
],
|
1427
1427
|
seeAlso: [
|
1428
1428
|
"[na](#fun_na)",
|
@@ -1706,7 +1706,7 @@ else
|
|
1706
1706
|
'indicator("Intraday Intensity Index")',
|
1707
1707
|
"plot(ta.iii, color=color.yellow)",
|
1708
1708
|
"",
|
1709
|
-
"// the same on
|
1709
|
+
"// the same on mine",
|
1710
1710
|
"f_iii() =>",
|
1711
1711
|
" (2 * close - high - low) / ((high - low) * volume)",
|
1712
1712
|
"",
|
@@ -1724,7 +1724,7 @@ else
|
|
1724
1724
|
'indicator("Williams Variable Accumulation/Distribution")',
|
1725
1725
|
"plot(ta.wvad, color=color.yellow)",
|
1726
1726
|
"",
|
1727
|
-
"// the same on
|
1727
|
+
"// the same on mine",
|
1728
1728
|
"f_wvad() =>",
|
1729
1729
|
" (close - open) / (high - low) * volume",
|
1730
1730
|
"",
|
@@ -1742,7 +1742,7 @@ else
|
|
1742
1742
|
'indicator("Williams Accumulation/Distribution")',
|
1743
1743
|
"plot(ta.wad, color=color.yellow)",
|
1744
1744
|
"",
|
1745
|
-
"// the same on
|
1745
|
+
"// the same on mine",
|
1746
1746
|
"f_wad() =>",
|
1747
1747
|
" trueHigh = math.max(high, close[1])",
|
1748
1748
|
" trueLow = math.min(low, close[1])",
|
@@ -1764,7 +1764,7 @@ else
|
|
1764
1764
|
'indicator("On Balance Volume")',
|
1765
1765
|
"plot(ta.obv, color=color.yellow)",
|
1766
1766
|
"",
|
1767
|
-
"// the same on
|
1767
|
+
"// the same on mine",
|
1768
1768
|
"f_obv() =>",
|
1769
1769
|
" ta.cum(math.sign(ta.change(close)) * volume)",
|
1770
1770
|
"",
|
@@ -1782,7 +1782,7 @@ else
|
|
1782
1782
|
'indicator("Price-Volume Trend")',
|
1783
1783
|
"plot(ta.pvt, color=color.yellow)",
|
1784
1784
|
"",
|
1785
|
-
"// the same on
|
1785
|
+
"// the same on mine",
|
1786
1786
|
"f_pvt() =>",
|
1787
1787
|
" ta.cum((ta.change(close) / close[1]) * volume)",
|
1788
1788
|
"",
|
@@ -1801,7 +1801,7 @@ else
|
|
1801
1801
|
"",
|
1802
1802
|
"plot(ta.nvi, color=color.yellow)",
|
1803
1803
|
"",
|
1804
|
-
"// the same on
|
1804
|
+
"// the same on mine",
|
1805
1805
|
"f_nvi() =>",
|
1806
1806
|
" float ta_nvi = 1.0",
|
1807
1807
|
" float prevNvi = (nz(ta_nvi[1], 0.0) == 0.0) ? 1.0 : ta_nvi[1]",
|
@@ -1826,7 +1826,7 @@ else
|
|
1826
1826
|
"",
|
1827
1827
|
"plot(ta.pvi, color=color.yellow)",
|
1828
1828
|
"",
|
1829
|
-
"// the same on
|
1829
|
+
"// the same on mine",
|
1830
1830
|
"f_pvi() =>",
|
1831
1831
|
" float ta_pvi = 1.0",
|
1832
1832
|
" float prevPvi = (nz(ta_pvi[1], 0.0) == 0.0) ? 1.0 : ta_pvi[1]",
|
@@ -2993,7 +2993,7 @@ else
|
|
2993
2993
|
"UNIX格式的当前时间。 这是自1970年1月1日00:00:00 UTC以来的毫秒数。"
|
2994
2994
|
],
|
2995
2995
|
remarks: [
|
2996
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
2996
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
2997
2997
|
],
|
2998
2998
|
seeAlso: [
|
2999
2999
|
"[timestamp](#fun_timestamp)",
|
@@ -3857,8 +3857,8 @@ else
|
|
3857
3857
|
"如果当前k线为k线组的第一条k线,则返回true,否则返回false。"
|
3858
3858
|
],
|
3859
3859
|
remarks: [
|
3860
|
-
"使用此变量的
|
3861
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
3860
|
+
"使用此变量的Mine Script®代码可以对历史数据和实时数据进行不同的计算。",
|
3861
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
3862
3862
|
],
|
3863
3863
|
seeAlso: [
|
3864
3864
|
"[barstate.islast](#var_barstate.islast)",
|
@@ -3876,8 +3876,8 @@ else
|
|
3876
3876
|
"如果当前k线为k线组的最后一条k线,则返回true,否则返回false。"
|
3877
3877
|
],
|
3878
3878
|
remarks: [
|
3879
|
-
"使用此变量的
|
3880
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
3879
|
+
"使用此变量的Mine Script®代码可以对历史数据和实时数据进行不同的计算。",
|
3880
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
3881
3881
|
],
|
3882
3882
|
seeAlso: [
|
3883
3883
|
"[barstate.isfirst](#var_barstate.isfirst)",
|
@@ -3895,8 +3895,8 @@ else
|
|
3895
3895
|
"如果当前k线为历史k线,则返回true,否则返回false。"
|
3896
3896
|
],
|
3897
3897
|
remarks: [
|
3898
|
-
"使用此变量的
|
3899
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
3898
|
+
"使用此变量的Mine Script®代码可以对历史数据和实时数据进行不同的计算。",
|
3899
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
3900
3900
|
],
|
3901
3901
|
seeAlso: [
|
3902
3902
|
"[barstate.isfirst](#var_barstate.isfirst)",
|
@@ -3914,8 +3914,8 @@ else
|
|
3914
3914
|
"如果当前k线为实时k线,则返回true,否则返回false。"
|
3915
3915
|
],
|
3916
3916
|
remarks: [
|
3917
|
-
"使用此变量的
|
3918
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
3917
|
+
"使用此变量的Mine Script®代码可以对历史数据和实时数据进行不同的计算。",
|
3918
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
3919
3919
|
],
|
3920
3920
|
seeAlso: [
|
3921
3921
|
"[barstate.isfirst](#var_barstate.isfirst)",
|
@@ -3933,8 +3933,8 @@ else
|
|
3933
3933
|
"如果脚本目前在新k线上计算着,则返回true,否则返回false。"
|
3934
3934
|
],
|
3935
3935
|
remarks: [
|
3936
|
-
"使用此变量的
|
3937
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
3936
|
+
"使用此变量的Mine Script®代码可以对历史数据和实时数据进行不同的计算。",
|
3937
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
3938
3938
|
],
|
3939
3939
|
seeAlso: [
|
3940
3940
|
"[barstate.isfirst](#var_barstate.isfirst)",
|
@@ -3952,9 +3952,9 @@ else
|
|
3952
3952
|
"如果脚本正在计算当前k线的最后(关闭)更新,则返回true。 下一个脚本将在新K线数据上计算。"
|
3953
3953
|
],
|
3954
3954
|
remarks: [
|
3955
|
-
"使用此变量的
|
3955
|
+
"使用此变量的Mine Script®代码可以对历史数据和实时数据进行不同的计算。",
|
3956
3956
|
"不建议在[request.security](#fun_request.security)表达式中使用[barstate.isconfirmed](#var_barstate.isconfirmed)。 从[request.security](#fun_request.security)请求的它的值是不可预测的。",
|
3957
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
3957
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
3958
3958
|
],
|
3959
3959
|
seeAlso: [
|
3960
3960
|
"[barstate.isfirst](#var_barstate.isfirst)",
|
@@ -3972,8 +3972,8 @@ else
|
|
3972
3972
|
"如果市场收盘时脚本在数据集的最后一根K线上执行,或者脚本正在实时K线之前的K线上执行,如果市场开盘,则返回true。否则返回false。"
|
3973
3973
|
],
|
3974
3974
|
remarks: [
|
3975
|
-
"使用此变量的
|
3976
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
3975
|
+
"使用此变量的Mine Script®代码可以对历史数据和实时数据进行不同的计算。",
|
3976
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
3977
3977
|
],
|
3978
3978
|
seeAlso: [
|
3979
3979
|
"[barstate.isfirst](#var_barstate.isfirst)",
|
@@ -5896,7 +5896,7 @@ else
|
|
5896
5896
|
name: "xloc.bar_index",
|
5897
5897
|
type: "const string",
|
5898
5898
|
desc: [
|
5899
|
-
"一个常量,指定创建和修改
|
5899
|
+
"一个常量,指定创建和修改Mine绘图的函数如何解释x坐标。如果为`xloc = xloc.bar_index`,则绘图对象将每个x坐标视为`bar_index`值。"
|
5900
5900
|
],
|
5901
5901
|
seeAlso: [
|
5902
5902
|
"[xloc.bar_time](#const_xloc.bar_time)",
|
@@ -5912,7 +5912,7 @@ else
|
|
5912
5912
|
name: "xloc.bar_time",
|
5913
5913
|
type: "const string",
|
5914
5914
|
desc: [
|
5915
|
-
"一个常量,指定创建和修改
|
5915
|
+
"一个常量,指定创建和修改Mine绘图的函数如何解释x坐标。如果为`xloc = xloc.bar_time`,则绘图对象将每个x坐标视为UNIX时间戳,以毫秒表示。"
|
5916
5916
|
],
|
5917
5917
|
seeAlso: [
|
5918
5918
|
"[xloc.bar_index](#const_xloc.bar_index)",
|
@@ -7140,7 +7140,7 @@ else
|
|
7140
7140
|
"表示[bool](#type_bool)变量可以保存的值之一的文字,或者当表达式使用比较或逻辑运算符时可以计算的值。"
|
7141
7141
|
],
|
7142
7142
|
remarks: [
|
7143
|
-
"请参阅[比较运算符](https://www.
|
7143
|
+
"请参阅[比较运算符](https://www.tradingvue.com/mine-script-docs/language/operators/#comparison-operators)和[逻辑运算符](https://www.tradingvue.com/mine-script-docs/language/operators/#logical-operators)的用户手册。"
|
7144
7144
|
],
|
7145
7145
|
seeAlso: [
|
7146
7146
|
"[bool](#type_bool)"
|
@@ -7152,7 +7152,7 @@ else
|
|
7152
7152
|
"表示[bool](#type_bool)值的文字,以及比较操作的结果。"
|
7153
7153
|
],
|
7154
7154
|
remarks: [
|
7155
|
-
"请参阅[比较运算符](https://www.
|
7155
|
+
"请参阅[比较运算符](https://www.tradingvue.com/mine-script-docs/language/operators/#comparison-operators)和[逻辑运算符](https://www.tradingvue.com/mine-script-docs/language/operators/#logical-operators)的用户手册。"
|
7156
7156
|
],
|
7157
7157
|
seeAlso: [
|
7158
7158
|
"[bool](#type_bool)"
|
@@ -7764,7 +7764,7 @@ else
|
|
7764
7764
|
}
|
7765
7765
|
],
|
7766
7766
|
remarks: [
|
7767
|
-
"要了解更多信息,请参阅我们的用户手册中有关[类型限定符](https://www.
|
7767
|
+
"要了解更多信息,请参阅我们的用户手册中有关[类型限定符](https://www.tradingvue.com/mine-script-docs/language/type-system/#qualifiers)的部分。"
|
7768
7768
|
],
|
7769
7769
|
seeAlso: [
|
7770
7770
|
"[series](#type_series)",
|
@@ -7830,7 +7830,7 @@ else
|
|
7830
7830
|
}
|
7831
7831
|
],
|
7832
7832
|
remarks: [
|
7833
|
-
"要了解更多信息,请参阅我们的用户手册中有关[类型限定符](https://www.
|
7833
|
+
"要了解更多信息,请参阅我们的用户手册中有关[类型限定符](https://www.tradingvue.com/mine-script-docs/language/type-system/#qualifiers)的部分。"
|
7834
7834
|
],
|
7835
7835
|
seeAlso: [
|
7836
7836
|
"[simple](#type_simple)",
|
@@ -7879,7 +7879,7 @@ else
|
|
7879
7879
|
}
|
7880
7880
|
],
|
7881
7881
|
remarks: [
|
7882
|
-
"要了解更多信息,请参阅我们的用户手册中有关[类型限定符](https://www.
|
7882
|
+
"要了解更多信息,请参阅我们的用户手册中有关[类型限定符](https://www.tradingvue.com/mine-script-docs/language/type-system/#qualifiers)的部分。"
|
7883
7883
|
],
|
7884
7884
|
seeAlso: [
|
7885
7885
|
"[simple](#type_simple)",
|
@@ -7899,7 +7899,7 @@ else
|
|
7899
7899
|
"plot(i)"
|
7900
7900
|
],
|
7901
7901
|
remarks: [
|
7902
|
-
"在变量声明中明确提及类型是可选的,除非使用[na](#var_na)进行初始化。要了解有关
|
7902
|
+
"在变量声明中明确提及类型是可选的,除非使用[na](#var_na)进行初始化。要了解有关Mine Script®类型的更多信息,请参阅[类型系统](https://www.tradingvue.com/mine-script-docs/language/type-system/)上的用户手册页面。"
|
7903
7903
|
],
|
7904
7904
|
seeAlso: [
|
7905
7905
|
"[var](#kw_var)",
|
@@ -7923,7 +7923,7 @@ else
|
|
7923
7923
|
"plot(f)"
|
7924
7924
|
],
|
7925
7925
|
remarks: [
|
7926
|
-
"在变量声明中明确提及类型是可选的,除非使用[na](#var_na)进行初始化。要了解有关
|
7926
|
+
"在变量声明中明确提及类型是可选的,除非使用[na](#var_na)进行初始化。要了解有关Mine Script®类型的更多信息,请参阅[类型系统](https://www.tradingvue.com/mine-script-docs/language/type-system/)上的用户手册页面。"
|
7927
7927
|
],
|
7928
7928
|
seeAlso: [
|
7929
7929
|
"[var](#kw_var)",
|
@@ -7946,7 +7946,7 @@ else
|
|
7946
7946
|
"plot(b ? open : close)"
|
7947
7947
|
],
|
7948
7948
|
remarks: [
|
7949
|
-
"在变量声明中明确提及类型是可选的。在用户手册页面的[类型系统](https://www.
|
7949
|
+
"在变量声明中明确提及类型是可选的。在用户手册页面的[类型系统](https://www.tradingvue.com/mine-script-docs/language/type-system/)中了解有关Mine Script®类型的更多信息。"
|
7950
7950
|
],
|
7951
7951
|
seeAlso: [
|
7952
7952
|
"[var](#kw_var)",
|
@@ -7972,7 +7972,7 @@ else
|
|
7972
7972
|
"plot(na, title=s)"
|
7973
7973
|
],
|
7974
7974
|
remarks: [
|
7975
|
-
"在变量声明中明确提及类型是可选的,除非使用[na](#var_na)进行初始化。要了解有关
|
7975
|
+
"在变量声明中明确提及类型是可选的,除非使用[na](#var_na)进行初始化。要了解有关Mine Script®类型的更多信息,请参阅[类型系统](https://www.tradingvue.com/mine-script-docs/language/type-system/)上的用户手册页面。"
|
7976
7976
|
],
|
7977
7977
|
seeAlso: [
|
7978
7978
|
"[var](#kw_var)",
|
@@ -8004,7 +8004,7 @@ else
|
|
8004
8004
|
],
|
8005
8005
|
remarks: [
|
8006
8006
|
"颜色文字具有以下格式:#RRGGBB 或 #RRGGBBAA。 字母对代表00到FF的十六进制值(十进制的0到255),其中RR、GG和BB对是颜色的红色、绿色和蓝色分量的值。AA是颜色透明度(或alpha分量)的可选值,其中00不可见,FF不透明。 当没有提供AA对时,使用FF。十六进制字母可以是大写或小写。",
|
8007
|
-
"在变量声明中明确提及类型是可选的,除非使用[na](#var_na)进行初始化。要了解有关
|
8007
|
+
"在变量声明中明确提及类型是可选的,除非使用[na](#var_na)进行初始化。要了解有关Mine Script®类型的更多信息,请参阅[类型系统](https://www.tradingvue.com/mine-script-docs/language/type-system/)上的用户手册页面。"
|
8008
8008
|
],
|
8009
8009
|
seeAlso: [
|
8010
8010
|
"[var](#kw_var)",
|
@@ -8241,7 +8241,7 @@ else
|
|
8241
8241
|
'label.new(bar_index, a.get(bar_index), "Current close")'
|
8242
8242
|
],
|
8243
8243
|
remarks: [
|
8244
|
-
"Map地图对象始终为[series](https://www.
|
8244
|
+
"Map地图对象始终为[series](https://www.tradingvue.com/mine-script-docs/language/type-system/#series)形式。"
|
8245
8245
|
],
|
8246
8246
|
seeAlso: [
|
8247
8247
|
"[map.new<type,type>](#fun_map.new<type,type>)"
|
@@ -8261,14 +8261,14 @@ else
|
|
8261
8261
|
{
|
8262
8262
|
name: "@version=",
|
8263
8263
|
desc: [
|
8264
|
-
"指定脚本将使用的
|
8264
|
+
"指定脚本将使用的Mine Script™版本。此注释中的数字不应与脚本的修订号混淆,该修订号会在每次保存的代码更改时更新。"
|
8265
8265
|
],
|
8266
8266
|
detailedDesc: [
|
8267
8267
|
{
|
8268
8268
|
desc: [],
|
8269
8269
|
examples: [
|
8270
8270
|
"//@version=6",
|
8271
|
-
'indicator("
|
8271
|
+
'indicator("Mine v6 Indicator")',
|
8272
8272
|
"plot(close)"
|
8273
8273
|
]
|
8274
8274
|
},
|
@@ -8276,14 +8276,14 @@ else
|
|
8276
8276
|
desc: [],
|
8277
8277
|
examples: [
|
8278
8278
|
"//This indicator has no version annotation, so it will try to use v1.",
|
8279
|
-
"//
|
8280
|
-
'indicator("
|
8279
|
+
"//Mine Script® v1 has no function named `indicator()`, so the script will not compile.",
|
8280
|
+
'indicator("Mine v1 Indicator")',
|
8281
8281
|
"plot(close)"
|
8282
8282
|
]
|
8283
8283
|
}
|
8284
8284
|
],
|
8285
8285
|
remarks: [
|
8286
|
-
"应始终指定版本。否则,出于兼容性原因,脚本将使用
|
8286
|
+
"应始终指定版本。否则,出于兼容性原因,脚本将使用Mine Script™ v1进行编译,该版本缺乏大部分较新的功能,并且必然会造成混乱。此注释可以位于脚本中的任何位置,但我们建议将其放置在代码的顶部以提高可读性。"
|
8287
8287
|
]
|
8288
8288
|
},
|
8289
8289
|
{
|
@@ -8306,7 +8306,7 @@ else
|
|
8306
8306
|
{
|
8307
8307
|
name: "@enum",
|
8308
8308
|
desc: [
|
8309
|
-
"如果放置在枚举声明上方,它会为枚举添加自定义描述。
|
8309
|
+
"如果放置在枚举声明上方,它会为枚举添加自定义描述。Mine编辑器的自动建议会使用此描述,并在用户将鼠标悬停在枚举名称上时显示它。在库脚本中使用时,使用[export](#kw_export)关键字的所有枚举描述,将预先填充发布对话框中的“描述”字段。"
|
8310
8310
|
],
|
8311
8311
|
examples: [
|
8312
8312
|
"//@version=6",
|
@@ -8340,7 +8340,7 @@ else
|
|
8340
8340
|
name: "@function",
|
8341
8341
|
desc: [
|
8342
8342
|
"如果放置在函数声明之上,它会添加该函数的自定义描述。",
|
8343
|
-
"
|
8343
|
+
"Mine编辑器的自动建议使用此描述,并在用户将鼠标悬停在函数名称上时显示它。当在[library](#fun_library)脚本中使用时,使用[export](#kw_export)关键字的所有函数的描述,将预先填充发布对话框中的“描述”字段。"
|
8344
8344
|
],
|
8345
8345
|
examples: [
|
8346
8346
|
"//@version=6",
|
@@ -8358,7 +8358,7 @@ else
|
|
8358
8358
|
name: "@param",
|
8359
8359
|
desc: [
|
8360
8360
|
"如果放置在函数声明上方,它将添加函数参数的自定义描述。在注释之后,用户应该指定参数名称,然后指定其描述。",
|
8361
|
-
"
|
8361
|
+
"Mine编辑器的自动建议使用此描述,并在用户将鼠标悬停在函数名称上时显示它。当在[library](#fun_library)脚本中使用时,使用[export](#kw_export)关键字的所有函数的描述,将预先填充发布对话框中的“描述”字段。"
|
8362
8362
|
],
|
8363
8363
|
examples: [
|
8364
8364
|
"//@version=6",
|
@@ -8376,7 +8376,7 @@ else
|
|
8376
8376
|
name: "@returns",
|
8377
8377
|
desc: [
|
8378
8378
|
"如果放置在函数声明之上,它会添加该函数返回内容的自定义描述。",
|
8379
|
-
"
|
8379
|
+
"Mine编辑器的自动建议使用此描述,并在用户将鼠标悬停在函数名称上时显示它。当在[library](#fun_library)脚本中使用时,使用[export](#kw_export)关键字的所有函数的描述,将预先填充发布对话框中的“描述”字段。"
|
8380
8380
|
],
|
8381
8381
|
examples: [
|
8382
8382
|
"//@version=6",
|
@@ -8394,7 +8394,7 @@ else
|
|
8394
8394
|
name: "@variable",
|
8395
8395
|
desc: [
|
8396
8396
|
"如果放置在变量声明之上,它会添加变量的自定义描述。",
|
8397
|
-
"
|
8397
|
+
"Mine编辑器的自动建议使用此描述,并在用户将鼠标悬停在变量名称上时显示它。"
|
8398
8398
|
],
|
8399
8399
|
examples: [
|
8400
8400
|
"//@version=6",
|
@@ -8419,7 +8419,7 @@ else
|
|
8419
8419
|
name: "@type",
|
8420
8420
|
desc: [
|
8421
8421
|
"如果放置在类型声明之上,它将添加该类型的自定义描述。",
|
8422
|
-
"
|
8422
|
+
"Mine编辑器的自动建议使用此描述,并在用户将鼠标悬停在类型名称上时显示它。当在[library](#fun_library)脚本中使用时,使用[export](#kw_export)关键字的所有类型的描述,将预先填充发布对话框中的“描述”字段。"
|
8423
8423
|
],
|
8424
8424
|
examples: [
|
8425
8425
|
"//@version=6",
|
@@ -8444,7 +8444,7 @@ else
|
|
8444
8444
|
name: "@field",
|
8445
8445
|
desc: [
|
8446
8446
|
"如果放置在[type](#kw_type)或[enum](#kw_enum)声明之上,它会为类型/枚举的字段添加自定义描述。在注释之后,用户应指定字段名称,然后是其描述。",
|
8447
|
-
"
|
8447
|
+
"Mine编辑器的自动建议使用此描述,并在用户将鼠标悬停在类型或字段名称上时显示它。当在[library](#fun_library)脚本中使用时,使用[export](#kw_export)关键字的所有类型的描述,将预先填充发布对话框中的“描述”字段。"
|
8448
8448
|
],
|
8449
8449
|
examples: [
|
8450
8450
|
"//@version=6",
|
@@ -8540,7 +8540,7 @@ else
|
|
8540
8540
|
},
|
8541
8541
|
{
|
8542
8542
|
name: "max_bars_back",
|
8543
|
-
desc: "脚本为每个变量和函数保留的历史缓冲区的长度,它确定可以使用`[]`历史引用运算符引用多少个过去的值。
|
8543
|
+
desc: "脚本为每个变量和函数保留的历史缓冲区的长度,它确定可以使用`[]`历史引用运算符引用多少个过去的值。Mine Script®运行时会自动检测所需的缓冲区大小。仅当由于自动检测失败而发生运行时错误时才需要使用此参数。有关历史缓冲区底层机制的更多信息,请访问[我们的帮助中心](https://www.tradingview.com/chart/?solution=43000587849)。可选。默认值为0。",
|
8544
8544
|
allowedTypeIDs: [
|
8545
8545
|
"const int"
|
8546
8546
|
],
|
@@ -8548,7 +8548,7 @@ else
|
|
8548
8548
|
},
|
8549
8549
|
{
|
8550
8550
|
name: "timeframe",
|
8551
|
-
desc: "向简单脚本添加多时间周期功能。使用时,“时间周期”字段将添加到脚本的“设置/输入”标签页中。该字段的默认值将是提供的参数,其格式必须符合[时间周期字符串规范](https://www.
|
8551
|
+
desc: "向简单脚本添加多时间周期功能。使用时,“时间周期”字段将添加到脚本的“设置/输入”标签页中。该字段的默认值将是提供的参数,其格式必须符合[时间周期字符串规范](https://www.tradingvue.com/mine-script-docs/concepts/timeframes/#timeframe-string-specifications)。要指定图表的时间周期,请使用空字符串或[timeframe.period](#var_timeframe.period)变量。该参数不能与使用Mine Script™绘图的脚本一起使用。可选。默认值为[timeframe.period](#var_timeframe.period)。",
|
8552
8552
|
allowedTypeIDs: [
|
8553
8553
|
"const string"
|
8554
8554
|
],
|
@@ -8620,7 +8620,7 @@ else
|
|
8620
8620
|
},
|
8621
8621
|
{
|
8622
8622
|
name: "dynamic_requests",
|
8623
|
-
desc: "指定脚本是否可以动态调用来自`request.*()`命名空间的函数。动态`request.*()`调用允许在条件结构(例如,[if](#kw_if))、循环(例如,[for](#kw_for))和导出函数的本地范围内进行。此外,此类调用允许为其许多参数使用“系列”参数。可选。默认值为[true](#const_true)。有关更多信息,请参阅用户手册的[动态请求](https://www.
|
8623
|
+
desc: "指定脚本是否可以动态调用来自`request.*()`命名空间的函数。动态`request.*()`调用允许在条件结构(例如,[if](#kw_if))、循环(例如,[for](#kw_for))和导出函数的本地范围内进行。此外,此类调用允许为其许多参数使用“系列”参数。可选。默认值为[true](#const_true)。有关更多信息,请参阅用户手册的[动态请求](https://www.tradingvue.com/mine-script-docs/concepts/other-timeframes-and-data/#dynamic-requests)部分。",
|
8624
8624
|
allowedTypeIDs: [
|
8625
8625
|
"const bool"
|
8626
8626
|
],
|
@@ -9908,7 +9908,7 @@ else
|
|
9908
9908
|
"有特定透明度的颜色。"
|
9909
9909
|
],
|
9910
9910
|
remarks: [
|
9911
|
-
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
9911
|
+
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
9912
9912
|
],
|
9913
9913
|
syntax: [
|
9914
9914
|
"color.new(color, transp) → const color"
|
@@ -9961,7 +9961,7 @@ else
|
|
9961
9961
|
"有特定透明度的颜色。"
|
9962
9962
|
],
|
9963
9963
|
remarks: [
|
9964
|
-
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
9964
|
+
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
9965
9965
|
],
|
9966
9966
|
syntax: [
|
9967
9967
|
"color.new(color, transp) → series color"
|
@@ -10008,7 +10008,7 @@ else
|
|
10008
10008
|
"有特定透明度的颜色。"
|
10009
10009
|
],
|
10010
10010
|
remarks: [
|
10011
|
-
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
10011
|
+
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
10012
10012
|
],
|
10013
10013
|
syntax: [
|
10014
10014
|
"color.new(color, transp) → input color"
|
@@ -10058,7 +10058,7 @@ else
|
|
10058
10058
|
"有特定透明度的颜色。"
|
10059
10059
|
],
|
10060
10060
|
remarks: [
|
10061
|
-
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
10061
|
+
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
10062
10062
|
],
|
10063
10063
|
syntax: [
|
10064
10064
|
"color.new(color, transp) → simple color"
|
@@ -10146,7 +10146,7 @@ else
|
|
10146
10146
|
"有特定透明度的颜色。"
|
10147
10147
|
],
|
10148
10148
|
remarks: [
|
10149
|
-
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
10149
|
+
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
10150
10150
|
],
|
10151
10151
|
syntax: [
|
10152
10152
|
"color.rgb(red, green, blue, transp) → series color"
|
@@ -10210,7 +10210,7 @@ else
|
|
10210
10210
|
"有特定透明度的颜色。"
|
10211
10211
|
],
|
10212
10212
|
remarks: [
|
10213
|
-
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
10213
|
+
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
10214
10214
|
],
|
10215
10215
|
syntax: [
|
10216
10216
|
"color.rgb(red, green, blue, transp) → const color"
|
@@ -10282,7 +10282,7 @@ else
|
|
10282
10282
|
"有特定透明度的颜色。"
|
10283
10283
|
],
|
10284
10284
|
remarks: [
|
10285
|
-
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
10285
|
+
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
10286
10286
|
],
|
10287
10287
|
syntax: [
|
10288
10288
|
"color.rgb(red, green, blue, transp) → input color"
|
@@ -10362,7 +10362,7 @@ else
|
|
10362
10362
|
"有特定透明度的颜色。"
|
10363
10363
|
],
|
10364
10364
|
remarks: [
|
10365
|
-
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
10365
|
+
"使用非常数的参数(例如,“simple”、“input”或“series”)将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
10366
10366
|
],
|
10367
10367
|
syntax: [
|
10368
10368
|
"color.rgb(red, green, blue, transp) → simple color"
|
@@ -10982,7 +10982,7 @@ else
|
|
10982
10982
|
"根据bottom_color到top_color之间的线性渐变计算的颜色。"
|
10983
10983
|
],
|
10984
10984
|
remarks: [
|
10985
|
-
"使用此函数将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.
|
10985
|
+
"使用此函数将对脚本“设置/样式”标签页中显示的颜色产生影响。请参阅[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/colors/#color-selection-through-script-settings)了解更多信息。"
|
10986
10986
|
],
|
10987
10987
|
syntax: [
|
10988
10988
|
"color.from_gradient(value, bottom_value, top_value, bottom_color, top_color) → series color"
|
@@ -14779,7 +14779,8 @@ else
|
|
14779
14779
|
"series linefill",
|
14780
14780
|
"series polyline",
|
14781
14781
|
"array<>",
|
14782
|
-
"matrix<>"
|
14782
|
+
"matrix<>",
|
14783
|
+
"map<>"
|
14783
14784
|
],
|
14784
14785
|
displayType: "series int/float/color/string/label/line/box/table/linefill/polyline/array<>/matrix<>/map<>"
|
14785
14786
|
}
|
@@ -18757,13 +18758,13 @@ else
|
|
18757
18758
|
'indicator("ta.sma")',
|
18758
18759
|
"plot(ta.sma(close, 15))",
|
18759
18760
|
"",
|
18760
|
-
"// same on
|
18761
|
-
"
|
18761
|
+
"// same on mine, but much less efficient",
|
18762
|
+
"mine_sma(x, y) =>",
|
18762
18763
|
" sum = 0.0",
|
18763
18764
|
" for i = 0 to y - 1",
|
18764
18765
|
" sum := sum + x[i] / y",
|
18765
18766
|
" sum",
|
18766
|
-
"plot(
|
18767
|
+
"plot(mine_sma(close, 15))"
|
18767
18768
|
],
|
18768
18769
|
returns: [
|
18769
18770
|
"`source`K线返回的`length`的简单移动平均线。"
|
@@ -18887,18 +18888,18 @@ else
|
|
18887
18888
|
'indicator("ta.ema")',
|
18888
18889
|
"plot(ta.ema(close, 15))",
|
18889
18890
|
"",
|
18890
|
-
"//the same on
|
18891
|
-
"
|
18891
|
+
"//the same on mine",
|
18892
|
+
"mine_ema(src, length) =>",
|
18892
18893
|
" alpha = 2 / (length + 1)",
|
18893
18894
|
" sum = 0.0",
|
18894
18895
|
" sum := na(sum[1]) ? src : alpha * src + (1 - alpha) * nz(sum[1])",
|
18895
|
-
"plot(
|
18896
|
+
"plot(mine_ema(close,15))"
|
18896
18897
|
],
|
18897
18898
|
returns: [
|
18898
18899
|
"`source` 的指数移动平均线,alpha = 2 / (长度 + 1)。"
|
18899
18900
|
],
|
18900
18901
|
remarks: [
|
18901
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
18902
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。",
|
18902
18903
|
"`source`系列中的`na`值将被忽略;该函数计算非`na`值的`length`数量。"
|
18903
18904
|
],
|
18904
18905
|
seeAlso: [
|
@@ -18956,8 +18957,8 @@ else
|
|
18956
18957
|
'indicator("ta.wma")',
|
18957
18958
|
"plot(ta.wma(close, 15))",
|
18958
18959
|
"",
|
18959
|
-
"// same on
|
18960
|
-
"
|
18960
|
+
"// same on mine, but much less efficient",
|
18961
|
+
"mine_wma(x, y) =>",
|
18961
18962
|
" norm = 0.0",
|
18962
18963
|
" sum = 0.0",
|
18963
18964
|
" for i = 0 to y - 1",
|
@@ -18965,7 +18966,7 @@ else
|
|
18965
18966
|
" norm := norm + weight",
|
18966
18967
|
" sum := sum + x[i] * weight",
|
18967
18968
|
" sum / norm",
|
18968
|
-
"plot(
|
18969
|
+
"plot(mine_wma(close, 15))"
|
18969
18970
|
],
|
18970
18971
|
returns: [
|
18971
18972
|
"`source`K线返回的`length`加权移动平均线。"
|
@@ -19028,10 +19029,10 @@ else
|
|
19028
19029
|
'indicator("ta.vwma")',
|
19029
19030
|
"plot(ta.vwma(close, 15))",
|
19030
19031
|
"",
|
19031
|
-
"// same on
|
19032
|
-
"
|
19032
|
+
"// same on mine, but less efficient",
|
19033
|
+
"mine_vwma(x, y) =>",
|
19033
19034
|
" ta.sma(x * volume, y) / ta.sma(volume, y)",
|
19034
|
-
"plot(
|
19035
|
+
"plot(mine_vwma(close, 15))"
|
19035
19036
|
],
|
19036
19037
|
returns: [
|
19037
19038
|
"`source`K线返回的`length`的成交量加权移动平均线。"
|
@@ -19090,14 +19091,14 @@ else
|
|
19090
19091
|
],
|
19091
19092
|
examples: [
|
19092
19093
|
"//@version=6",
|
19093
|
-
'indicator("
|
19094
|
+
'indicator("Mine Script® Supertrend")',
|
19094
19095
|
"",
|
19095
19096
|
"[supertrend, direction] = ta.supertrend(3, 10)",
|
19096
19097
|
'plot(direction < 0 ? supertrend : na, "Up direction", color = color.green, style=plot.style_linebr)',
|
19097
19098
|
'plot(direction > 0 ? supertrend : na, "Down direction", color = color.red, style=plot.style_linebr)',
|
19098
19099
|
"",
|
19099
|
-
"// The same on
|
19100
|
-
"
|
19100
|
+
"// The same on Mine Script®",
|
19101
|
+
"mine_supertrend(factor, atrPeriod) =>",
|
19101
19102
|
" src = hl2",
|
19102
19103
|
" atr = ta.atr(atrPeriod)",
|
19103
19104
|
" upperBand = src + factor * atr",
|
@@ -19119,12 +19120,12 @@ else
|
|
19119
19120
|
" superTrend := _direction == -1 ? lowerBand : upperBand",
|
19120
19121
|
" [superTrend, _direction]",
|
19121
19122
|
"",
|
19122
|
-
"[
|
19123
|
-
'plot(
|
19124
|
-
'plot(
|
19123
|
+
"[Mine_Supertrend, mineDirection] = mine_supertrend(3, 10)",
|
19124
|
+
'plot(mineDirection < 0 ? Mine_Supertrend : na, "Up direction", color = color.green, style=plot.style_linebr)',
|
19125
|
+
'plot(mineDirection > 0 ? Mine_Supertrend : na, "Down direction", color = color.red, style=plot.style_linebr)'
|
19125
19126
|
],
|
19126
19127
|
returns: [
|
19127
|
-
"两个超趋势系列的[元组](https://www.
|
19128
|
+
"两个超趋势系列的[元组](https://www.tradingvue.com/mine-script-docs/language/type-system/#tuples):超趋势线和趋势方向。可能的值为 1(向下方向)和 -1(向上方向)。"
|
19128
19129
|
],
|
19129
19130
|
seeAlso: [
|
19130
19131
|
"[ta.macd](#fun_ta.macd)"
|
@@ -19217,7 +19218,7 @@ else
|
|
19217
19218
|
}
|
19218
19219
|
],
|
19219
19220
|
returns: [
|
19220
|
-
"三个MACD系列的[元组](https://www.
|
19221
|
+
"三个MACD系列的[元组](https://www.tradingvue.com/mine-script-docs/language/type-system/#tuples):MACD线、信号线和直方图线。"
|
19221
19222
|
],
|
19222
19223
|
remarks: [
|
19223
19224
|
"`source`系列中的`na`值将被忽略;该函数计算非`na`值的`length`数量。"
|
@@ -19655,7 +19656,7 @@ else
|
|
19655
19656
|
],
|
19656
19657
|
remarks: [
|
19657
19658
|
"如果在当前K线之前从未满足该条件,则该函数返回na。",
|
19658
|
-
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.
|
19659
|
+
"请注意,使用此变量/函数可能会导致[指标重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
19659
19660
|
],
|
19660
19661
|
seeAlso: [
|
19661
19662
|
"[ta.lowestbars](#fun_ta.lowestbars)",
|
@@ -19726,7 +19727,7 @@ else
|
|
19726
19727
|
"plot(ta.valuewhen(ta.cross(slow, fast), close, 1))"
|
19727
19728
|
],
|
19728
19729
|
remarks: [
|
19729
|
-
"此功能需要在每根K线上执行。不建议在[for](#kw_for)或[while](#kw_while)循环结构中使用它,因为它的行为可能出乎意料。请注意,使用此功能可能会导致[指标重绘](https://www.
|
19730
|
+
"此功能需要在每根K线上执行。不建议在[for](#kw_for)或[while](#kw_while)循环结构中使用它,因为它的行为可能出乎意料。请注意,使用此功能可能会导致[指标重绘](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
19730
19731
|
],
|
19731
19732
|
seeAlso: [
|
19732
19733
|
"[ta.lowestbars](#fun_ta.lowestbars)",
|
@@ -19793,7 +19794,7 @@ else
|
|
19793
19794
|
"plot(ta.valuewhen(ta.cross(slow, fast), close, 1))"
|
19794
19795
|
],
|
19795
19796
|
remarks: [
|
19796
|
-
"此功能需要在每根K线上执行。不建议在[for](#kw_for)或[while](#kw_while)循环结构中使用它,因为它的行为可能出乎意料。请注意,使用此功能可能会导致[指标重绘](https://www.
|
19797
|
+
"此功能需要在每根K线上执行。不建议在[for](#kw_for)或[while](#kw_while)循环结构中使用它,因为它的行为可能出乎意料。请注意,使用此功能可能会导致[指标重绘](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
19797
19798
|
],
|
19798
19799
|
seeAlso: [
|
19799
19800
|
"[ta.lowestbars](#fun_ta.lowestbars)",
|
@@ -19860,7 +19861,7 @@ else
|
|
19860
19861
|
"plot(ta.valuewhen(ta.cross(slow, fast), close, 1))"
|
19861
19862
|
],
|
19862
19863
|
remarks: [
|
19863
|
-
"此功能需要在每根K线上执行。不建议在[for](#kw_for)或[while](#kw_while)循环结构中使用它,因为它的行为可能出乎意料。请注意,使用此功能可能会导致[指标重绘](https://www.
|
19864
|
+
"此功能需要在每根K线上执行。不建议在[for](#kw_for)或[while](#kw_while)循环结构中使用它,因为它的行为可能出乎意料。请注意,使用此功能可能会导致[指标重绘](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
19864
19865
|
],
|
19865
19866
|
seeAlso: [
|
19866
19867
|
"[ta.lowestbars](#fun_ta.lowestbars)",
|
@@ -19927,7 +19928,7 @@ else
|
|
19927
19928
|
"plot(ta.valuewhen(ta.cross(slow, fast), close, 1))"
|
19928
19929
|
],
|
19929
19930
|
remarks: [
|
19930
|
-
"此功能需要在每根K线上执行。不建议在[for](#kw_for)或[while](#kw_while)循环结构中使用它,因为它的行为可能出乎意料。请注意,使用此功能可能会导致[指标重绘](https://www.
|
19931
|
+
"此功能需要在每根K线上执行。不建议在[for](#kw_for)或[while](#kw_while)循环结构中使用它,因为它的行为可能出乎意料。请注意,使用此功能可能会导致[指标重绘](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
19931
19932
|
],
|
19932
19933
|
seeAlso: [
|
19933
19934
|
"[ta.lowestbars](#fun_ta.lowestbars)",
|
@@ -20246,15 +20247,15 @@ else
|
|
20246
20247
|
'indicator("ta.dev")',
|
20247
20248
|
"plot(ta.dev(close, 10))",
|
20248
20249
|
"",
|
20249
|
-
"// the same on
|
20250
|
-
"
|
20250
|
+
"// the same on mine",
|
20251
|
+
"mine_dev(source, length) =>",
|
20251
20252
|
" mean = ta.sma(source, length)",
|
20252
20253
|
" sum = 0.0",
|
20253
20254
|
" for i = 0 to length - 1",
|
20254
20255
|
" val = source[i]",
|
20255
20256
|
" sum := sum + math.abs(val - mean)",
|
20256
20257
|
" dev = sum/length",
|
20257
|
-
"plot(
|
20258
|
+
"plot(mine_dev(close, 10))"
|
20258
20259
|
],
|
20259
20260
|
returns: [
|
20260
20261
|
"`source`K线返回的`length`偏差。"
|
@@ -20321,7 +20322,7 @@ else
|
|
20321
20322
|
'indicator("ta.stdev")',
|
20322
20323
|
"plot(ta.stdev(close, 5))",
|
20323
20324
|
"",
|
20324
|
-
"//the same on
|
20325
|
+
"//the same on mine",
|
20325
20326
|
"isZero(val, eps) => math.abs(val) <= eps",
|
20326
20327
|
"",
|
20327
20328
|
"SUM(fst, snd) =>",
|
@@ -20335,7 +20336,7 @@ else
|
|
20335
20336
|
" else",
|
20336
20337
|
" 15",
|
20337
20338
|
"",
|
20338
|
-
"
|
20339
|
+
"mine_stdev(src, length) =>",
|
20339
20340
|
" avg = ta.sma(src, length)",
|
20340
20341
|
" sumOfSquareDeviations = 0.0",
|
20341
20342
|
" for i = 0 to length - 1",
|
@@ -20343,7 +20344,7 @@ else
|
|
20343
20344
|
" sumOfSquareDeviations := sumOfSquareDeviations + sum * sum",
|
20344
20345
|
"",
|
20345
20346
|
" stdev = math.sqrt(sumOfSquareDeviations / length)",
|
20346
|
-
"plot(
|
20347
|
+
"plot(mine_stdev(close, 5))"
|
20347
20348
|
],
|
20348
20349
|
returns: [
|
20349
20350
|
"标准差"
|
@@ -20450,12 +20451,12 @@ else
|
|
20450
20451
|
'indicator("ta.rma")',
|
20451
20452
|
"plot(ta.rma(close, 15))",
|
20452
20453
|
"",
|
20453
|
-
"//the same on
|
20454
|
-
"
|
20454
|
+
"//the same on mine",
|
20455
|
+
"mine_rma(src, length) =>",
|
20455
20456
|
" alpha = 1/length",
|
20456
20457
|
" sum = 0.0",
|
20457
20458
|
" sum := na(sum[1]) ? ta.sma(src, length) : alpha * src + (1 - alpha) * nz(sum[1])",
|
20458
|
-
"plot(
|
20459
|
+
"plot(mine_rma(close, 15))"
|
20459
20460
|
],
|
20460
20461
|
returns: [
|
20461
20462
|
"`source`的指数移动平均线,alpha = 1 / `length`。"
|
@@ -20518,15 +20519,15 @@ else
|
|
20518
20519
|
'indicator("ta.rsi")',
|
20519
20520
|
"plot(ta.rsi(close, 7))",
|
20520
20521
|
"",
|
20521
|
-
"// same on
|
20522
|
-
"
|
20522
|
+
"// same on mine, but less efficient",
|
20523
|
+
"mine_rsi(x, y) => ",
|
20523
20524
|
" u = math.max(x - x[1], 0) // upward ta.change",
|
20524
20525
|
" d = math.max(x[1] - x, 0) // downward ta.change",
|
20525
20526
|
" rs = ta.rma(u, y) / ta.rma(d, y)",
|
20526
20527
|
" res = 100 - 100 / (1 + rs)",
|
20527
20528
|
" res",
|
20528
20529
|
"",
|
20529
|
-
"plot(
|
20530
|
+
"plot(mine_rsi(close, 7))"
|
20530
20531
|
],
|
20531
20532
|
returns: [
|
20532
20533
|
"相对强弱指标(RSI)"
|
@@ -20597,7 +20598,7 @@ else
|
|
20597
20598
|
args: [
|
20598
20599
|
{
|
20599
20600
|
name: "timeframe",
|
20600
|
-
desc: "[timeframe string specifications](https://www.
|
20601
|
+
desc: "[timeframe string specifications](https://www.tradingvue.com/mine-script-docs/concepts/timeframes/#timeframe-string-specifications)格式的时间周期字符串。可选。默认值为[timeframe.period](#var_timeframe.period)。",
|
20601
20602
|
allowedTypeIDs: [
|
20602
20603
|
"simple string",
|
20603
20604
|
"input string",
|
@@ -20644,7 +20645,7 @@ else
|
|
20644
20645
|
args: [
|
20645
20646
|
{
|
20646
20647
|
name: "timeframe",
|
20647
|
-
desc: "[timeframe string specifications](https://www.
|
20648
|
+
desc: "[timeframe string specifications](https://www.tradingvue.com/mine-script-docs/concepts/timeframes/#timeframe-string-specifications)格式的时间周期字符串。可选。默认值为[timeframe.period](#var_timeframe.period)。",
|
20648
20649
|
allowedTypeIDs: [
|
20649
20650
|
"series string",
|
20650
20651
|
"simple string",
|
@@ -20711,7 +20712,7 @@ else
|
|
20711
20712
|
"plot(htfClose)"
|
20712
20713
|
],
|
20713
20714
|
returns: [
|
20714
|
-
"符合[timeframe string specifications](https://www.
|
20715
|
+
"符合[timeframe string specifications](https://www.tradingvue.com/mine-script-docs/concepts/timeframes/#timeframe-string-specifications)的时间周期字符串。"
|
20715
20716
|
],
|
20716
20717
|
remarks: [
|
20717
20718
|
"如果所提供的秒数不存在有效时间周期,则将返回下一个更高的有效时间周期。因此,一秒或更少将返回“1S”,2-5秒将返回“5S”,604,799秒(小于7天的一秒)将返回“7D”。",
|
@@ -20758,7 +20759,7 @@ else
|
|
20758
20759
|
"plot(htfClose)"
|
20759
20760
|
],
|
20760
20761
|
returns: [
|
20761
|
-
"符合[timeframe string specifications](https://www.
|
20762
|
+
"符合[timeframe string specifications](https://www.tradingvue.com/mine-script-docs/concepts/timeframes/#timeframe-string-specifications)的时间周期字符串。"
|
20762
20763
|
],
|
20763
20764
|
remarks: [
|
20764
20765
|
"如果所提供的秒数不存在有效时间周期,则将返回下一个更高的有效时间周期。因此,一秒或更少将返回“1S”,2-5秒将返回“5S”,604,799秒(小于7天的一秒)将返回“7D”。",
|
@@ -20817,7 +20818,7 @@ else
|
|
20817
20818
|
'plot(diminus, color=color.orange, title="-DI")'
|
20818
20819
|
],
|
20819
20820
|
returns: [
|
20820
|
-
"三个DMI系列的[元组](https://www.
|
20821
|
+
"三个DMI系列的[元组](https://www.tradingvue.com/mine-script-docs/language/type-system/#tuples):正方向运动(+DI)、负方向运动(-DI) 和平均方向运动指数(ADX)。"
|
20821
20822
|
],
|
20822
20823
|
seeAlso: [
|
20823
20824
|
"[ta.rsi](#fun_ta.rsi)",
|
@@ -21121,13 +21122,13 @@ else
|
|
21121
21122
|
'indicator("ta.atr")',
|
21122
21123
|
"plot(ta.atr(14))",
|
21123
21124
|
"",
|
21124
|
-
"//the same on
|
21125
|
-
"
|
21125
|
+
"//the same on mine",
|
21126
|
+
"mine_atr(length) =>",
|
21126
21127
|
" trueRange = na(high[1])? high-low : math.max(math.max(high - low, math.abs(high - close[1])), math.abs(low - close[1]))",
|
21127
21128
|
" //true range can be also calculated with ta.tr(true)",
|
21128
21129
|
" ta.rma(trueRange, length)",
|
21129
21130
|
"",
|
21130
|
-
"plot(
|
21131
|
+
"plot(mine_atr(14))"
|
21131
21132
|
],
|
21132
21133
|
returns: [
|
21133
21134
|
"真实波动幅度均值(ATR)"
|
@@ -22003,10 +22004,10 @@ else
|
|
22003
22004
|
'indicator("ta.swma")',
|
22004
22005
|
"plot(ta.swma(close))",
|
22005
22006
|
"",
|
22006
|
-
"// same on
|
22007
|
-
"
|
22007
|
+
"// same on mine, but less efficient",
|
22008
|
+
"mine_swma(x) =>",
|
22008
22009
|
" x[3] * 1 / 6 + x[2] * 2 / 6 + x[1] * 2 / 6 + x[0] * 1 / 6",
|
22009
|
-
"plot(
|
22010
|
+
"plot(mine_swma(close))"
|
22010
22011
|
],
|
22011
22012
|
returns: [
|
22012
22013
|
"对称加权移动平均线。"
|
@@ -22083,8 +22084,8 @@ else
|
|
22083
22084
|
'indicator("ta.sar")',
|
22084
22085
|
"plot(ta.sar(0.02, 0.02, 0.2), style=plot.style_cross, linewidth=3)",
|
22085
22086
|
"",
|
22086
|
-
"// The same on
|
22087
|
-
"
|
22087
|
+
"// The same on Mine Script®",
|
22088
|
+
"mine_sar(start, inc, max) =>",
|
22088
22089
|
" var float result = na",
|
22089
22090
|
" var float maxMin = na",
|
22090
22091
|
" var float acceleration = na",
|
@@ -22142,7 +22143,7 @@ else
|
|
22142
22143
|
" ",
|
22143
22144
|
" result",
|
22144
22145
|
" ",
|
22145
|
-
"plot(
|
22146
|
+
"plot(mine_sar(0.02, 0.02, 0.2), style=plot.style_cross, linewidth=3)"
|
22146
22147
|
],
|
22147
22148
|
returns: [
|
22148
22149
|
"抛物线转向指标。"
|
@@ -22162,7 +22163,7 @@ else
|
|
22162
22163
|
args: [
|
22163
22164
|
{
|
22164
22165
|
name: "timeframe",
|
22165
|
-
desc: "根据[用户手册的时间周期字符串规范](https://www.
|
22166
|
+
desc: "根据[用户手册的时间周期字符串规范](https://www.tradingvue.com/mine-script-docs/concepts/timeframes/#timeframe-string-specifications)格式化的字符串。",
|
22166
22167
|
allowedTypeIDs: [
|
22167
22168
|
"series string",
|
22168
22169
|
"simple string",
|
@@ -22313,7 +22314,7 @@ else
|
|
22313
22314
|
// "plot(close * rate)"
|
22314
22315
|
// ],
|
22315
22316
|
// "remarks": [
|
22316
|
-
// "如果`from`和`to`参数相等,则函数返回1。请注意,使用此变量/函数可能会导致[指标重绘](https://www.
|
22317
|
+
// "如果`from`和`to`参数相等,则函数返回1。请注意,使用此变量/函数可能会导致[指标重绘](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。"
|
22317
22318
|
// ],
|
22318
22319
|
// "syntax": [
|
22319
22320
|
// "request.currency_rate(from, to, ignore_invalid_currency) → series float"
|
@@ -22345,7 +22346,7 @@ else
|
|
22345
22346
|
},
|
22346
22347
|
{
|
22347
22348
|
name: "timeframe",
|
22348
|
-
desc: "所请求数据的时间周期。使用空字符串或[timeframe.period](#var_timeframe.period)来请求图表时间周期或[indicator](#fun_indicator)函数中指定的`timeframe`的数据。要请求不同时间周期的数据,请提供有效的时间周期字符串。请参阅[此处](https://www.
|
22349
|
+
desc: "所请求数据的时间周期。使用空字符串或[timeframe.period](#var_timeframe.period)来请求图表时间周期或[indicator](#fun_indicator)函数中指定的`timeframe`的数据。要请求不同时间周期的数据,请提供有效的时间周期字符串。请参阅[此处](https://www.tradingvue.com/mine-script-docs/concepts/timeframes/#timeframe-string-specifications),了解如何指定时间周期字符串。",
|
22349
22350
|
required: !0,
|
22350
22351
|
allowedTypeIDs: [
|
22351
22352
|
"series string",
|
@@ -22357,7 +22358,7 @@ else
|
|
22357
22358
|
},
|
22358
22359
|
{
|
22359
22360
|
name: "expression",
|
22360
|
-
desc: "从请求的上下文计算并返回的表达式。它可以接受内置变量,如 [close](#var_close)、用户定义变量、表达式,如`ta.change(close) / (high - low)`、不使用
|
22361
|
+
desc: "从请求的上下文计算并返回的表达式。它可以接受内置变量,如 [close](#var_close)、用户定义变量、表达式,如`ta.change(close) / (high - low)`、不使用Mine Script®绘图的函数调用、[对象](https://www.tradingvue.com/mine-script-docs/language/objects/)、[集合](https://www.tradingvue.com/mine-script-docs/language/type-system/#collections)或表达式元组。",
|
22361
22362
|
displayType: "variable, function, object, array, matrix, or map of series int/float/bool/string/color/enum, or a tuple of these",
|
22362
22363
|
required: !0,
|
22363
22364
|
allowedTypeIDs: [
|
@@ -22395,7 +22396,7 @@ else
|
|
22395
22396
|
},
|
22396
22397
|
{
|
22397
22398
|
name: "lookahead",
|
22398
|
-
desc: "仅在历史K线上,返回时间周期内过去之前的数据。可能的值:[barmerge.lookahead_on](#const_barmerge.lookahead_on)、[barmerge.lookahead_off](#const_barmerge.lookahead_off)。对实时值没有影响。可选。从
|
22399
|
+
desc: "仅在历史K线上,返回时间周期内过去之前的数据。可能的值:[barmerge.lookahead_on](#const_barmerge.lookahead_on)、[barmerge.lookahead_off](#const_barmerge.lookahead_off)。对实时值没有影响。可选。从Mine Script® v3开始,默认值为[barmerge.lookahead_off](#const_barmerge.lookahead_off)。 v1和v2中的默认值为[barmerge.lookahead_on](#const_barmerge.lookahead_on)。 警告:在高于图表的时间周期内使用[barmerge.lookahead_on](#const_barmerge.lookahead_on) 而不像`close[1]`中那样抵消`expression`参数,将会在脚本中引入未来的泄漏,因为该函数将在当前上下文中实际已知之前返回`close`价格。正如用户手册的[重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/#future-leak-with-request-security)页面中所解释的那样,这会产生误导性的结果。",
|
22399
22400
|
allowedTypeIDs: [
|
22400
22401
|
"simple barmerge_lookahead",
|
22401
22402
|
"input barmerge_lookahead",
|
@@ -22493,10 +22494,10 @@ else
|
|
22493
22494
|
"由`expression`确定的结果。"
|
22494
22495
|
],
|
22495
22496
|
remarks: [
|
22496
|
-
"使用此函数的脚本可能会在历史K线和实时K线上进行不同的计算,从而导致[重新绘制](https://www.
|
22497
|
+
"使用此函数的脚本可能会在历史K线和实时K线上进行不同的计算,从而导致[重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。",
|
22497
22498
|
"单个脚本最多可以包含40个唯一的`request.*()`函数调用。只有当调用不调用具有相同参数的相同函数时,该调用才是唯一的。",
|
22498
22499
|
'当使用两次对`request.*()`函数的调用来评估来自相同上下文的具有不同`calc_bars_count`值的相同表达式时,第二次调用请求的历史条数与第一次相同。例如,如果脚本调用`request.security("AAPL", "", close, calc_bars_count = 3)` after it calls `request.security("AAPL", "", close, calc_bars_count = 5)`,第二次调用也会使用五条历史数据,而不是三条。',
|
22499
|
-
"如果没有精确指定,即如果`symbol`参数为空字符串或[syminfo.tickerid](#var_syminfo.tickerid),则可以*继承*`request.()`调用的符号。同样,如果`timeframe`参数为空字符串或[timeframe.period](#var_timeframe.period),则可以继承`request.()`调用的时间周期。这些值通常取自运行脚本的图表。但是,如果从`request.*()`函数B的表达式中调用`request.*()`函数A,则函数A可以从函数B继承值。有关更多信息,请参阅[此处](https://www.
|
22500
|
+
"如果没有精确指定,即如果`symbol`参数为空字符串或[syminfo.tickerid](#var_syminfo.tickerid),则可以*继承*`request.()`调用的符号。同样,如果`timeframe`参数为空字符串或[timeframe.period](#var_timeframe.period),则可以继承`request.()`调用的时间周期。这些值通常取自运行脚本的图表。但是,如果从`request.*()`函数B的表达式中调用`request.*()`函数A,则函数A可以从函数B继承值。有关更多信息,请参阅[此处](https://www.tradingvue.com/mine-script-docs/concepts/other-timeframes-and-data/#nested-requests)。"
|
22500
22501
|
],
|
22501
22502
|
seeAlso: [
|
22502
22503
|
"[syminfo.ticker](#var_syminfo.ticker)",
|
@@ -22534,7 +22535,7 @@ else
|
|
22534
22535
|
},
|
22535
22536
|
{
|
22536
22537
|
name: "timeframe",
|
22537
|
-
desc: "所请求数据的时间周期。使用空字符串或[timeframe.period](#var_timeframe.period)来请求图表时间周期或[indicator](#fun_indicator)函数中指定的`timeframe`的数据。要请求不同时间周期的数据,请提供有效的时间周期字符串。请参阅[此处](https://www.
|
22538
|
+
desc: "所请求数据的时间周期。使用空字符串或[timeframe.period](#var_timeframe.period)来请求图表时间周期或[indicator](#fun_indicator)函数中指定的`timeframe`的数据。要请求不同时间周期的数据,请提供有效的时间周期字符串。请参阅[此处](https://www.tradingvue.com/mine-script-docs/concepts/timeframes/#timeframe-string-specifications),了解如何指定时间周期字符串。",
|
22538
22539
|
required: !0,
|
22539
22540
|
allowedTypeIDs: [
|
22540
22541
|
"series string",
|
@@ -22546,7 +22547,7 @@ else
|
|
22546
22547
|
},
|
22547
22548
|
{
|
22548
22549
|
name: "expression",
|
22549
|
-
desc: "从请求的上下文计算并返回的表达式。它可以接受内置变量,如 [close](#var_close)、用户定义变量、表达式,如 `ta.change(close) / (high - low)`、不使用
|
22550
|
+
desc: "从请求的上下文计算并返回的表达式。它可以接受内置变量,如 [close](#var_close)、用户定义变量、表达式,如 `ta.change(close) / (high - low)`、不使用 Mine Script® 绘图的函数调用、[对象](https://www.tradingvue.com/mine-script-docs/language/objects/) 或表达式元组。除非位于对象的字段内,否则不允许使用[集合](https://www.tradingvue.com/mine-script-docs/language/type-system/#collections)",
|
22550
22551
|
displayType: "variable, object or function of series int/float/bool/string/color/enum, or a tuple of these",
|
22551
22552
|
required: !0,
|
22552
22553
|
allowedTypeIDs: [
|
@@ -22626,11 +22627,11 @@ else
|
|
22626
22627
|
"由 `expression` 确定的类型数组,或它们的元组。"
|
22627
22628
|
],
|
22628
22629
|
remarks: [
|
22629
|
-
"使用此函数的脚本可能会在历史K线和实时K线上进行不同的计算,从而导致[重新绘制](https://www.
|
22630
|
+
"使用此函数的脚本可能会在历史K线和实时K线上进行不同的计算,从而导致[重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。",
|
22630
22631
|
"请注意,价差(例如“AAPL+MSFT*TSLA”)并不总是使用此函数返回可靠数据。",
|
22631
22632
|
"单个脚本最多可以包含40个唯一的`request.*()`函数调用。只有当调用不调用具有相同参数的相同函数时,该调用才是唯一的。",
|
22632
22633
|
'当使用两次对`request.*()`函数的调用来评估来自相同上下文的具有不同`calc_bars_count`值的相同表达式时,第二次调用请求的历史条数与第一次相同。例如,如果脚本调用`request.security("AAPL", "", close, calc_bars_count = 3)` after it calls `request.security("AAPL", "", close, calc_bars_count = 5)`,第二次调用也会使用五条历史数据,而不是三条。',
|
22633
|
-
"如果没有精确指定,即如果`symbol`参数为空字符串或[syminfo.tickerid](#var_syminfo.tickerid),则可以*继承*`request.()`调用的商品。同样,如果`timeframe`参数为空字符串或[timeframe.period](#var_timeframe.period),则可以继承`request.()`调用的时间周期。这些值通常取自脚本正在运行的图表。但是,如果从`request.*()`函数B的表达式中调用`request.*()`函数A,则函数A可以从函数B继承这些值。有关更多信息,请参阅[此处](https://www.
|
22634
|
+
"如果没有精确指定,即如果`symbol`参数为空字符串或[syminfo.tickerid](#var_syminfo.tickerid),则可以*继承*`request.()`调用的商品。同样,如果`timeframe`参数为空字符串或[timeframe.period](#var_timeframe.period),则可以继承`request.()`调用的时间周期。这些值通常取自脚本正在运行的图表。但是,如果从`request.*()`函数B的表达式中调用`request.*()`函数A,则函数A可以从函数B继承这些值。有关更多信息,请参阅[此处](https://www.tradingvue.com/mine-script-docs/concepts/other-timeframes-and-data/#nested-requests)。"
|
22634
22635
|
],
|
22635
22636
|
seeAlso: [
|
22636
22637
|
"[request.security](#fun_request.security)",
|
@@ -26254,8 +26255,8 @@ else
|
|
26254
26255
|
'indicator("ta.cog", overlay=true) ',
|
26255
26256
|
"plot(ta.cog(close, 10))",
|
26256
26257
|
"",
|
26257
|
-
"// the same on
|
26258
|
-
"
|
26258
|
+
"// the same on mine",
|
26259
|
+
"mine_cog(source, length) =>",
|
26259
26260
|
" sum = math.sum(source, length)",
|
26260
26261
|
" num = 0.0",
|
26261
26262
|
" for i = 0 to length - 1",
|
@@ -26263,7 +26264,7 @@ else
|
|
26263
26264
|
" num := num + price * (i + 1)",
|
26264
26265
|
" -num / sum",
|
26265
26266
|
"",
|
26266
|
-
"plot(
|
26267
|
+
"plot(mine_cog(close, 10))"
|
26267
26268
|
],
|
26268
26269
|
returns: [
|
26269
26270
|
"重心"
|
@@ -26349,8 +26350,8 @@ else
|
|
26349
26350
|
'indicator("ta.alma", overlay=true) ',
|
26350
26351
|
"plot(ta.alma(close, 9, 0.85, 6))",
|
26351
26352
|
"",
|
26352
|
-
"// same on
|
26353
|
-
"
|
26353
|
+
"// same on mine, but much less efficient",
|
26354
|
+
"mine_alma(series, windowsize, offset, sigma) =>",
|
26354
26355
|
" m = offset * (windowsize - 1)",
|
26355
26356
|
" //m = math.floor(offset * (windowsize - 1)) // Used as m when math.floor=true",
|
26356
26357
|
" s = windowsize / sigma",
|
@@ -26361,7 +26362,7 @@ else
|
|
26361
26362
|
" norm := norm + weight",
|
26362
26363
|
" sum := sum + series[windowsize - i - 1] * weight",
|
26363
26364
|
" sum / norm",
|
26364
|
-
"plot(
|
26365
|
+
"plot(mine_alma(close, 9, 0.85, 6))"
|
26365
26366
|
],
|
26366
26367
|
returns: [
|
26367
26368
|
"Arnaud Legoux移动平均线"
|
@@ -26463,8 +26464,8 @@ else
|
|
26463
26464
|
'indicator("ta.alma", overlay=true) ',
|
26464
26465
|
"plot(ta.alma(close, 9, 0.85, 6))",
|
26465
26466
|
"",
|
26466
|
-
"// same on
|
26467
|
-
"
|
26467
|
+
"// same on mine, but much less efficient",
|
26468
|
+
"mine_alma(series, windowsize, offset, sigma) =>",
|
26468
26469
|
" m = offset * (windowsize - 1)",
|
26469
26470
|
" //m = math.floor(offset * (windowsize - 1)) // Used as m when math.floor=true",
|
26470
26471
|
" s = windowsize / sigma",
|
@@ -26475,7 +26476,7 @@ else
|
|
26475
26476
|
" norm := norm + weight",
|
26476
26477
|
" sum := sum + series[windowsize - i - 1] * weight",
|
26477
26478
|
" sum / norm",
|
26478
|
-
"plot(
|
26479
|
+
"plot(mine_alma(close, 9, 0.85, 6))"
|
26479
26480
|
],
|
26480
26481
|
returns: [
|
26481
26482
|
"Arnaud Legoux移动平均线"
|
@@ -26538,7 +26539,7 @@ else
|
|
26538
26539
|
'indicator("ta.cmo")',
|
26539
26540
|
"plot(ta.cmo(close, 5), color=color.yellow)",
|
26540
26541
|
"",
|
26541
|
-
"// the same on
|
26542
|
+
"// the same on mine",
|
26542
26543
|
"f_cmo(src, length) =>",
|
26543
26544
|
" float mom = ta.change(src)",
|
26544
26545
|
" float sm1 = math.sum((mom >= 0) ? mom : 0.0, length)",
|
@@ -26606,14 +26607,14 @@ else
|
|
26606
26607
|
"",
|
26607
26608
|
"plot(ta.mfi(hlc3, 14), color=color.yellow)",
|
26608
26609
|
"",
|
26609
|
-
"// the same on
|
26610
|
-
"
|
26610
|
+
"// the same on mine",
|
26611
|
+
"mine_mfi(src, length) =>",
|
26611
26612
|
" float upper = math.sum(volume * (ta.change(src) <= 0.0 ? 0.0 : src), length)",
|
26612
26613
|
" float lower = math.sum(volume * (ta.change(src) >= 0.0 ? 0.0 : src), length)",
|
26613
26614
|
" mfi = 100.0 - (100.0 / (1.0 + upper / lower))",
|
26614
26615
|
" mfi",
|
26615
26616
|
"",
|
26616
|
-
"plot(
|
26617
|
+
"plot(mine_mfi(hlc3, 14))"
|
26617
26618
|
],
|
26618
26619
|
returns: [
|
26619
26620
|
"资金流量指标"
|
@@ -26731,17 +26732,17 @@ else
|
|
26731
26732
|
"plot(upper, color=color.yellow)",
|
26732
26733
|
"plot(lower, color=color.yellow)",
|
26733
26734
|
"",
|
26734
|
-
"// the same on
|
26735
|
+
"// the same on mine",
|
26735
26736
|
"f_bb(src, length, mult) =>",
|
26736
26737
|
" float basis = ta.sma(src, length)",
|
26737
26738
|
" float dev = mult * ta.stdev(src, length)",
|
26738
26739
|
" [basis, basis + dev, basis - dev]",
|
26739
26740
|
"",
|
26740
|
-
"[
|
26741
|
+
"[mineMiddle, mineUpper, mineLower] = f_bb(close, 5, 4)",
|
26741
26742
|
"",
|
26742
|
-
"plot(
|
26743
|
-
"plot(
|
26744
|
-
"plot(
|
26743
|
+
"plot(mineMiddle)",
|
26744
|
+
"plot(mineUpper)",
|
26745
|
+
"plot(mineLower)"
|
26745
26746
|
],
|
26746
26747
|
returns: [
|
26747
26748
|
"布林带。"
|
@@ -26816,7 +26817,7 @@ else
|
|
26816
26817
|
"",
|
26817
26818
|
"plot(ta.bbw(close, 5, 4), color=color.yellow)",
|
26818
26819
|
"",
|
26819
|
-
"// the same on
|
26820
|
+
"// the same on mine",
|
26820
26821
|
"f_bbw(src, length, mult) =>",
|
26821
26822
|
" float basis = ta.sma(src, length)",
|
26822
26823
|
" float dev = mult * ta.stdev(src, length)",
|
@@ -26900,18 +26901,18 @@ else
|
|
26900
26901
|
"plot(lower, color=color.yellow)",
|
26901
26902
|
"",
|
26902
26903
|
"",
|
26903
|
-
"// the same on
|
26904
|
+
"// the same on mine",
|
26904
26905
|
"f_kc(src, length, mult, useTrueRange) =>",
|
26905
26906
|
" float basis = ta.ema(src, length)",
|
26906
26907
|
" float span = (useTrueRange) ? ta.tr : (high - low)",
|
26907
26908
|
" float rangeEma = ta.ema(span, length)",
|
26908
26909
|
" [basis, basis + rangeEma * mult, basis - rangeEma * mult]",
|
26909
26910
|
" ",
|
26910
|
-
"[
|
26911
|
+
"[mineMiddle, mineUpper, mineLower] = f_kc(close, 5, 4, true)",
|
26911
26912
|
"",
|
26912
|
-
"plot(
|
26913
|
-
"plot(
|
26914
|
-
"plot(
|
26913
|
+
"plot(mineMiddle)",
|
26914
|
+
"plot(mineUpper)",
|
26915
|
+
"plot(mineLower)"
|
26915
26916
|
],
|
26916
26917
|
returns: [
|
26917
26918
|
"肯特纳通道"
|
@@ -27000,18 +27001,18 @@ else
|
|
27000
27001
|
"plot(lower, color=color.yellow)",
|
27001
27002
|
"",
|
27002
27003
|
"",
|
27003
|
-
"// the same on
|
27004
|
+
"// the same on mine",
|
27004
27005
|
"f_kc(src, length, mult, useTrueRange) =>",
|
27005
27006
|
" float basis = ta.ema(src, length)",
|
27006
27007
|
" float span = (useTrueRange) ? ta.tr : (high - low)",
|
27007
27008
|
" float rangeEma = ta.ema(span, length)",
|
27008
27009
|
" [basis, basis + rangeEma * mult, basis - rangeEma * mult]",
|
27009
27010
|
" ",
|
27010
|
-
"[
|
27011
|
+
"[mineMiddle, mineUpper, mineLower] = f_kc(close, 5, 4, true)",
|
27011
27012
|
"",
|
27012
|
-
"plot(
|
27013
|
-
"plot(
|
27014
|
-
"plot(
|
27013
|
+
"plot(mineMiddle)",
|
27014
|
+
"plot(mineUpper)",
|
27015
|
+
"plot(mineLower)"
|
27015
27016
|
],
|
27016
27017
|
returns: [
|
27017
27018
|
"肯特纳通道"
|
@@ -27085,7 +27086,7 @@ else
|
|
27085
27086
|
"",
|
27086
27087
|
"plot(ta.kcw(close, 5, 4), color=color.yellow)",
|
27087
27088
|
"",
|
27088
|
-
"// the same on
|
27089
|
+
"// the same on mine",
|
27089
27090
|
"f_kcw(src, length, mult, useTrueRange) =>",
|
27090
27091
|
" float basis = ta.ema(src, length)",
|
27091
27092
|
" float span = (useTrueRange) ? ta.tr : (high - low)",
|
@@ -27179,7 +27180,7 @@ else
|
|
27179
27180
|
"",
|
27180
27181
|
"plot(ta.kcw(close, 5, 4), color=color.yellow)",
|
27181
27182
|
"",
|
27182
|
-
"// the same on
|
27183
|
+
"// the same on mine",
|
27183
27184
|
"f_kcw(src, length, mult, useTrueRange) =>",
|
27184
27185
|
" float basis = ta.ema(src, length)",
|
27185
27186
|
" float span = (useTrueRange) ? ta.tr : (high - low)",
|
@@ -30756,7 +30757,7 @@ else
|
|
30756
30757
|
},
|
30757
30758
|
{
|
30758
30759
|
name: "max_bars_back",
|
30759
|
-
desc: "脚本为每个变量和函数保留的历史缓冲区的长度,它确定可以使用`[]`历史引用运算符引用多少个过去的值。
|
30760
|
+
desc: "脚本为每个变量和函数保留的历史缓冲区的长度,它确定可以使用`[]`历史引用运算符引用多少个过去的值。Mine Script®运行时会自动检测所需的缓冲区大小。仅当由于自动检测失败而发生运行时错误时才需要使用此参数。有关历史缓冲区底层机制的更多信息,请访问[我们的帮助中心](https://www.tradingview.com/chart/?solution=43000587849)。可选。默认值为0。",
|
30760
30761
|
allowedTypeIDs: [
|
30761
30762
|
"const int"
|
30762
30763
|
],
|
@@ -30914,7 +30915,7 @@ else
|
|
30914
30915
|
},
|
30915
30916
|
{
|
30916
30917
|
name: "use_bar_magnifier",
|
30917
|
-
desc: "可选。当为[true](#const_true)时,[经纪商模拟器](https://www.
|
30918
|
+
desc: "可选。当为[true](#const_true)时,[经纪商模拟器](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#broker-emulator)会在历史K线上回测时使用较低的时间周期数据,以获得更真实的结果。默认值为[false](#const_false)。只有[Premium](https://www.tradingview.com/gopro/)及更高级别的方案可以使用此功能。",
|
30918
30919
|
allowedTypeIDs: [
|
30919
30920
|
"const bool"
|
30920
30921
|
],
|
@@ -30938,7 +30939,7 @@ else
|
|
30938
30939
|
},
|
30939
30940
|
{
|
30940
30941
|
name: "dynamic_requests",
|
30941
|
-
desc: "指定脚本是否可以动态调用来自`request.*()`命名空间的函数。动态`request.*()`调用允许在条件结构(例如,[if](#kw_if))、循环(例如,[for](#kw_for))和导出函数的本地范围内进行。此外,此类调用允许为其许多参数使用“系列”参数。可选。默认值为[true](#const_true)。有关更多信息,请参阅用户手册的[动态请求](https://www.
|
30942
|
+
desc: "指定脚本是否可以动态调用来自`request.*()`命名空间的函数。动态`request.*()`调用允许在条件结构(例如,[if](#kw_if))、循环(例如,[for](#kw_for))和导出函数的本地范围内进行。此外,此类调用允许为其许多参数使用“系列”参数。可选。默认值为[true](#const_true)。有关更多信息,请参阅用户手册的[动态请求](https://www.tradingvue.com/mine-script-docs/concepts/other-timeframes-and-data/#dynamic-requests)部分。",
|
30942
30943
|
allowedTypeIDs: [
|
30943
30944
|
"const bool"
|
30944
30945
|
],
|
@@ -30964,9 +30965,9 @@ else
|
|
30964
30965
|
'strategy.exit("Exit", "Long", profit = 10, loss = 5)'
|
30965
30966
|
],
|
30966
30967
|
remarks: [
|
30967
|
-
"您可以在我们的[用户手册](https://www.
|
30968
|
+
"您可以在我们的[用户手册](https://www.tradingvue.com/mine-script-docs/concepts/strategies/)中了解有关策略的更多信息。",
|
30968
30969
|
"每个策略脚本必须有一个 [strategy](#fun_strategy) 调用。",
|
30969
|
-
"使用`calc_on_every_tick = true`参数的策略可能在历史和实时K线上计算不同,这会导致[重新绘制](https://www.
|
30970
|
+
"使用`calc_on_every_tick = true`参数的策略可能在历史和实时K线上计算不同,这会导致[重新绘制](https://www.tradingvue.com/mine-script-docs/concepts/repainting/)。",
|
30970
30971
|
"策略总是使用图表的价格进入和退出仓位。在非标准图表类型(Heikin Ashi、Renko 等)使用它们会产生误导性结果,因为它们的价格是合成的。因此不建议在非标准图表上进行回测。",
|
30971
30972
|
"除非使用深度回测模式,否则策略可以打开的最大订单数量为9000。如果策略超出此限制,则当“交易列表”标签页中出现新条目时,它会删除最旧的订单信息。`strategy.closedtrades.*()`函数返回已删除订单打开或关闭的交易的[na](#var_na)。要检索最早可用的已关闭交易的索引,请使用[strategy.closedtrades.first_index](#var_strategy.closedtrades.first_index)变量。"
|
30972
30973
|
],
|
@@ -30985,7 +30986,7 @@ else
|
|
30985
30986
|
name: "strategy.entry",
|
30986
30987
|
desc: [
|
30987
30988
|
"创建新订单以开仓或加仓。如果存在具有相同`id`的未成交订单,则调用此命令会修改该订单。",
|
30988
|
-
"生成的订单类型取决于`limit`和`stop`参数。如果调用不包含`limit`或`stop`参数,它会创建一个在下一个报价执行的[市价单](https://www.
|
30989
|
+
"生成的订单类型取决于`limit`和`stop`参数。如果调用不包含`limit`或`stop`参数,它会创建一个在下一个报价执行的[市价单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#market-orders)。如果调用指定了`limit`值但没有指定`stop` 值,它会下达一个[限价单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#limit-orders),在市场价格达到`limit`值或更优价格(买单更低,卖单更高)后执行。如果调用指定了`stop`值但没有指定`limit`值,则会下达[止损订单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#stop-and-stop-limit-orders),该订单在市场价格达到`stop`值或更差价格(买单为更高价格,卖单为更低价格)后执行。如果调用包含`limit`和`stop`参数,则会创建[止损限价](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#stop-and-stop-limit-orders)订单,该订单仅在市场价格达到`stop`值或更差价格后才会以`limit`价格生成限价订单。",
|
30989
30990
|
"与来自[strategy.order](#fun_strategy.order)的订单不同,来自此命令的订单受[strategy](#fun_strategy)声明语句的`pyramiding`参数的影响。金字塔式交易指定每个仓位允许的并发开仓数量。例如,使用`pyramiding = 3`,该策略最多可以有三笔开仓交易,并且该命令无法创建订单来开仓其他交易,直到至少有一笔现有交易结束。",
|
30990
30991
|
"默认情况下,当策略按照与当前市场仓位相反的方向执行此命令中的订单时,它会反转仓位。例如,如果有5股的未平多头仓位,则此命令中的`qty`为5且`direction`为[strategy.short](#const_strategy.short)的订单将触发卖出10股以平仓多头仓位并开设新的5股空头仓位。用户可以通过使用[strategy.risk_allow_entry_in](#fun_strategy.risk_allow_entry_in)函数指定允许的方向来更改此行为。"
|
30991
30992
|
],
|
@@ -31199,7 +31200,7 @@ else
|
|
31199
31200
|
name: "strategy.order",
|
31200
31201
|
desc: [
|
31201
31202
|
"创建新订单以开仓、增仓或平仓。如果存在具有相同`id`的未成交订单,则调用此命令会修改该订单。",
|
31202
|
-
"生成的订单类型取决于`limit`和`stop`参数。如果调用不包含`limit`或`stop`参数,它会创建一个在下一个报价执行的[市价单](https://www.
|
31203
|
+
"生成的订单类型取决于`limit`和`stop`参数。如果调用不包含`limit`或`stop`参数,它会创建一个在下一个报价执行的[市价单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#market-orders)。如果调用指定了`limit`值但没有指定`stop` 值,它会下达一个[限价单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#limit-orders),在市场价格达到`limit`值或更优价格(买单更低,卖单更高)后执行。如果调用指定了`stop`值但没有指定`limit`值,则会下达[止损订单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#stop-and-stop-limit-orders),该订单在市场价格达到`stop`值或更差价格(买单为更高价格,卖单为更低价格)后执行。如果调用包含`limit`和`stop`参数,则会创建[止损限价](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#stop-and-stop-limit-orders)订单,该订单仅在市场价格达到`stop`值或更差价格后才会以`limit`价格生成限价订单。",
|
31203
31204
|
"与来自[strategy.entry](#fun_strategy.entry)的订单不同,来自此命令的订单不受[strategy](#fun_strategy)声明语句的`pyramiding`参数的影响。策略可以通过调用此函数在同一方向开立任意数量的交易。",
|
31204
31205
|
"此命令不会自动反转未平仓位,因为它不像[strategy.entry](#fun_strategy.entry)那样专门创建入场订单。例如,如果有5股未平仓多头仓位,则此命令中的`qty`为5且`direction`为[strategy.short](#const_strategy.short)的订单将触发卖出5股,从而平仓。"
|
31205
31206
|
],
|
@@ -31413,9 +31414,9 @@ else
|
|
31413
31414
|
{
|
31414
31415
|
name: "strategy.exit",
|
31415
31416
|
desc: [
|
31416
|
-
"创建基于价格的订单以退出未平仓位。如果存在具有相同`id`的未完成退出订单,则调用此命令会修改这些订单。此命令可以生成多种类型的退出订单,具体取决于指定的参数。但是,它不会创建[市价单](https://www.
|
31417
|
-
"如果对此命令的调用包含`profit`或`limit`参数,它会创建[止盈](https://www.
|
31418
|
-
"此命令的调用指定了`trail_price`或`trail_points`参数和`trail_offset`参数时,可以创建[追踪止损](https://www.
|
31417
|
+
"创建基于价格的订单以退出未平仓位。如果存在具有相同`id`的未完成退出订单,则调用此命令会修改这些订单。此命令可以生成多种类型的退出订单,具体取决于指定的参数。但是,它不会创建[市价单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#market-orders)。要使用市价单退出仓位,请使用[strategy.close](#fun_strategy.close)或[strategy.close_all](#fun_strategy.close_all)。",
|
31418
|
+
"如果对此命令的调用包含`profit`或`limit`参数,它会创建[止盈](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#take-profit-and-stop-loss)订单,以在确定的价格水平或更优值(多头交易更高,空头交易更低)退出适用交易。如果调用包含`loss`或`stop`参数,它会创建[止损](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#take-profit-and-stop-loss) 订单,以在确定的水平或更差值(多头交易更低,空头交易更高)退出适用交易。使用`profit`或`limit`,和`loss`或 `stop`参数调用此命令会创建包含两种订单类型的订单括号。",
|
31419
|
+
"此命令的调用指定了`trail_price`或`trail_points`参数和`trail_offset`参数时,可以创建[追踪止损](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#trailing-stops)订单。当价格移动`trail_points`tick超过入场价或触及`trail_price`水平时,追踪止损订单将激活。一旦激活,每次交易利润达到新高时,止损都会跟随市场价格`trail_offset`tick。当交易未达到新的最佳值时,止损不会移动。",
|
31419
31420
|
"每次调用此命令都会保留一部分仓位以进行平仓,直到策略完成或取消其订单。例如,如果有50份合约的未平仓位,并且[strategy.exit](#fun_strategy.exit)调用指定`qty`为20,则该调用的订单会保留20份合约。第二个调用最多可以平仓30份合约,即使其`qty`为50且其中一个订单先执行。此行为不会影响其他命令的订单,例如[strategy.close](#fun_strategy.close)或[strategy.order](#fun_strategy.order)。",
|
31420
31421
|
"如果在创建的入场订单执行之前调用此命令,则该策略将等待并且在入场订单执行之后才创建退出订单。"
|
31421
31422
|
],
|
@@ -31805,8 +31806,8 @@ else
|
|
31805
31806
|
}
|
31806
31807
|
],
|
31807
31808
|
remarks: [
|
31808
|
-
"一次调用[strategy.exit](#fun_strategy.exit)命令即可为未平仓位的多个入场点生成退出订单,具体取决于调用的`from_entry`值。如果调用不包含 `from_entry` 参数,它会为所有未平仓交易创建退出订单,即使是调用后开仓的交易,直到仓位关闭。请参阅我们的用户手册中的[这个](https://www.
|
31809
|
-
"当一个仓位由多笔未平仓交易组成,并且[strategy](#fun_strategy)声明语句中的`close_entries_rule`为“FIFO”(默认)时,来自[strategy.exit](#fun_strategy.exit)调用的订单将从第一笔未平仓交易开始退出仓位。即使`from_entry`值是不同未平仓交易的入场ID,此行为也适用。但是,在这种情况下,退出订单的最大规模仍然取决于ID为`from_entry`的订单开仓的交易。有关更多信息,请参阅我们的用户手册的[这个](https://www.
|
31809
|
+
"一次调用[strategy.exit](#fun_strategy.exit)命令即可为未平仓位的多个入场点生成退出订单,具体取决于调用的`from_entry`值。如果调用不包含 `from_entry` 参数,它会为所有未平仓交易创建退出订单,即使是调用后开仓的交易,直到仓位关闭。请参阅我们的用户手册中的[这个](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#exits-for-multiple-entries)部分,了解更多信息。",
|
31810
|
+
"当一个仓位由多笔未平仓交易组成,并且[strategy](#fun_strategy)声明语句中的`close_entries_rule`为“FIFO”(默认)时,来自[strategy.exit](#fun_strategy.exit)调用的订单将从第一笔未平仓交易开始退出仓位。即使`from_entry`值是不同未平仓交易的入场ID,此行为也适用。但是,在这种情况下,退出订单的最大规模仍然取决于ID为`from_entry`的订单开仓的交易。有关更多信息,请参阅我们的用户手册的[这个](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#closing-a-market-position)部分。",
|
31810
31811
|
"如果[strategy.exit](#fun_strategy.exit)调用包含创建止损和追踪止损订单的参数,则该命令仅下达应该首先填写的订单,因为两个订单都是“止损”类型。"
|
31811
31812
|
],
|
31812
31813
|
syntax: [
|
@@ -31820,7 +31821,7 @@ else
|
|
31820
31821
|
name: "strategy.cancel",
|
31821
31822
|
desc: [
|
31822
31823
|
"取消具有特定标识符的待处理或未执行订单。如果多个未执行订单共享同一个 ID,则使用该ID作为`id`参数调用此命令将取消所有订单。如果脚本使用表示已执行订单ID的`id`调用此命令,则不起作用。",
|
31823
|
-
"此命令在处理基于价格的订单(例如,[限价订单](https://www.
|
31824
|
+
"此命令在处理基于价格的订单(例如,[限价订单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#limit-orders))非常有用。调用此命令还可以取消[市价订单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#market-orders),但前提是它们在与下单命令相同的报价上执行。"
|
31824
31825
|
],
|
31825
31826
|
args: [
|
31826
31827
|
{
|
@@ -31857,7 +31858,7 @@ else
|
|
31857
31858
|
name: "strategy.cancel_all",
|
31858
31859
|
desc: [
|
31859
31860
|
"取消所有待处理或未完成的订单,无论其标识符是什么。",
|
31860
|
-
"此命令在处理基于价格的订单(例如,[限价订单](https://www.
|
31861
|
+
"此命令在处理基于价格的订单(例如,[限价订单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#limit-orders))非常有用。调用此命令还可以取消[市价订单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#market-orders),但前提是它们在与下单命令相同的报价上执行。"
|
31861
31862
|
],
|
31862
31863
|
examples: [
|
31863
31864
|
"//@version=6",
|
@@ -32156,7 +32157,7 @@ else
|
|
32156
32157
|
name: "strategy.close_all",
|
32157
32158
|
desc: [
|
32158
32159
|
"创建订单来完全关闭一个未平仓位,无论打开或添加的订单的标识符是什么。",
|
32159
|
-
"此命令始终生成 [市价单](https://www.
|
32160
|
+
"此命令始终生成 [市价单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#market-orders)。要使用基于价格的订单(例如,[止损](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#take-profit-and-stop-loss)订单)退出仓位,请使用[strategy.exit](#fun_strategy.exit)命令。"
|
32160
32161
|
],
|
32161
32162
|
args: [
|
32162
32163
|
{
|
@@ -32212,7 +32213,7 @@ else
|
|
32212
32213
|
name: "strategy.close_all",
|
32213
32214
|
desc: [
|
32214
32215
|
"创建订单来完全关闭一个未平仓位,无论打开或添加的订单的标识符是什么。",
|
32215
|
-
"此命令始终生成 [市价单](https://www.
|
32216
|
+
"此命令始终生成 [市价单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#market-orders)。要使用基于价格的订单(例如,[止损](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#take-profit-and-stop-loss)订单)退出仓位,请使用[strategy.exit](#fun_strategy.exit)命令。"
|
32216
32217
|
],
|
32217
32218
|
args: [
|
32218
32219
|
{
|
@@ -32424,7 +32425,7 @@ else
|
|
32424
32425
|
name: "strategy.close",
|
32425
32426
|
desc: [
|
32426
32427
|
"创建订单以退出由具有特定标识符的入场订单所开仓的部分。如果仓位中的多个条目共享相同的 ID,则当该命令的调用使用该 ID 作为 `id` 参数时,该命令的订单将适用于所有这些条目,从第一个开仓交易开始。",
|
32427
|
-
"此命令始终生成 [市价单](https://www.
|
32428
|
+
"此命令始终生成 [市价单](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#market-orders)。要使用基于价格的订单(例如,[止损](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#take-profit-and-stop-loss)订单)退出仓位,请使用[strategy.exit](#fun_strategy.exit)命令。"
|
32428
32429
|
],
|
32429
32430
|
args: [
|
32430
32431
|
{
|
@@ -32534,7 +32535,7 @@ else
|
|
32534
32535
|
"plot(strategy.position_size)"
|
32535
32536
|
],
|
32536
32537
|
remarks: [
|
32537
|
-
"当一个仓位由多笔未平仓交易组成,并且[strategy](#fun_strategy)声明语句中的`close_entries_rule`为“FIFO”(默认)时,[strategy.close](#fun_strategy.close)调用将从第一笔未平仓交易开始退出仓位。即使`id`值是不同未平仓交易的入场ID,此行为也适用。但是,在这种情况下,最大退出订单规模仍然取决于具有`id`标识符的订单开立的交易。有关更多信息,请参阅我们的用户手册的[这个](https://www.
|
32538
|
+
"当一个仓位由多笔未平仓交易组成,并且[strategy](#fun_strategy)声明语句中的`close_entries_rule`为“FIFO”(默认)时,[strategy.close](#fun_strategy.close)调用将从第一笔未平仓交易开始退出仓位。即使`id`值是不同未平仓交易的入场ID,此行为也适用。但是,在这种情况下,最大退出订单规模仍然取决于具有`id`标识符的订单开立的交易。有关更多信息,请参阅我们的用户手册的[这个](https://www.tradingvue.com/mine-script-docs/concepts/strategies/#closing-a-market-position)部分。"
|
32538
32539
|
],
|
32539
32540
|
syntax: [
|
32540
32541
|
"strategy.close(id, comment, qty, qty_percent, alert_message, immediately, disable_alert) → void"
|
@@ -34067,7 +34068,7 @@ else
|
|
34067
34068
|
},
|
34068
34069
|
{
|
34069
34070
|
name: "xloc",
|
34070
|
-
desc: "确定框是否将`left`和`right`参数视为K线索引或时间戳。可能的值:[xloc.bar_index](#const_xloc.bar_index)和[xloc.bar_time](#const_xloc.bar_time)。如果值为[xloc.bar_index](#const_xloc.bar_index),则参数表示K线索引。如果为[xloc.bar_time](#const_xloc.bar_time),则参数表示[UNIX timestamps](https://www.
|
34071
|
+
desc: "确定框是否将`left`和`right`参数视为K线索引或时间戳。可能的值:[xloc.bar_index](#const_xloc.bar_index)和[xloc.bar_time](#const_xloc.bar_time)。如果值为[xloc.bar_index](#const_xloc.bar_index),则参数表示K线索引。如果为[xloc.bar_time](#const_xloc.bar_time),则参数表示[UNIX timestamps](https://www.tradingvue.com/mine-script-docs/concepts/time/#unix-timestamps)。",
|
34071
34072
|
required: !0,
|
34072
34073
|
allowedTypeIDs: [
|
34073
34074
|
"series string",
|
@@ -36792,9 +36793,9 @@ else
|
|
36792
36793
|
desc: [
|
36793
36794
|
"函数设置可用于给定内置或用户变量的历史引用的最大柱数。 当运算符'[]'应用于变量时 - 它是对该变量的历史值的引用。",
|
36794
36795
|
"",
|
36795
|
-
"如果运算符“[]”的参数是编译时常量值(例如“v[10]”、“close[500]”),则无需对该变量使用“max_bars_back”函数。
|
36796
|
+
"如果运算符“[]”的参数是编译时常量值(例如“v[10]”、“close[500]”),则无需对该变量使用“max_bars_back”函数。Mine Script®编译器将使用该常量值作为历史缓冲区大小。",
|
36796
36797
|
"",
|
36797
|
-
"如果运算符“[]”的参数是在运行时计算的值(例如“v[i]”,其中“i”是系列变量),则
|
36798
|
+
"如果运算符“[]”的参数是在运行时计算的值(例如“v[i]”,其中“i”是系列变量),则Mine Script®会尝试在运行时自动检测历史缓冲区大小。有时它会失败并且脚本在运行时崩溃,因为它最终引用了缓冲区之外的历史值。在这种情况下,您应该使用“max_bars_back”手动解决该问题。"
|
36798
36799
|
],
|
36799
36800
|
args: [
|
36800
36801
|
{
|
@@ -41163,7 +41164,7 @@ else
|
|
41163
41164
|
// {
|
41164
41165
|
// "name": "request.seed",
|
41165
41166
|
// "desc": [
|
41166
|
-
// "从用户维护的GitHub存储库请求数据并将其作为系列返回。有关如何添加新数据的深入教程可以在[here](https://github.com/tradingview-eod/
|
41167
|
+
// "从用户维护的GitHub存储库请求数据并将其作为系列返回。有关如何添加新数据的深入教程可以在[here](https://github.com/tradingview-eod/mine-seeds-docs)中找到。"
|
41167
41168
|
// ],
|
41168
41169
|
// "args": [
|
41169
41170
|
// {
|
@@ -41192,7 +41193,7 @@ else
|
|
41192
41193
|
// },
|
41193
41194
|
// {
|
41194
41195
|
// "name": "expression",
|
41195
|
-
// "desc": "要从所请求商品的上下文中计算和返回的表达式。它可以是内置变量如[close](#var_close),表达式如`ta.sma(close, 100)`,先前在脚本中计算的非可变变量,不使用
|
41196
|
+
// "desc": "要从所请求商品的上下文中计算和返回的表达式。它可以是内置变量如[close](#var_close),表达式如`ta.sma(close, 100)`,先前在脚本中计算的非可变变量,不使用Mine Script®绘图的函数调用、数组、矩阵、 或一个元组。不允许可变变量,除非它们包含在表达式中使用的函数体中。",
|
41196
41197
|
// "required": true,
|
41197
41198
|
// "allowedTypeIDs": [],
|
41198
41199
|
// "displayType": "<arg_expr_type>"
|
@@ -49739,7 +49740,7 @@ else
|
|
49739
49740
|
{
|
49740
49741
|
name: "library",
|
49741
49742
|
desc: [
|
49742
|
-
"将脚本标识为[库](https://www.
|
49743
|
+
"将脚本标识为[库](https://www.tradingvue.com/mine-script-docs/concepts/libraries/)的声明语句。"
|
49743
49744
|
],
|
49744
49745
|
args: [
|
49745
49746
|
{
|
@@ -49761,7 +49762,7 @@ else
|
|
49761
49762
|
},
|
49762
49763
|
{
|
49763
49764
|
name: "dynamic_requests",
|
49764
|
-
desc: "指定脚本是否可以动态调用来自`request.*()`命名空间的函数。动态`request.*()`调用允许在条件结构(例如,[if](#kw_if))、循环(例如,[for](#kw_for))和导出函数的本地范围内进行。此外,此类调用允许为其许多参数使用“系列”参数。可选。默认值为[true](#const_true)。有关更多信息,请参阅用户手册的[动态请求](https://www.
|
49765
|
+
desc: "指定脚本是否可以动态调用来自`request.*()`命名空间的函数。动态`request.*()`调用允许在条件结构(例如,[if](#kw_if))、循环(例如,[for](#kw_for))和导出函数的本地范围内进行。此外,此类调用允许为其许多参数使用“系列”参数。可选。默认值为[true](#const_true)。有关更多信息,请参阅用户手册的[动态请求](https://www.tradingvue.com/mine-script-docs/concepts/other-timeframes-and-data/#dynamic-requests)部分。",
|
49765
49766
|
allowedTypeIDs: [
|
49766
49767
|
"const bool"
|
49767
49768
|
],
|
@@ -49817,7 +49818,7 @@ else
|
|
49817
49818
|
{
|
49818
49819
|
name: "log.info",
|
49819
49820
|
desc: [
|
49820
|
-
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“info”调试级别的“
|
49821
|
+
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“info”调试级别的“Mine日志”菜单。",
|
49821
49822
|
"",
|
49822
49823
|
"对于要格式化的每个值,格式化字符串可以包含文字文本和大括号{}中的一个占位符。每个占位符都包含将替换它的所需参数的索引(从0开始)和一个可选的格式说明符。索引表示该参数在函数参数列表中的位置。"
|
49823
49824
|
],
|
@@ -49866,7 +49867,7 @@ else
|
|
49866
49867
|
"",
|
49867
49868
|
"用作`formatString`参数的字符串可以包含单引号字符 (')。但是,必须将该字符串中的所有单引号配对,以避免意外的格式化结果。",
|
49868
49869
|
"",
|
49869
|
-
"可以从
|
49870
|
+
"可以从Mine编辑器中的“更多”下拉菜单,和在使用`log.*()`函数的任何脚本的状态行中的“更多”下拉菜单中访问“Mine 日志...”按钮。"
|
49870
49871
|
],
|
49871
49872
|
syntax: [
|
49872
49873
|
"log.info(message) → void"
|
@@ -49878,7 +49879,7 @@ else
|
|
49878
49879
|
{
|
49879
49880
|
name: "log.info",
|
49880
49881
|
desc: [
|
49881
|
-
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“info”调试级别的“
|
49882
|
+
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“info”调试级别的“Mine日志”菜单。",
|
49882
49883
|
"",
|
49883
49884
|
"对于要格式化的每个值,格式化字符串可以包含文字文本和大括号{}中的一个占位符。每个占位符都包含将替换它的所需参数的索引(从0开始)和一个可选的格式说明符。索引表示该参数在函数参数列表中的位置。"
|
49884
49885
|
],
|
@@ -49955,7 +49956,7 @@ else
|
|
49955
49956
|
"",
|
49956
49957
|
"用作`formatString`参数的字符串可以包含单引号字符 (')。但是,必须将该字符串中的所有单引号配对,以避免意外的格式化结果。",
|
49957
49958
|
"",
|
49958
|
-
"可以从
|
49959
|
+
"可以从Mine编辑器中的“更多”下拉菜单,和在使用`log.*()`函数的任何脚本的状态行中的“更多”下拉菜单中访问“Mine 日志...”按钮。"
|
49959
49960
|
],
|
49960
49961
|
syntax: [
|
49961
49962
|
"log.info(formatString, arg0, arg1, ...) → void"
|
@@ -49967,7 +49968,7 @@ else
|
|
49967
49968
|
{
|
49968
49969
|
name: "log.warning",
|
49969
49970
|
desc: [
|
49970
|
-
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“warning”调试级别的“
|
49971
|
+
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“warning”调试级别的“Mine日志”菜单。",
|
49971
49972
|
"",
|
49972
49973
|
"对于要格式化的每个值,格式化字符串可以包含文字文本和大括号{}中的一个占位符。每个占位符都包含将替换它的所需参数的索引(从0开始)和一个可选的格式说明符。索引表示该参数在函数参数列表中的位置。"
|
49973
49974
|
],
|
@@ -50016,7 +50017,7 @@ else
|
|
50016
50017
|
"",
|
50017
50018
|
"用作`formatString`参数的字符串可以包含单引号字符 (')。但是,必须将该字符串中的所有单引号配对,以避免意外的格式化结果。",
|
50018
50019
|
"",
|
50019
|
-
"可以从
|
50020
|
+
"可以从Mine编辑器中的“更多”下拉菜单,和在使用`log.*()`函数的任何脚本的状态行中的“更多”下拉菜单中访问“Mine 日志...”按钮。"
|
50020
50021
|
],
|
50021
50022
|
syntax: [
|
50022
50023
|
"log.warning(message) → void"
|
@@ -50028,7 +50029,7 @@ else
|
|
50028
50029
|
{
|
50029
50030
|
name: "log.warning",
|
50030
50031
|
desc: [
|
50031
|
-
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“warning”调试级别的“
|
50032
|
+
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“warning”调试级别的“Mine日志”菜单。",
|
50032
50033
|
"",
|
50033
50034
|
"对于要格式化的每个值,格式化字符串可以包含文字文本和大括号{}中的一个占位符。每个占位符都包含将替换它的所需参数的索引(从0开始)和一个可选的格式说明符。索引表示该参数在函数参数列表中的位置。"
|
50034
50035
|
],
|
@@ -50105,7 +50106,7 @@ else
|
|
50105
50106
|
"",
|
50106
50107
|
"用作`formatString`参数的字符串可以包含单引号字符 (')。但是,必须将该字符串中的所有单引号配对,以避免意外的格式化结果。",
|
50107
50108
|
"",
|
50108
|
-
"可以从
|
50109
|
+
"可以从Mine编辑器中的“更多”下拉菜单,和在使用`log.*()`函数的任何脚本的状态行中的“更多”下拉菜单中访问“Mine 日志...”按钮。"
|
50109
50110
|
],
|
50110
50111
|
syntax: [
|
50111
50112
|
"log.warning(formatString, arg0, arg1, ...) → void"
|
@@ -50117,7 +50118,7 @@ else
|
|
50117
50118
|
{
|
50118
50119
|
name: "log.error",
|
50119
50120
|
desc: [
|
50120
|
-
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“error”调试级别的“
|
50121
|
+
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“error”调试级别的“Mine日志”菜单。",
|
50121
50122
|
"",
|
50122
50123
|
"对于要格式化的每个值,格式化字符串可以包含文字文本和大括号{}中的一个占位符。每个占位符都包含将替换它的所需参数的索引(从0开始)和一个可选的格式说明符。索引表示该参数在函数参数列表中的位置。"
|
50123
50124
|
],
|
@@ -50166,7 +50167,7 @@ else
|
|
50166
50167
|
"",
|
50167
50168
|
"用作`formatString`参数的字符串可以包含单引号字符 (')。但是,必须将该字符串中的所有单引号配对,以避免意外的格式化结果。",
|
50168
50169
|
"",
|
50169
|
-
"可以从
|
50170
|
+
"可以从Mine编辑器中的“更多”下拉菜单,和在使用`log.*()`函数的任何脚本的状态行中的“更多”下拉菜单中访问“Mine 日志...”按钮。"
|
50170
50171
|
],
|
50171
50172
|
syntax: [
|
50172
50173
|
"log.error(message) → void"
|
@@ -50178,7 +50179,7 @@ else
|
|
50178
50179
|
{
|
50179
50180
|
name: "log.error",
|
50180
50181
|
desc: [
|
50181
|
-
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“error”调试级别的“
|
50182
|
+
"将格式字符串和值转换为格式化的字符串,并将结果发送到标有“error”调试级别的“Mine日志”菜单。",
|
50182
50183
|
"",
|
50183
50184
|
"对于要格式化的每个值,格式化字符串可以包含文字文本和大括号{}中的一个占位符。每个占位符都包含将替换它的所需参数的索引(从0开始)和一个可选的格式说明符。索引表示该参数在函数参数列表中的位置。"
|
50184
50185
|
],
|
@@ -50255,7 +50256,7 @@ else
|
|
50255
50256
|
"",
|
50256
50257
|
"用作`formatString`参数的字符串可以包含单引号字符 (')。但是,必须将该字符串中的所有单引号配对,以避免意外的格式化结果。",
|
50257
50258
|
"",
|
50258
|
-
"可以从
|
50259
|
+
"可以从Mine编辑器中的“更多”下拉菜单,和在使用`log.*()`函数的任何脚本的状态行中的“更多”下拉菜单中访问“Mine 日志...”按钮。"
|
50259
50260
|
],
|
50260
50261
|
syntax: [
|
50261
50262
|
"log.error(formatString, arg0, arg1, ...) → void"
|
@@ -51533,7 +51534,7 @@ else
|
|
51533
51534
|
},
|
51534
51535
|
{
|
51535
51536
|
name: "xloc",
|
51536
|
-
desc: "确定框是否将`left`和`right`参数视为K线索引或时间戳。可能的值:[xloc.bar_index](#const_xloc.bar_index)和[xloc.bar_time](#const_xloc.bar_time)。如果值为[xloc.bar_index](#const_xloc.bar_index),则参数表示K线索引。如果为[xloc.bar_time](#const_xloc.bar_time),则参数表示[UNIX timestamps](https://www.
|
51537
|
+
desc: "确定框是否将`left`和`right`参数视为K线索引或时间戳。可能的值:[xloc.bar_index](#const_xloc.bar_index)和[xloc.bar_time](#const_xloc.bar_time)。如果值为[xloc.bar_index](#const_xloc.bar_index),则参数表示K线索引。如果为[xloc.bar_time](#const_xloc.bar_time),则参数表示[UNIX timestamps](https://www.tradingvue.com/mine-script-docs/concepts/time/#unix-timestamps)。",
|
51537
51538
|
required: !0,
|
51538
51539
|
allowedTypeIDs: [
|
51539
51540
|
"series string",
|