Download MetaTrader 5

Expert interruption

To add comments, please log in or register
BB2013
120
BB2013  

Hi,


I developed an expert.
As far as I know, the expert starts running when the price change.
However, if the price change again, and my expert does not get to finish, the expert do not continues and another expert run starts.
This happens when the market is under strong variations.
So, under this case, my expert never comes to the end.
Is possible to avoid expert interruption by a new change in the price ?


Thanks

Bernhard Schweigert
9673
Bernhard Schweigert  
BB2013:

Hi,


I developed an expert.
As far as I know, the expert starts running when the price change.
However, if the price change again, and my expert does not get to finish, the expert do not continues and another expert run starts.
This happens when the market is under strong variations.
So, under this case, my expert never comes to the end.
Is possible to avoid expert interruption by a new change in the price ?


Thanks

we need to see a code to know why
BB2013
120
BB2013  
Bernhard Schweigert:
we need to see a code to know why

Thanks for your reply.

Can you confirm this:

1) An expert starts running when the envolved pair changes cotation.

2) If the expert takes a bit time to finish and the pair cotation changes before the expert ends, the expert re-starts again.


Perhaps I am confusing something, but this is what I thought it is how MT4 works

Bernhard Schweigert
9673
Bernhard Schweigert  
BB2013:

Thanks for your reply.

Can you confirm this:

1) An expert starts running when the envolved pair changes cotation.

2) If the expert takes a bit time to finish and the pair cotation changes before the expert ends, the expert re-starts again.


Perhaps I am confusing something, but this is what I thought it is how MT4 works

you can use

OnTimer();
EventSetTimer(1);

Stanislav Korotky
19854
Stanislav Korotky  
BB2013:

Can you confirm this:

1) An expert starts running when the envolved pair changes cotation.

2) If the expert takes a bit time to finish and the pair cotation changes before the expert ends, the expert re-starts again.


Perhaps I am confusing something, but this is what I thought it is how MT4 works

You're wrong. Any event handler - either processing new price tick or timer - is executed uninterrupted until it exits. All successive events (price ticks or timer) are waiting until your EA finishes processing of the previous event.

If you see other behaviour, this can be a bug either in your code or in the platform. We need more information.

To add comments, please log in or register