
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
Hi!
For some reason, when your library is connected, extern operator stops working, i.e. variables are defined, everything compiles normally, and in principle, the EA works, but at the same time, the EA does not have any parameters when starting the type, even though there are quite a lot of parameters. What may be the reason for this?
Find in the code
#property library
And delete.
I have added a variable j to this function, for the penultimate transaction.
double GetProfitLastClosePos(string sy="", int op=-1, int mn=-1, int j=0) {I've added a variable j to this function for penultimate trades.
If we consider that the orders which have been closed are considered in OrdersHistoryTotal() according to the time of closing from right -> left (the last one to the right):
The function returns the profit j-th of the last closed order, "filtered" by symbol, magik, type. And the numbers are counted from 0th.
If we take into account that closed orders are counted in OrdersHistoryTotal() by time of closing from right -> left (the latest extreme right):
The function returns the profit j-th of the last closed order, "filtered" by instrument, Magik, type. And the numbers are counted from 0th.
Hi all.
Needed a function to close Buy and Sell orders of equal lots by counter orders, when their profit goes to +. I tried to do this function, but 4108 error comes out (wrong tickets)
Can you tell me what the problem is?
Orders should be closed when the whole cycle of checks is done, i.e. after the for statement, not inside.
Thank you! If anyone else needs such a function, it will be like this:
Are there any video tutorials on this language?