I’m still new to PRT, so I have simple question.
I would like to use the Stochastic RSI indicator (the existing build-in version) in a backtest. I tried: indicator = call “Stochastic RSI” , but this does not work as it can not find the indicator. It does not seem to be in the formula list either.
Can you help me with this? thanks!
NB: I just made my own Indicator using the code from https://www.prorealcode.com/topic/prt_stochastic-rsi-v1-1/ which seems have the same result.
However, this takes quite some computing power. Is there another or faster solution?
Pretty sure that using CALL just brings up the same code, but I find it faster and simpler to build it in to your algo – and a lot easier to optimize:
//Stochastic RSI | indicator
lengthRSI = lr //RSI period
lengthStoch = ls //Stochastic period
smoothK = sk //Smooth signal of stochastic RSI
smoothD = sd //Smooth signal of smoothed stochastic RSI
myRSI = RSI[lengthRSI](close)
MinRSI = lowest[lengthStoch](myrsi)
MaxRSI = highest[lengthStoch](myrsi)
StochRSI = (myRSI-MinRSI) / (MaxRSI-MinRSI)
K = average[smoothK](stochrsi)*100
D = average[smoothD](K)
c1 = K>D
c2 = K<D