I have searched and found the code below for counting Buy/Long and Sell/Short Positions in MQL5. But it seems not to make what it should do.
If Positions should be closed by:
(and other conditions) open Buy-Positions is not closed. This only works if I use:
which is not what I want, as only one of open trading direction should be closed.
I do not see where there is an error. I am not aware if the minimum number of criteria are used to correctly select Positions and close them. It seems that the countings is not stored correctly or not retrieved correctly when it checks at every new bar.
Can anyone help please?
ja wir sprechen hier deutsch,
du musst schon die Position auswählen welche du auslesen willst sonst wird das nix
Wenn man nicht weiter weiß erstmal hier: (https://www.mql5.com/de/docs/function_indices) suchen, da die viele Funktionen Beipsiele beinhalten.
Danach über die Lupe oben rechts suchen nach zB. "PositionsTotal" und dann würdest Du den beispielcode von amando finden: https://www.mql5.com/de/code/27635.
Da findest Du, wie man offenen Positionen findet.
- www.mql5.com
- Freie Handelsapplikationen
- Über 8.000 Signale zum Kopieren
- Wirtschaftsnachrichten für die Lage an den Finanzmärkte
Sie stimmen der Website-Richtlinie und den Nutzungsbedingungen zu.
I have searched and found the code below for counting Buy/Long and Sell/Short Positions in MQL5. But it seems not to make what it should do.
If Positions should be closed by:
(and other conditions) open Buy-Positions is not closed. This only works if I use:
which is not what I want, as only one of open trading direction should be closed.
I do not see where there is an error. I am not aware if the minimum number of criteria are used to correctly select Positions and close them. It seems that the countings is not stored correctly or not retrieved correctly when it checks at every new bar.
Can anyone help please?