Lo stocastico RSI non ha due linee, almeno quello della piattaforma:
DEFPARAM CalculateOnLastBars = 1000
ONCE RsiP= 14
MyRsi = RSI [ RsiP] (close )
MinRSI = lowest [ RsiP] (MyRsi)
MaxRSI = highest [ RsiP] (MyRsi)
StochRSI = ((MyRsi- MinRSI) / (MaxRSI- MinRSI)) * 100
IF StochRSI < 0 THEN
StochRSI = 0
ENDIF
IF StochRSI > 100 THEN
StochRSI = 100
ENDIF
return StochRSI as "Stoch RSI" ,80 AS "80" ,20 AS "20"
però ce l’ha questo di Nicolas (https://www.prorealcode.com/prorealtime-indicators/stochastic-rsi/ ):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//PRC_Stochastic RSI | indicator
//06.12.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted and adapted from Pinescript version
// -- parameters:
lengthRSI = 15 //RSI period
lengthStoch = 10 //Stochastic period
smoothK = 10 //Smooth signal of stochastic RSI
smoothD = 3 //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)
return K as "K%" , D as "D%"