Will the indicator execute first, then the EA's or are they done at the same time?
I am not sure if there's an answer to this (I mean perhaps there is no assured order of execution), but regardless - I think u should design the EA/Indicator to handle BOTH cases...
I'm thinking your right.
I'm thinking of putting a sleep() statement at the front of the EA to give the indicator time to calculate. Thoughts?
I'm thinking your right.
I'm thinking of putting a sleep() statement at the front of the EA to give the indicator time to calculate. Thoughts?
I was thinking more in the lines of: IF (GV not exist) sleep/return ELSE do whatever...
So as I said - 'u should design the EA/Indicator to handle BOTH cases'. Don't assume that either one will execute first.
This is interesting... In general, indicators / conditions arised from indicators are best evaluated one time after bar closed. I am not sure what's the nature of your GV that requires every tick evaluation. Perhaps put a counter flag in the indy. And make the EA check if it's greater than last flag then It can only execute based on that new incoming value.
So as I said - 'u should design the EA/Indicator to handle BOTH cases'. Don't assume that either one will execute first.
gordon, if I'm not mistaken GV will remain existed after first time setting it. Unless you deleted it.
To verify & make sure the EA access the latest GV value after the Indicator has changed it . I might use this : GlobalVariableSetOnCondition. I just read this & haven't play with it but the function description is very fitting coincidentally :)
... The function provides atomic access to the global variable, this is why it can be used for providing of a semaphore at interaction of several experts working simultaneously within one client terminal.
regards
cameo
gordon, if I'm not mistaken GV will remain existed after first time setting it. Unless you deleted it.
To verify & make sure the EA access the latest GV value after the Indicator has changed it . I might use this : GlobalVariableSetOnCondition. I just read this & haven't play with it but the function description is very fitting coincidentally :)
It was just an example... I'll rephrase: IF (indicator not done) sleep/return ELSE do whatever...
Sorry, didn't mean to nitpick... :) Btw do you think GlobalVariableSetOnCondition can be used? Its 2nd & 3rd parameters are type double which I'm not sure how it would go in ND's situation.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have an indicator that sets some global variables.
I have a few EA's that use the global variables.
Will the indicator execute first, then the EA's or are they done at the same time?
The EA's are on many different pairs.
Thanks
-Non.