Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 337
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good afternoon!
Can you tell us how library works as a set of used functions?
I.e. when calling the functions from one library in two EAs, hanging on different pairs - for each EA will be loaded and initialised its own instance of library?
Or expect that the same (internal) variables from the library will be used competitively?
Simply, I've built some functions into library (*.mqh I don't want), and these functions use variables/arrays declared in library to store actual data . This data is common to all symbols, but can be modified at random times by any of the active EAs. When one EA is running - everything is fine, but when two EAs are running - some incomprehensible cracks (messy data) appear, and I have a suspicion that the competitive access to the variables is crooked.
Good afternoon!
Can you tell us how library works as a set of used functions?
I.e. when calling the functions from one library in two EAs, hanging on different pairs - for each EA will be loaded and initialised its own instance of library?
Or expect that the same (internal) variables from the library will be used competitively?
Simply, I've built some functions into library (*.mqh I don't want), and these functions use variables/arrays declared in library to store actual data . This data is common to all symbols, but can be modified at random times by any of the active EAs. When one EA is running - everything is fine, but when two EAs are running - some weird shit (messy data) comes out, and I have a suspicion that the competitive access to variables is crooked.
As you know, the bottom line of the terminal contains the following information, e.g:
Balance: 211721.72 Funds: 101193.75 Collateral: 55595.98 Free: 45481.77 Level: 181.81% -110643, 34 (approximately)
However, on one of my terminals, on a real cent account, only the following information is displayed, although there are open positions:
Balance: 211721,72 Funds: 101193,75 -110643,34
What may be the reason? Thank you for your attention.
In the tester MarketInfo() doesn't work, and Bid and Ask are slow and distorted. Therefore, on the advice of Xrust'a I get them from iClose(NULL,0,0):
I've written so much already, ran it in the tester to make sure there were no logic errors, and... Only now I found out that MarketInfp() doesn't work in my tester.
What am I checking so carefully then? How does it work for me?
Shaitan!!!
Tut.
Thank you.
How does this work in the case of one EA hovering over two pairs? I.e. is the calling module one (expert.ex4) or two (two running instances)?
Thank you.
How does this work in the case of one EA hovering over two pairs? I.e. is the calling module one (expert.ex4) or two (two running instances)?
For each EA (no matter how many of them are hanging on the charts) has its own calling module (EA file).
For the final clarification of confusion, I have written a test EA and a library.
The Expert Advisor simply outputs to Comment the current value of the variable from the library, plus for EURUSD it increments the value of the variable. The receiving of the variable and its incrementing is implemented through library functions.
As a result, the Comment on EURUSD shows the changing value, while on the other symbol it does not.
So, it is correct to say that for each instance (and not a file) of the EA, its own instance of EX4-library is loaded.
Crutches, imho.
I've written so much already, ran it in the tester to make sure there are no logic errors, and ... Only now I found out that MarketInfp() doesn't work in my tester.
Why am I checking so thoroughly? How is everything working for me?
Shaitan!!!