public method TradeDeskAut.CloseTrade2, CloseTrade2Async
Brief
Closes a trade by a GTC/IOC order.
Does not work for United States based accounts. Please read NFA Compliance Rule 2-43(b). In case if this function is used Order2Go API will throw an Exception/Error.
Please read: How to close positions on United States based (FIFO) accounts.
Declaration | ||||
|
||||
|
||||
|
||||
|
Parameters | |||||||
sTradeID |
The identifier of the existing trade. |
||||||
iAmount |
The amount which it is desired to close. The amount must be equal to or greater than and must be divisible by the The The trade can be closed partially. |
||||||
dRate |
The rate at which it is desired to close the trade. The rate must be taken from the offers table. Specify 0 to close the trade at the available market price. |
||||||
wcsQuoteID |
The identifier of the quote the rate value is taken from. The value can be get from the |
||||||
iAtMarket |
The distance in pips from the specified rate within which the trade 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 CloseTrade2Async
method 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 CloseTrade2
and CloseTrade2Async
methods are defined in the TradeDeskAut
class.