Pine脚本-“内部服务器学习错误”-TradingView

时间:2020-06-13 12:40:25

标签: pine-script

大家!设置strategy(close_entries_rule= "ANY")并尝试使用strategy.close(id= "EL 2")平仓时,我遇到错误“内部服务器学习错误”

以下来自 kodify.net 的代码似乎对文章作者有效,但是当我复制并保存在TradingView Pine编辑器中时,它给我“内部服务器学习错误”

strategy(title="Exit from specific entries", overlay=true,
     pyramiding=2, close_entries_rule="ANY")

// Determine trading conditions
newDay = (dayofmonth != dayofmonth[1])

firstEntry  = newDay and (dayofweek == dayofweek.monday)
secondEntry = newDay and (dayofweek == dayofweek.tuesday)

firstExit  = newDay and (dayofweek == dayofweek.thursday)
secondExit = newDay and (dayofweek == dayofweek.friday)

// Submit entry orders
if (firstEntry)
    strategy.entry(id="EL 1", long=true)

if (secondEntry)
    strategy.entry(id="EL 2", long=true)

// Generate exit orders
if (firstExit)
    strategy.close(id="EL 2")

if (secondExit)
    strategy.close(id="EL 1")

在此先感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

这一定是因为您在不允许套期保值的美国市场上经营策略。应该适用于非美元外汇或加密货币。从refman on strategy()看这个:

enter image description here enter image description here