![MQL5 - Язык торговых стратегий для клиентского терминала MetaTrader 5](https://c.mql5.com/i/registerlandings/logo-2.png)
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
print(f"orders = {orders}")
orders_total = mt5.orders_total()
print(f"orders_total = {orders_total}")
symbol = "NG-7.23"
symbol_info = mt5.symbol_info(symbol)
print(f"symbol_info.visible = {symbol_info.visible}")
if not symbol_info.visible:
print(symbol, "is not visible, trying to switch on")
if not mt5.symbol_select(symbol, True):
print("symbol_select({}}) failed, exit", symbol)
request = {
"action": mt5.TRADE_ACTION_DEAL,
"symbol": symbol,
"volume": 1,
"type": mt5.ORDER_TYPE_BUY,
"price": 2.733,
"sl": 2.7,
"tp": 2.8,
"deviation": 20,
"magic": 234000,
"comment": "python script open",
"type_time": mt5.ORDER_TIME_GTC,
"type_filling": mt5.ORDER_FILLING_RETURN,
}
result = mt5.order_send(request)
print(f"result = {result}")
orders = (TradeOrder(ticket=239431069, time_setup=1688418416, time_setup_msc=1688418416508, time_done=0, time_done_msc=0, time_expiration=1688342400, type=2, type_time=1, type_filling=2, state=1, magic=0, position_id=0, position_by_id=0, reason=0, volume_initial=1.0, volume_current=1.0, price_open=2.645, sl=0.0, tp=0.0, price_current=2.733, price_stoplimit=0.0, symbol='NG-7.23', comment='', external_id='xxxxx'),)
orders_total = 1
symbol_info.visible = True
result = None