Multi Time Frame EA With Multi Symbols MQL5

 

Hello .

I wrote an EA that trades on 3 symbols and for each of these symbols , I need 2 Time Frames for calculations. 3 * 2 = 6

If I want to Trade on All that 3 symbols , Do I need to attach that EA to all 6 charts ?


thanks

 
If you already have EA that works for 3 symbols you only need to use it on another chart with the same EA. it's redundant to use it on 6 chart.
 

If you already have an EA that works for the 3 symbol, why are you posting?

If you have an EA that works for the current symbol (multiple timeframes), then you are done. Put it on other charts to trade them.

 
This depend on how your EA code. You can even only load one chart to trade 6 trades if you code it all in your EA.
 

No, you do not need to attach your EA to all 6 charts in MT5. In MT5, an EA can request data from different symbols and timeframes without being attached to a chart that matches those symbols or timeframes.

You can program your EA to gather information from multiple symbols and timeframes using the CopyRates() or CopyTime() functions for price data and time respectively. Here is an example of how you might request data from a different symbol and timeframe:

# Get data for a different symbol and timeframe
symbol = "EURUSD"
timeframe = mt5.TIMEFRAME_H1  # Hourly timeframe
rates = mt5.copy_rates_from_pos(symbol, timeframe, 0, 1000)

In this example, the EA retrieves the last 1000 hourly bars for EURUSD regardless of which chart the EA is actually attached to.

Here is what you need to do to trade on all 3 symbols with 2 timeframes each:

  1. Initialize the EA on any one chart of your choice.
  2. Within the EA's code, request data for all the symbols and timeframes you need for your calculations.

Make sure your EA has the appropriate permissions to trade multiple symbols if you are using MT5's built-in functions to send orders.

 
Nguyen An Nguyen #:

No, you do not need to attach your EA to all 6 charts in MT5. In MT5, an EA can request data from different symbols and timeframes without being attached to a chart that matches those symbols or timeframes.

You can program your EA to gather information from multiple symbols and timeframes using the CopyRates() or CopyTime() functions for price data and time respectively. Here is an example of how you might request data from a different symbol and timeframe:

In this example, the EA retrieves the last 1000 hourly bars for EURUSD regardless of which chart the EA is actually attached to.

Here is what you need to do to trade on all 3 symbols with 2 timeframes each:

  1. Initialize the EA on any one chart of your choice.
  2. Within the EA's code, request data for all the symbols and timeframes you need for your calculations.

Make sure your EA has the appropriate permissions to trade multiple symbols if you are using MT5's built-in functions to send orders.

Thank you , it seems it can help me . My code is working correctly on MT5, but the problem is that it uses to much CPU. I think the technique you shared with me will fix this issue .
 
Nguyen An Nguyen #:

No, you do not need to attach your EA to all 6 charts in MT5. In MT5, an EA can request data from different symbols and timeframes without being attached to a chart that matches those symbols or timeframes.

You can program your EA to gather information from multiple symbols and timeframes using the CopyRates() or CopyTime() functions for price data and time respectively. Here is an example of how you might request data from a different symbol and timeframe:

In this example, the EA retrieves the last 1000 hourly bars for EURUSD regardless of which chart the EA is actually attached to.

Here is what you need to do to trade on all 3 symbols with 2 timeframes each:

  1. Initialize the EA on any one chart of your choice.
  2. Within the EA's code, request data for all the symbols and timeframes you need for your calculations.

Make sure your EA has the appropriate permissions to trade multiple symbols if you are using MT5's built-in functions to send orders.

Ashkan Shams #:
Thank you , it seems it can help me . My code is working correctly on MT5, but the problem is that it uses to much CPU. I think the technique you shared with me will fix this issue .
this code you provide is in Python . I need a solution in MQL5 language .
Reason: