我需要帮助在RSI pinescript=假设'X‘的价格是6,000美元,它上升到7,000美元,RSI也高于band70。现在我希望警报在它跌到6980美元时被激活(即回落20美元)。如何在RSI pinescript中编写此跟踪脚本。
//@version=4
study("rsi overbought", overlay=true)
rsiSource = input(title="RSI Source", type=input.source, defval=close)
rsiLength = input(title="RSI Length", type=input.integer, defval=14)
rsiOverbought = input(title="RSI Overbought Level", type=input.integer, defval=70)
rsiValue = rsi(rsiSource, rsiLength)
isRsiOB = rsiValue >= rsiOverbought
plotshape(isRsiOB, title="Overbought", location=location.abovebar, color=color.red, transp=0, style=shape.triangledown, text="Sell")
alertcondition(isRsiOB , title="RSI Signal!", message="RSI Signal Detected for {{ticker}}") 发布于 2021-05-23 13:28:51
试试像这样的东西
trail_high = highest(high,20) //highest high of 20 bars
down_num = 20 //the trailing 20$
if( low < trail_high - down_num)
alert_code PS这将在蜡烛关闭后触发
https://stackoverflow.com/questions/62488922
复制相似问题