//PRC_STOCH RSI multiperiods HeatMap | indicator
//https://www.prorealcode.com/topic/stoch-rsi-heat-map/
//Plot an heatmap of the RSI range of periods
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
startperiod=14 //start period of the loop
maxscale=200 //end period of the loop
Step=7 //period step of the loop
// --- end of settings
iPeriod=startperiod //first period to test is..startperiod
while iPeriod<=maxscale do
// --- indicator calculation
A=exponentialaverage[iperiod](close)
AH=exponentialaverage[iperiod](high)
AL=exponentialaverage[iperiod](low)
RSI14 = RSI[14](A)
MinRSI = lowest[14](RSI[14](AH))
MaxRSI = highest[14](RSI[14](AL))
StochRSI = (RSI14-MinRSI) / (MaxRSI-MinRSI)*100
// -----
result=stochRSI
R = max(0,50+(200-(result-50)*12))
G = max(0,50+(200+(result-50)*12))
drawtext("■",barindex,iperiod,dialog,bold,18) coloured(min(max(10,r),255),min(max(10,g),255),0)
iPeriod=max(startperiod,iPeriod+Step) //increase indicator period for next loop iteration
wend
return startperiod,maxscale