“strategy.opentrades.profit”现在在Tradingview的笔录中工作吗??
如果我使用该变量,则会出现以下错误。*未声明的标识符“strategy.opentrades.profit”
我认为每一个‘strategy.opentrades’。变量级数不起作用..。
你能帮我测试一次吗?谢谢:)
发布于 2022-06-08 04:46:47
试着工作了。
代码直接取自tradingview pinscript文档页面
// Returns the profit of the last open trade.
//@version=5
strategy("`strategy.opentrades.profit` Example 1", commission_type = strategy.commission.percent, commission_value = 0.1)
// Strategy calls to enter long trades every 15 bars and exit long trades every 20 bars.
if bar_index % 15 == 0
strategy.entry("Long", strategy.long)
if bar_index % 20 == 0
strategy.close("Long")
plot(strategy.opentrades.profit(strategy.opentrades - 1), "Profit of the latest open trade")https://stackoverflow.com/questions/72539480
复制相似问题