import MetaTrader5 as mt5
# MetaTrader 5パッケージについてのデータを表示する
print("MetaTrader5 package author: ",mt5.__author__)
print("MetaTrader5 package version: ",mt5.__version__)
# MetaTrader 5ターミナルとの接続を確立する
if not mt5.initialize():
print("initialize() failed, error code =",mt5.last_error())
quit()
# アクティブ注文の存在を確認
orders=mt5.orders_total()
if orders>0:
print("Total orders=",orders)
else:
print("Orders not found")
# MetaTrader 5ターミナルへの接続をシャットダウンする
mt5.shutdown()
|