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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
//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) |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Definitely, need to code this into an automated strategy.
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)
Thanks. This looks useful.