How to calculate the sum of all open lots?
-
Good afternoon! Dear Administrators, I am developing a grid expert Advisor, and at some point, he should calculate the sum of all open lots. To open the opposite position in a double size (for example). I was faced with the problem of how to make a loop? And return the resulting value to a variable? Please tell me how to solve this problem? Thanks in advance!
https://fxdreema.com/shared/SlymdDqY -
Oh no, Terminal Variables used again... now I will definately rename those.
Do it like this here - http://prntscr.com/a95vic -
Thanks for the help! But for some reason when the loop begins to work, MT4 crash... Please Tell me how to find the Sum of all open lots buy or sell? How to do it correctly?
https://fxdreema.com/shared/CJSE5rR8b
Thanks in advance! -
This shows the sum of lots for buys, sells and both https://fxdreema.com/shared/xN2HKsDyd
-
Thank you very much! It works. I have another question, why the EA is no longer working after exporting? I opened the code in MetaEditor when compiling writes: "template parameter ambiguous, could be 'double' or 'int'." This is for all previous projects AAAaaaaa!!!
-
-
For some reason MetaEditor swears to the execution blocks: "check last winner\loser type". What to do now?
-
There was a bug in one function, is it ok now?
-
No, still does not work. I tried to make a new project, it works, until you don't add a blocks: "check last winner\loser type".
-
Now?
-
Yes, now works! Thank you!
