首页 > 解决方案 > strategy.close 标准未执行

问题描述

进入是在一根柱线反转上,如果当前柱线低于前一根柱线低点或高于前一根柱线高点,则收盘。进入标准运行正确,但它不运行退出标准。不知道我做错了什么

//@version=4
exitShort = iff(close > open and close > high[1], true, false)
exitLong = iff(close < open and close < low[1], true, false)
strategy("OneBarReversal", overlay=true)
if (low < low[1] and close > high[1])
    strategy.entry("RevBarUp", strategy.long)
strategy.close("Elong", when = exitLong)
if (high > high[1] and close < low[1])
    strategy.entry("RevBarDn", strategy.short)
strategy.close("Eshort", when = exitShort)

标签: pine-script

解决方案


推荐阅读