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

 
artmedia70:
Look carefully at the price of the stop order in the open position and at what price exactly it was closed. Igor's function compares these prices but does not take slippage into account.


Stops just work clearly.

with the takei...for example, opening the eu into buy at ...1.33942, closing at take 1.33962... net 20 pips !

 
Zhunko:

Nightmare! :-))


It's such a protection against decompiling)))) The slightest distraction from home, forgetting where something is - that's it, the protection worked))))
 
lottamer:


stops are just working clearly.

the problem with the tees, ...e.g. opening the eu into buy at ...1.33942, closing at 1.33962... net 20 pips !

Isn't the take a stop order ? Look at the prices and compare them. Then you can talk constructively.
 

I'll repeat my question, it must have been missed.

Again I looked in the help and again read the lines here:

https://docs.mql4.com/ru/basis/preprosessor/import

Для импорта функций во время выполнения mql4-программы используется так называемое позднее связывание. Это значит, что пока не вызвана импортируемая функция, соответствующий модуль (ex4 или dll) не загружается.

1. it means that in order for the library to be loaded, it should be called in the code after the import lines, right?

For example, I did it like this:

#import "hoz_Base@Library.ex4"
   double ND(double A);
   double Get_TradePrice(int fi_priceId,       // Цена: 0 - Ask; 1 - Bid
                      string fs_symbol);

2. It turns out that we declare functions use in the Expert Advisor at the very beginning of its code?

3. and not to declare them a lot in the code of Expert Advisor itself and use header files? I.e. only for declarations?

This question came up because I have seen such Expert Advisors that were written by quite serious programmers, but their header files contain all main and non-main functions. I was surprised by this... In fact, the speed of compiled libraries is much faster, in addition, the code of library functions is "isolated", which is also very convenient.

Why I asked, it's just that if I import a function library as shown above and use it in my code, an error pops up:

'Get_TradePrice' - function is not defined      D:\Insall'd soft's\Forex\MetaTraderForProgramming\experts\Grider.mq4 (360, 18)

and as soon as I declare it as shown above, it compiles right away... Or, I don't declare it in Expert Advisor itself, but connect inclusion (header file) with listed function names and parameters, everything also compiles and works fine.

Therefore, I have a question. Why do some programmers use all their functions in inclusions instead of libraries?

 
artmedia70:
Isn't the take a stop order? Look at the prices and compare them. Then you can talk constructively.

the prices are the same.

 
hoz:

I'll repeat my question, it must have been missed.

Again I looked in the help and again read the lines here:

https://docs.mql4.com/ru/basis/preprosessor/import

Therefore a question arose. Why do some programmers use all their functions in inludes instead of libraries?

From contagion...

I recommend to plan memory usage for some nonsense once (very, very big).

 
hoz:
Therefore, a question has arisen. Why exactly do some programmers use all of their functions in inludes instead of libraries?
It is inconvenient to use libs in places. Although the practice to use them is good.
 
lottamer:

the prices are the same.


Are the price of set take and the price of closing the position?


If yes, then print the required data (OrderTakeProfit() and OrderClosePrice()) for the selected order in the history directly in the cycle of Igor's function and see the reason of mismatch.

 
tara:

From infestation...

I recommend that you plan your memory usage once for some nonsense (very, very big).


In order to plan it, you need to know what it's used for. It's just a little bit of a mess. One way, one way, another way... another way altogether. I haven't come across any information where everything is properly laid out. I mean about the joint use of the library and inclusions with experts. I don't want to guess either. That's why I asked. What is the right way?
 
TheXpert:
It is inconvenient to use the libs in places. Although the practice to use is good.


For example?
Reason: