positions_total

Abrufen der Anzahl der offenen Positionen

positions_total()

Rückgabewert

Integer Wert

Hinweis

Die Funktion ist ähnlich PositionsTotal.

Beispiel:

import MetaTrader5 as mt5
# Datenanzeige des Pakets von MetaTrader 5
print("MetaTrader5 package author: ",mt5.__author__)
print("MetaTrader5 package version: ",mt5.__version__)
 
# Verbindung herstellen zum MetaTrader 5 Terminal
if not mt5.initialize():
    print("initialize() failed, error code =",mt5.last_error())
    quit()
 
# Prüfen auf die Existenz von offenen Positionen
positions_total=mt5.positions_total()
if positions_total>0:
    print("Total positions=",positions_total)
else:
    print("Positions not found")
 
# Schließen der Verbindung zum MetaTrader 5
mt5.shutdown()

Siehe auch

positions_get, orders_total