- History Database Properties
- Order Properties
- Position Properties
- Deal Properties
- Trade Operation Types
- Trade Transaction Types
- Trade Orders in DOM
- Signal Properties
Trade Operation Types
Trading is done by sending orders to open positions using the OrderSend() function, as well as to place, modify or delete pending orders. Each trade order refers to the type of the requested operation. Trading operations are described in the ENUM_TRADE_REQUEST_ACTIONS enumeration.
ENUM_TRADE_REQUEST_ACTIONS
Identifier |
Description |
---|---|
Place a trade order for an immediate execution with the specified parameters (market order) |
|
Place a trade order for the execution under specified conditions (pending order) |
|
Modify Stop Loss and Take Profit values of an opened position |
|
Modify the parameters of the order placed previously |
|
Delete the pending order placed previously |
|
Close a position by an opposite one |
Example of the TRADE_ACTION_DEAL trade operation for opening a Buy position:
#define EXPERT_MAGIC 123456 // MagicNumber of the expert |
Example of the TRADE_ACTION_DEAL trade operation for opening a Sell position:
#define EXPERT_MAGIC 123456 // MagicNumber of the expert |
Example of the TRADE_ACTION_DEAL trade operation for closing positions:
#define EXPERT_MAGIC 123456 // MagicNumber of the expert |
Example of the TRADE_ACTION_PENDING trade operation for placing a pending order:
#property description "Example of placing pending orders" |
Example of the TRADE_ACTION_SLTP trade operation for modifying the Stop Loss and Take Profit values of an open position:
#define EXPERT_MAGIC 123456 // MagicNumber of the expert |
Example of the TRADE_ACTION_MODIFY trade operation for modifying the price levels of pending orders:
#define EXPERT_MAGIC 123456 // MagicNumber of the expert |
Example of the TRADE_ACTION_REMOVE trade operation for deleting pending orders:
#define EXPERT_MAGIC 123456 // MagicNumber of the expert
|
Example of the TRADE_ACTION_CLOSE_BY trade operation for closing positions by opposite positions:
#define EXPERT_MAGIC 123456 // MagicNumber of the expert |