Order model represents a trading order in the MetaTrader 5 platform.
Properties
Trading symbol for the order (e.g., “EURUSD”, “GBPUSD”)
Order type (numeric value)
Order type as a human-readable string
Current profit/loss on the order
Example
Order Types
Thetype field represents different order types in MT5. Common values include:
| Value | Description |
|---|---|
| 0 | Buy |
| 1 | Sell |
| 2 | Buy Limit |
| 3 | Sell Limit |
| 4 | Buy Stop |
| 5 | Sell Stop |
Methods
The Order model provides getter and setter methods for all properties:getSymbol()/setSymbol($symbol)- Get/set the trading symbolgetType()/setType($type)- Get/set the order type (numeric)getTypeStr()/setTypeStr($type_str)- Get/set the order type (string)getProfit()/setProfit($profit)- Get/set the current profit