Help needed in coding stochRSI as a buy strategy
Posted: Wed Apr 06, 2022 12:15 pm
Hi There.
I am working on a strategy and need help to develop a strategy by using StochRSI as my entry for long and short.
below is the code,
conditionbuy = ta.crossover(k,d) and (k < 20)
conditionsold = ta.crossover(d,k) and (k > 80)
i have using the above code to combine it with my ema crossover but it is not workinng
Long = ta.crossover (ema1,ema2) and ta.rsi(close,14)>=50 and conditionbuy
Short = ta.crossunder(ema1,ema2) and ta.rsi(close,14)<50 and conditionsold
Can someone help me on what i am doing wrong here.
Thanks
Ahsan
I am working on a strategy and need help to develop a strategy by using StochRSI as my entry for long and short.
below is the code,
conditionbuy = ta.crossover(k,d) and (k < 20)
conditionsold = ta.crossover(d,k) and (k > 80)
i have using the above code to combine it with my ema crossover but it is not workinng
Long = ta.crossover (ema1,ema2) and ta.rsi(close,14)>=50 and conditionbuy
Short = ta.crossunder(ema1,ema2) and ta.rsi(close,14)<50 and conditionsold
Can someone help me on what i am doing wrong here.
Thanks
Ahsan