Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 337

 

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.

 
Mr.Profit:

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.

Here.
 

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.

 
borilunad:

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!!!

 
TarasBY:
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)?

 
Mr.Profit:


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)?

Unlike system libraries, custom libraries (MQL4) are loaded for each calling module separately, regardless of whether the called library was loaded by any other module. For example, the caller.ex4 module calls functions from the lib1.ex4 and lib2.ex4 libraries. In turn, the lib1.ex4 library calls functions from the lib2.ex4 library. In this case, one copy of the lib1.ex4 library and two copies of lib2.ex4 library will be loaded, despite the fact that all the calls are coming from the caller.ex4 module.
For each EA (no matter how many of them are hanging on the charts) its own caller module (EA file).
 
Can you please tell me if I found indicator MACD_Histogram.mq4 by the link https://www.mql5.com/ru/code where to find indicator manual? I basically understood that I can trade by arrows but I want to know what other indicators show in it. If anyone has any link where you can read or look please answer or mail to Aleks-R-13@yandex.ru Thanks
 
TarasBY:
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.

 
tara:

Crutches, imho.
Bad dentures are worse.
 
artmedia70:

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!!!

I'm experimenting all sorts of things. Maybe some version will prove more acceptable. How expressive!