Page 1 of 1

Help needed in coding stochRSI as a buy strategy

Posted: Wed Apr 06, 2022 12:15 pm
by ahalam@live.com
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

Re: Help needed in coding stochRSI as a buy strategy

Posted: Wed Feb 01, 2023 8:16 pm
by processingclouds
Hey

If you can paste the complete code, it will give better understanding on where it is not working.