Is it possible to make an EA switch the timeframe it trades on automatically? Or would this have to be manually done?

 

I wanted to incorporate trading at certain times in a different way into my EA and was wondering if possible I could change the timeframe and settings my EA works on depending on the time?

Thanks :)

 
JingleJongle:

I wanted to incorporate trading at certain times in a different way into my EA and was wondering if possible I could change the timeframe and settings my EA works on depending on the time?

Thanks :)

You can check out https://www.mql5.com/en/docs/chart_operations/chartsetsymbolperiod

Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
  • www.mql5.com
Changes the symbol and period of the specified chart. The function is asynchronous, i.e. it sends the command and does not wait for its execution completion. The command is added to chart messages queue and will be executed after processing of all previous commands. The call of ChartSetSymbolPeriod with the same symbol...
 

Of course, you can, as Seng referenced. You call it, return, and then go through a de-init/init cycle.

The only real problem is after — not repeatedly changing. Using time solves that.

Reason: