EA execution question and problem

 

Hi!

As far as I understand, the EAs run each time a tick happens. Now, the question is: is it possible for two ticks to happen so close one from the other

that the expert runs twice in a quasi-parallel way?

The issue I'm having is that there is a method that checks how many orders are there for each Magic Number; while the number of orders is less than a certain limit, they can keep being sent. Unless the same expert is running at almost the same time, it is impossible for it to send more orders than the limit allows... but it is happening.

Hence the question about the expert running in parallel. Maybe the order is not send when the second EA runs, so that the limit condition is not met yet, it also sends an order?

Hope my question makes sense xD

 

Do you check for Symbol as well as Magic Number ? does you magic number differentiate between Time Periods ?

Show your code . . .

 
changowero:

Hi!

As far as I understand, the EAs run each time a tick happens. Now, the question is: is it possible for two ticks to happen so close one from the other

that the expert runs twice in a quasi-parallel way?

The issue I'm having is that there is a method that checks how many orders are there for each Magic Number; while the number of orders is less than a certain limit, they can keep being sent. Unless the same expert is running at almost the same time, it is impossible for it to send more orders than the limit allows... but it is happening.

Hence the question about the expert running in parallel. Maybe the order is not send when the second EA runs, so that the limit condition is not met yet, it also sends an order?

Hope my question makes sense xD

it did happen and experience that before. the tick can be the tick of the other chart instance, that comes b4 the logic of all running ea (viz. that checks for such total limits)

as far as I have tried, I use the global variable globalvariableset("nOrdersPerInstance", orderstotal()); then int n=globalvariableget(...) if(n>=limit)...before.

another work around is to have your ea re-coded into 1 design, than to use multiple. Both ways got their pros & cons..

Reason: