connecting ea to multiple tf

 

hi

1.how do i connect ea to multiple time frame .

for example i have set up in h1

and i need to look at macd in h4

2.if i connect ea to eur-usd and gbp-usd how do i switch between them

how the code refair to the different graph ?

 

double iMACD( string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int mode, int shift)
Calculates the Moving averages convergence/divergence and returns its value. In the systems where OsMA is called MACD Histogram, this indicator is displayed as two lines. In the Client Terminal, the Moving Average Convergence/Divergence is drawn as a histogram.

-------------

All the commands in MQL that start with "i"...

iCustom()

iTime() iClose() etc etc

allow you to specify any pair any timeframe any bar for data collection/calculation in your EA.

 
phy:

double iMACD( string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int mode, int shift)
Calculates the Moving averages convergence/divergence and returns its value. In the systems where OsMA is called MACD Histogram, this indicator is displayed as two lines. In the Client Terminal, the Moving Average Convergence/Divergence is drawn as a histogram.

-------------

All the commands in MQL that start with "i"...

iCustom()

iTime() iClose() etc etc

allow you to specify any pair any timeframe any bar for data collection/calculation in your EA.


thank you very much
 
allow you to specify any pair any timeframe any bar for data collection/calculation in your EA.
Note a tester limitation: you can't get bar zero data other than current pair/TF.
Reason: