Order Properties - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
# Determine the appropriate order type
if order_type == mt5.ORDER_TYPE_BUY:
price = mt5.symbol_info_tick(symbol).ask # Use ask price for buy order
elif order_type == mt5.ORDER_TYPE_SELL:
price = mt5.symbol_info_tick(symbol).bid # Use bid price for sell order
else:
print("Invalid order type specified.")
return
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
This error:
10030
TRADE_RETCODE_INVALID_FILL
Invalid order filling type
This error:
10030
TRADE_RETCODE_INVALID_FILL
Invalid order filling type
so check you are using the correct filling mode for that broker.