MACD signal line
Good day, New coder here
I have been perusing on the net for a code that uses the signal line not the histogram and I have not found any knowledge how to do this.
Can I please ask if its possible to use this line in the expert code and if yes please help or point me in the right direction
MT4 version:
double MACD_Signal=iMACD(_Symbol,PERIOD_CURRENT,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);
MT5 version: (more info at https://www.mql5.com/en/docs/indicators/imacd)
int handle double SignalBuffer[]; int Maxbars=20; int OnInit() { handle=iMACD(_Symbol,0,12,26,9,PRICE_CLOSE); return 0; } void OnTick() { CopyBuffer(handle,1,0,Maxbars,SignalBuffer); if(SignalBuffer[0]>SignalBuffer[1]) { //do something } }
- www.mql5.com
In that case, all he has to do is modify DRAW _ HISTOGRAM to DRAW _ LINE.
//--- the MACD plot #property indicator_label1 "MACD" #property indicator_type1 DRAW_LINE //DRAW_HISTOGRAM #property indicator_color1 clrSilver #property indicator_style1 STYLE_SOLID #property indicator_width1 1
Good day, New coder here
I have been perusing on the net for a code that uses the signal line not the histogram and I have not found any knowledge how to do this.
Can I please ask if its possible to use this line in the expert code and if yes please help or point me in the right direction