Hello ,
I’m making an Expert advisor including MACD
In the code I depend on the value of Signal and Main line ( Histogram) in MACD in the bar 0 and bar 1 .
it works perfect but sometime it comes out with strange values as -7.835123405921764e-05
, I print out those values so you can see in the attachments .
Signal >>> means the value of Signal line in bar 0
Main>> the value of Main line in bar 0
Signal Past >> the value of Signal line in bar 1
Main past >> the value of Main line in bar 1
I use variables for every entry in MACD
extern ENUM_TIMEFRAMES MACD_Timefr1 ; // Time Frame
extern int Fast_Ema1 = 12 ; // Fast EMA
extern int Slow_Ema1 = 26 ; // Slow EMA
extern int Signal_Period1 = 9 ; // Signal Period
extern ENUM_APPLIED_PRICE Applied_Price1 ; //Applied Price
iMACD(NULL, MACD_Timefr1, Fast_Ema1, Slow_Ema1, Signal_Period1, Applied_Price1, MODE_SIGNAL, 1)
Files:
5.png 60 kb