Coding BB into MACD

 

Hello I currently am having an issue, I am trying to code the BB into the MACD Indicator.

Any help would be greatly appreciated. 

 
you need to better explain what you need
 

Jean Francois Le Bas:
you need to better explain what you need

What I mean is how would you code this:


 
micobez:

What I mean is how would you code this:


you don't need to code anyhting you can put two indicators in the same window.

is that what you want ? sorry you're not being clear

 
micobez:

What I mean is how would you code this:


put the MACD on

press ctrl+N to open Navigator

click and drag the BB onto the MACD on the chart

make settings on BB -> Apply To: Previous Indicator Data
 
Alex Go:

put the MACD on

press ctrl+N to open Navigator

click and drag the BB onto the MACD on the chart

make settings on BB -> Apply To: Previous Indicator Data

Yes but how do I code that into my bot That is what I am asking

 
Jean Francois Le Bas:

you don't need to code anyhting you can put two indicators in the same window.

is that what you want ? sorry you're not being clear

For bot parameters. EG if MACD>Bollingertop, I can code both indicators but I dont know how to get the bollinger to read off of MACD variables on mql

 
micobez:

Yes but how do I code that into my bot That is what I am asking

MQL4 or MQL5?

This is MQL4 sample.

UpperLine_Buffer[i] = iBandsOnArray(MACD_Buffer, 0, BB_period, BB_deviation, 0, MODE_UPPER, i);
MainLine_Buffer[i]  = iBandsOnArray(MACD_Buffer, 0, BB_period, BB_deviation, 0, MODE_MAIN,  i);
LowerLine_Buffer[i] = iBandsOnArray(MACD_Buffer, 0, BB_period, BB_deviation, 0, MODE_LOWER, i);
 

Calculate la deviation and record the value in a variable,   substract and add  from the midle line value. Input its value into

an buffer to graph. 

Mql4 has a standard function to calculate the standard diviation.

Standard=iStdDev(NULL,0,18,0,MODE_SMA,PRICE_CLOSE,0)

 
Naguisa Unada:

MQL4 or MQL5?

This is MQL4 sample.

in mql5

 
MACD_handle  = iMACD(_Symbol, _Period, fast_period, slow_period, signal_period, aPrice);
Bands_handle = iBands(_Symbol, _Period, Bands_period, shift, deviation, MACD_handle);
CopyBuffer(MACD_handle, 0, 0, to_copy, macd_buffer);

CopyBuffer(Bands_handle, 0, 0, to_copy, main_buffer);
CopyBuffer(Bands_handle, 1, 0, to_copy, upper_buffer);
CopyBuffer(Bands_handle, 2, 0, to_copy, lower_buffer);
Reason: