Trades closed when changed from M1 to another period

 

Hi,

I was running an EA on a demo account, on M1 (minute) chart.

I changed the period to another, I think, to Daily period, and all trades were immediately closed within a few seconds.

Is the changing of the period the cause of the closing of the trades?

Was the EA initialized again, like the init() was called again?

 

Yes. If you wish to be able to re-initialize your EA without impact on current orders, you need to alter the logic to do just that.


CB

 
cloudbreaker wrote >>

Yes. If you wish to be able to re-initialize your EA without impact on current orders, you need to alter the logic to do just that.

CB

Thanks CB.

This means it is exactly a relaunch of the EA. Is that correct? That means that all internal memory runtime program variable values may no longer contain their values when I clicked to change the period of the chart. Is that correct?

 
jcadong5:

Thanks CB.

This means it is exactly a relaunch of the EA. Is that correct? That means that all internal memory runtime program variable values may no longer contain their values when I clicked to change the period of the chart. Is that correct?

Yes.


CB

Reason: