我正在制作简单的Swing High和Swing Low查找器/警报,并且一切正常,除了在很多情况下Swing High接连出现而又是Swing高。
逻辑很简单-如果前两根蜡烛低于此蜡烛,而后两根蜡烛也低于该蜡烛,则定义为摆动高
我要实现的是仅在前一个图没有一直高摆高时才将高摆高。
这里是代码
//@version=4
study("Swing Point Finder")
hhCondition = high[4] < high[2] and high[3] < high[2] and high[1] < high[2] and high < high[2]
llCondition = low[4] > low[2] and low[3] > low[2] and low[1] > low[2] and low > low[2]
plot(hhCondition ? 1 : 0, "Swing High found", color.green, offset = -2)
plot(llCondition ? 1 : 0, "Swing Low found", color.red, offset = -2)
我正在制作简单的Swing High和Swing Low查找器/警报,并且一切正常,除了在许多情况下Swing High接连出现而又是Swing高。逻辑很简单-高摆幅是...
也许您可以尝试这样的事情: