Download MetaTrader 5

changing time frames

To add comments, please log in or register
Brian
498
Brian  

Hello,

If an EA is running on a certain time frame can I switch time frames or will this disrupt things. At the moment I am running an EA that is designed to continuously manage positions and re enter new positions if we are stopped out. Switching time frames seems to mess things up.

Thanks.

qjol
3243
qjol  
it depends on your code

changing time frames by code

Brian
498
Brian  

Thanks, this is very helpful. I am not a programmer but at least I can give this to someone programming for me.

So just to be very clear for us non-programmers :-), unless it is programmed, I should never switch time frames while an EA is running? Is this correct?

Thanks again.

qjol
3243
qjol  

example, say you have 2 strategies on the same Symbol() the first is PERIOD_H4 related, & the second is related 2 PERIOD_H8... (just n example) & using Period() to detect them...

But... if u write the code properly u shouldn't have a problem 2 change TF's

whroeder1
15706
whroeder1  
4000: If an EA is running on a certain time frame can I switch time frames or will this disrupt things.
  1. When you change timeframes, the EA goes through a deinit/init cycle, nothing more. Global and static variables are not reset. You must code to recover.
  2. How are you "continuously manage positions?" If it's based on period (ima, atr, etc) then everything has changed. Do you change to the new TF values, or continue managing using the original TF. Do you detect the change with MNs?
  3. "Switching time frames seems to mess things up" If you aren't handling the above, don't switch.
Brian
498
Brian  
qjol:

example, say you have 2 strategies on the same Symbol() the first is PERIOD_H4 related, & the second is related 2 PERIOD_H8... (just n example) & using Period() to detect them...

But... if u write the code properly u shouldn't have a problem 2 change TF's


Thanks very much.
Brian
498
Brian  
WHRoeder:
  1. When you change timeframes, the EA goes through a deinit/init cycle, nothing more. Global and static variables are not reset. You must code to recover.
  2. How are you "continuously manage positions?" If it's based on period (ima, atr, etc) then everything has changed. Do you change to the new TF values, or continue managing using the original TF. Do you detect the change with MNs?
  3. "Switching time frames seems to mess things up" If you aren't handling the above, don't switch.


Hi,

Thanks for your help. This is all a little beyond my ability but I will pass it on to the programmer.

Regards

To add comments, please log in or register