Hi Guys, Good day to all.
Error appear on “MACD”& “Signal” line indicate on ProRealTime code. Can anyone assist please.
Quote
// Impulse MACD Indicator
FastLength = 12
SlowLength = 26
SignalLength = 9
SmoothLength = 2
MACD = 0.0 (Error appeared)
Signal = 0.0 (Error appeared)
Impulse = 0.0
// Define indicator function
Function ImpulseMACD()
EMA1 = ExpAverage(FastLength, close)
EMA2 = ExpAverage(SlowLength, close)
MACD = EMA1 – EMA2
Signal = ExpAverage(SignalLength, MACD)
Impulse = Average(SmoothLength, MACD – Signal)
// Plot results
Plot1(MACD, “MACD”, blue)
Plot2(Signal, “Signal”, red)
Plot3(Impulse, “Impulse”, green)
// Generate buy and sell signals
If CrossOver(MACD, Signal) Then
Buy
EndIf
If CrossUnder(MACD, Signal) Then
Sell
EndIf
EndFunction
// Call indicator function
ImpulseMACD()
Unquote
Thank you.