- initialize
- login
- shutdown
- version
- last_error
- account_info
- terminal_info
- symbols_total
- symbols_get
- symbol_info
- symbol_info_tick
- symbol_select
- market_book_add
- market_book_get
- market_book_release
- copy_rates_from
- copy_rates_from_pos
- copy_rates_range
- copy_ticks_from
- copy_ticks_range
- orders_total
- orders_get
- order_calc_margin
- order_calc_profit
- order_check
- order_send
- positions_total
- positions_get
- history_orders_total
- history_orders_get
- history_deals_total
- history_deals_get
order_check
Check funds sufficiency for performing a required trading operation. Check result are returned as the MqlTradeCheckResult structure.
order_check(
|
Parameters
request
[in] MqlTradeRequest type structure describing a required trading action. Required unnamed parameter. Example of filling in a request and the enumeration content are described below.
Return Value
Check result as the MqlTradeCheckResult structure. The request field in the answer contains the structure of a trading request passed to order_check().
Note
Successful sending of a request does not entail that the requested trading operation will be executed successfully. The order_check function is similar to OrderCheck.
ID |
Description |
---|---|
TRADE_ACTION_DEAL |
Place an order for an instant deal with the specified parameters (set a market order) |
TRADE_ACTION_PENDING |
Place an order for performing a deal at specified conditions (pending order) |
TRADE_ACTION_SLTP |
Change open position Stop Loss and Take Profit |
TRADE_ACTION_MODIFY |
Change parameters of the previously placed trading order |
TRADE_ACTION_REMOVE |
Remove previously placed pending order |
TRADE_ACTION_CLOSE_BY |
Close a position by an opposite one |
ID |
Description |
---|---|
ORDER_FILLING_FOK |
This execution policy means that an order can be executed only in the specified volume. If the necessary amount of a financial instrument is currently unavailable in the market, the order will not be executed. The desired volume can be made up of several available offers. |
ORDER_FILLING_IOC |
An agreement to execute a deal at the maximum volume available in the market within the volume specified in the order. If the request cannot be filled completely, an order with the available volume will be executed, and the remaining volume will be canceled. |
ORDER_FILLING_RETURN |
This policy is used only for market (ORDER_TYPE_BUY and ORDER_TYPE_SELL), limit and stop limit orders (ORDER_TYPE_BUY_LIMIT, ORDER_TYPE_SELL_LIMIT, ORDER_TYPE_BUY_STOP_LIMIT and ORDER_TYPE_SELL_STOP_LIMIT) and only for the symbols with Market or Exchange execution modes. If filled partially, a market or limit order with the remaining volume is not canceled, and is processed further. During activation of the ORDER_TYPE_BUY_STOP_LIMIT and ORDER_TYPE_SELL_STOP_LIMIT orders, an appropriate limit order ORDER_TYPE_BUY_LIMIT/ORDER_TYPE_SELL_LIMIT with the ORDER_FILLING_RETURN type is created. |
ID |
Description |
---|---|
ORDER_TIME_GTC |
The order stays in the queue until it is manually canceled |
ORDER_TIME_DAY |
The order is active only during the current trading day |
ORDER_TIME_SPECIFIED |
The order is active until the specified date |
ORDER_TIME_SPECIFIED_DAY |
The order is active until 23:59:59 of the specified day. If this time appears to be out of a trading session, the expiration is processed at the nearest trading time. |
Example:
import MetaTrader5 as mt5 |
See also
order_send, OrderCheck, Trading operation types, Trading request structure, Structure of the trading request check results, Structure of the trading request result