我正在测试贸易视图以创建自定义警报,但是我不知道为什么警报与plotshape的行为不同。
每个栏设置一次设置一次警报,因此我假设它在蜡烛后检查变量
plotshape(closeLong == true,style=shape.triangleup, text="CLOSE LONG", location=location.belowbar, color=color.white, size=size.small)
plotshape(closeShort == true,style=shape.triangledown, text="CLOSE SHORT",color=color.white, size=size.small)
alertcondition(closeLong == true, title='Close Long Signal', message='Close Long Signal Alert')
alertcondition(closeShort == true, title='Close Short Signal', message='Close Short Signal Alert')
plotshape(currentAction == 1,style=shape.triangleup, text="BUY", location=location.belowbar, color=color.green, size=size.small)
plotshape(currentAction == -1,style=shape.triangledown, text="SELL",color=color.red, size=size.small)
alertcondition(currentAction == 1, title='Buy Signal', message='Buy Signal Alert')
alertcondition(currentAction == -1, title='Sell Signal', message='Sell Signal Alert')
Plotshape可以正常工作,但有时会发出警报,而大多数时候则不会。