Just a simple MACD (Moving Aveage Convergence Divergence) indicator made of RSI, but this time with adaptive period for the moving averages.
As usual, you can play with settings to find your best parameters to your own trading style.
Converted from a MQL4 version to prorealtime, by a request in the Spanish forum.
//PRC_MACD_RSI_Adaptive | indicator
//09.11.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//translated from MQL4 code
// --- settings
//FastPeriod = 14
//SlowPeriod = 34
//SignalPeriod = 9
//SignalMethod = 1 //moving average type (1=EMA)
//RsiPeriod = 14
// --- end of settings
rrsi = rsi[RsiPeriod](close)
price = average[1](close)
if barindex>SlowPeriod then
//fastRema
RSvoltl=abs(rrsi-50)+1.0
multi=(5.0+100.0/rsiPeriod)/(0.06+0.92*RSvoltl+0.02*square(RSvoltl))
fastalpha = 2.0 /(1.0+multi*FastPeriod)
fastRema = fastRema[1]+fastalpha*(price-fastRema[1])
//slowRema
slowalpha = 2.0 /(1.0+multi*SlowPeriod)
SlowRema = SlowRema[1]+slowalpha*(price-SlowRema[1])
mmacd = fastRema-SlowRema
signal = average[SignalPeriod,SignalMethod](mmacd)
if signal>signal[1] then
r=50
g=205
b=50
else
r=255
g=140
b=0
endif
endif
return mmacd coloured(100,100,100,100) style(histogram,1), mmacd coloured(192,192,192) style(line,3) , signal coloured(r,g,b) style(line,3)
You must be logged in to post a comment.
Thanks. This looks useful.
dear nicolas, tyvm for your indicators and strategies, i have this following error when i charge in my PRT v10.2: https://postimg.org/image/u15gsxpdz/ ... what I have to do? tyvm again
Your picture is too small, but for sure the problem is about the fact you are still using v10.2 and this indicator need the new graphical instructions of 10.3 version. Try to delete everything in the code about "style", replace the RETURN line with this one instead: return mmacd coloured(100,100,100), signal coloured(r,g,b)
Un millón... de gracias... me gustaría más, poder ofrecer euros; pero va a ser que no puedo, así que: gracias gracias gracias