- 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_calc_margin
Return margin in the account currency to perform a specified trading operation.
order_calc_margin(
|
Parameters
action
[in] Order type taking values from the ORDER_TYPE enumeration. Required unnamed parameter.
symbol
[in] Financial instrument name. Required unnamed parameter.
volume
[in] Trading operation volume. Required unnamed parameter.
price
[in] Open price. Required unnamed parameter.
Return Value
Real value if successful, otherwise None. The error info can be obtained using last_error().
Note
The function allows estimating the margin necessary for a specified order type on the current account and in the current market environment without considering the current pending orders and open positions. The function is similar to OrderCalcMargin.
ID |
Description |
---|---|
ORDER_TYPE_BUY |
Market buy order |
ORDER_TYPE_SELL |
Market sell order |
ORDER_TYPE_BUY_LIMIT |
Buy Limit pending order |
ORDER_TYPE_SELL_LIMIT |
Sell Limit pending order |
ORDER_TYPE_BUY_STOP |
Buy Stop pending order |
ORDER_TYPE_SELL_STOP |
Sell Stop pending order |
ORDER_TYPE_BUY_STOP_LIMIT |
Upon reaching the order price, Buy Limit pending order is placed at StopLimit price |
ORDER_TYPE_SELL_STOP_LIMIT |
Upon reaching the order price, Sell Limit pending order is placed at StopLimit price |
ORDER_TYPE_CLOSE_BY |
Order for closing a position by an opposite one |
Example:
import MetaTrader5 as mt5
|
See also