Trade functions are used to work with orders and positions.
Trade functions:
CreateOrder(
const Instrument: TInstrument;
const Account: TAccount;
const Amount: Double;
const BuySell: TBuySell;
const StopRate: Double;
const LimitRate: Double;
const TraderRange: Integer;
const OperationTag: String);
|
Create a market order. Parameters:
1. | Instrument: TInstrument– the instrument. |
2. | Account: TAccount – the account. |
3. | Amount: Double– the number of lots. |
4. | BuySell: TBuySell– buy or sell. |
5. | StopRate: Double – the predefined stop order rate (enter 'NullRate' if you do not want to place a stop order). |
6. | LimitRate: Double – the predefined limit order rate (enter 'NullRate' if you do not want to place a limit order). |
7. | TraderRange: Integer – Trader Range. |
8. | OperationTag: String – the custom order tag. |
|
CreateEntryOrder(
const Instrument: TInstrument;
const Account: TAccount;
const Amount: Double;
const BuySell: TBuySell;
const Rate: Double;
const StopRate: Double;
const LimitRate: Double;
const OrderType: TorderType;
const OperationTag: String);
|
Create an entry order. Parameters:
1. | Instrument: TInstrument – the used instrument. |
2. | Account: TAccount – the used account. |
3. | Amount: Double — the number of lots. |
4. | BuySell: TBuySell — buy or sell. |
5. | Rate: Double — the entry rate. |
6. | StopRate: Double – the predefined stop order rate (enter 'NullRate' if you do not want to place a stop order). |
7. | LimitRate: Double – the predefined limit order rate (enter 'NullRate' if you do not want to place a limit order). |
8. | OrderType: TOrderType — the order type. Values: otEStop, otELimit. |
9. | OperationTag: String — custom order tag. |
|
CreateStopLimitOrder(
const Trade: TTrade;
const Rate: Double;
const OrderType: TOrderType;
const OperationTag: String);
|
Create a stop or a limit order on the open position. Parameters:
1. | Trade: TTrade – the open position (object) on which the order is placed. |
2. | Rate: Double – the stop or limit rate. |
3. | OrderType: TOrderType — the order type. Values: otStop, otLimit. |
4. | OperationTag: String — the custom order tag. |
|
CreateStopLimitOnEntry(
const EntryOrder: TOrder;
const Rate: Double;
const OrderType: TOrderType;
const OperationTag: String);
|
Create a stop or a limit order on the entry order. Parameters:
1. | EntryOrder: TOrder; – the entry order, on which the conditional order is placed. |
2. | Rate: Double – the stop or limit rate. |
3. | OrderType: TOrderType — the order type. Values: otStop, otLimit. |
4. | OperationTag: String — the custom order tag. |
|
CloseTrade(
const Trade: TTrade;
const Amount: Double;
const TraderRange: Integer;
const OperationTag: String);
|
Close a position. Parameters:
1. | Trade – the open position which should be closed. |
2. | Amount – the number of lots. |
3. | TraderRange – Trader Range. |
4. | OperationTag – the custom order tag. |
|
Note: Order execution may be delayed by several milliseconds or even seconds depending on speed and quality of your internet connection.