RSI trail pinescript - PullRequest
       36

RSI trail pinescript

0 голосов
/ 20 июня 2020

Мне нужна помощь в RSI pinescript = предположим, что цена «X» составляет 6000 долларов, и она возрастает до 7000 долларов, а RSI также выходит за пределы диапазона 70. Теперь я хочу, чтобы оповещение активировалось, когда оно упадет до 6980 долларов (т. Е. Откатится на 20 долларов). Как я могу закодировать этот скрипт TRAIL в 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}}")  
       
...