The ideas of developing multi-timeframe and multi-symbols EA, which is better?

 

Now I need to write an EA that can trade in multiple symbols and multiple timeframes of each symbol. Preliminary ideas as follow:

1 Write only one EA, and the EA can normally place orders in multiple symbols and multi timeframes of them without interference.

2 Write one EA, which can only trade in a single symbol and single period, and then mount EA on each chart by opening multiple periodic charts of multiple symbols to realize multi-symbol and multi-timeframes trading.

The disadvantage of method 1 is that the code complexity is greatly improved, and the advantage is that it is good to start it directly once.

The disadvantage of method 2 is that it is troublesome to mount EA on N charts at a time. The advantage is that the code logic is clear and simple, and it is not easy to make mistakes.

What kind of method should I use?  Thank you for your advice.

 
hffans27:

Definitely option 1, although depending on your programming skills, option 2 may be easier for you.

 

Crawl before run.  Since neither idea guarantees you consistent profits - start with what's simpler/easier for you and go from there.

 
hffans27:

Now I need to write an EA that can trade in multiple symbols and multiple timeframes of each symbol. Preliminary ideas as follow:

1 Write only one EA, and the EA can normally place orders in multiple symbols and multi timeframes of them without interference.

2 Write one EA, which can only trade in a single symbol and single period, and then mount EA on each chart by opening multiple periodic charts of multiple symbols to realize multi-symbol and multi-timeframes trading.

The disadvantage of method 1 is that the code complexity is greatly improved, and the advantage is that it is good to start it directly once.

The disadvantage of method 2 is that it is troublesome to mount EA on N charts at a time. The advantage is that the code logic is clear and simple, and it is not easy to make mistakes.

What kind of method should I use?  Thank you for your advice.

option 1 is good way, Write only one EA which reads multi symbol and multi timeframe

If you know how to use for loop and multi dimensional array, you can write this code in 5 minutes.

Here is one source code which is for multi symbol for reference so you can learn idea from code and implement it on your EA

 
hffans27: Now I need to write an EA that can trade in multiple symbols and multiple timeframes of each symbol. Preliminary ideas as follow: 1 Write only one EA, and the EA can normally place orders in multiple symbols and multi timeframes of them without interference. 2 Write one EA, which can only trade in a single symbol and single period, and then mount EA on each chart by opening multiple periodic charts of multiple symbols to realize multi-symbol and multi-timeframes trading. The disadvantage of method 1 is that the code complexity is greatly improved, and the advantage is that it is good to start it directly once. The disadvantage of method 2 is that it is troublesome to mount EA on N charts at a time. The advantage is that the code logic is clear and simple, and it is not easy to make mistakes. What kind of method should I use?  Thank you for your advice.

Here is my advice based on real active experience with both options.

Begin with option 2 (single symbol/time-frame). Make your code very robust and efficient. Thoroughly test it to make sure everything is working correctly and the strategy and logic is good and sound.

ONLY consider evolving onto option 1 (multi-symbol/multi time-frame), when and if there is really a need for it. Option 1 is extremely complex. You will run into many problems and your coding skill will need to be very high level.

Remember also, that each symbol and time-frame may require different input parameters. This is easily accomplished with option 2 where you can optimise inputs for a specific symbol and time-frame. However, it will be extremely difficult for option 1 where you will have a more generalised inputs that will be applied to all symbols and time-frames simultaneously and individual optimisation will be more difficult.

Very important — only consider moving onto option 1 when you are absolutely sure that your strategy is consistently profitable on many symbols and time-frames on a real account with generalised inputs. If it is only profitable on a few symbols or time frames, or independent optimisation are required for each case, then you will be wasting valuable development time on option 1.

 

Here is idea to start with option 1

#define NUMBER_OF_TIMEFRAMES 3
ENUM_TIMEFRAMES tf[NUMBER_OF_TIMEFRAMES] = {PERIOD_M1,PERIOD_M2,PERIOD_M3};// Indicator TimeFrame
int total;
string symbols[];
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit() {
//--- 
  total = SymbolsTotal(true);
  ArrayResize(symbols, total);
  for(int i=0; i<total; i++) {
	symbols[i] = SymbolName(i,true);
          for(int j=0;j<NUMBER_OF_TIMEFRAMES; j++) {
              if(symbols[i] == "EURUSD" && tf[j]==PERIOD_M1)
                Print("Do something");
        }

}
//---
   return(INIT_SUCCEEDED);
}
 
Arpit T #:

Here is idea to start with option 1

This is like wanting to teach someone how to swim and you show him the water… and that’s it …. 😁
 
Daniel Cioca #:
This is like wanting to teach someone how to swim and you show him the water… and that’s it …. 😁

Yes, In forum we can show way of water alteast, rest if done by own effort :)