public method TradeDeskAut.CloseTradesByInstrument2, CloseTradesByInstrument2Async
Brief
Closes all short or long positions for an instrument on an account by a GTC/IOC order.
Declaration | ||||
|
||||
|
||||
|
||||
|
Parameters | |||||||
sInstrument |
The instrument the closing positions are opened for. |
||||||
sAccountID |
The identifier of the account the closing positions are opened at. |
||||||
bBuy |
The side of the closing positions. |
||||||
dRate |
The rate at which it is desired to close the trades. The rate must be taken from the offers table.
Specify 0 to close the trades at the available market price. In this case |
||||||
sQuoteID |
The identifier of the quote the rate value is taken from. The value can be get from the QuoteID column of the offers table. In case the rate equals 0 this parameter must be empty string. |
||||||
iAtMarket |
The distance in pips from the specified rate within which the trades can be closed at the market price in case market moved at moment of the execution. If the If the |
||||||
iTIFType |
The Time In Force option. The parameter must have one of the following values:
See FIX Order Types for more details. |
||||||
psOrderId / psRequestId |
[output] Returns the identifier of the immediate order. |
||||||
psd |
[output] Returns |
Details
The CloseTradesByInstrument2Async
is implemented for asynchronous execution.
Last output parameter will return a RequestID, instead of OrderID (see declaration above).
Event with this RequestID will confirm that command has been executed.
The CloseTradesByInstrument2
and CloseTradesByInstrument2Async
methods are defined in the TradeDeskAut
class.