public method TradeDeskAut.ChangeEntryOrderStopLimit3, ChangeEntryOrderStopLimit3Async

Brief

Changes a stop/limit order both simple and pegged for the entry order, allows setting the traling mode for stop/limit and returns the order id.

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.

Declaration
Visual Basic
Sub ChangeEntryOrderStopLimit3 (sOrderID as String, dSLRate as Double, iSLType as Integer, iTrailMinMove as Integer, ByVal psOrderId as Variant)
IDL
[id(409)] HRESULT ChangeEntryOrderStopLimit3( [in]BSTR sOrderID, [in]double dSLRate, [in]int iSLFlag, [in]int iTrailMinMove, [out]VARIANT* psOrderId)
Visual Basic
Sub ChangeEntryOrderStopLimit3Async (sOrderID as String, dSLRate as Double, iSLType as Integer, iTrailMinMove as Integer, ByVal psRequestId as Variant)
IDL
[id(410)] HRESULT ChangeEntryOrderStopLimit3Async( [in]BSTR sOrderID, [in]double dSLRate, [in]int iSLFlag, [in]int iTrailMinMove, [out]VARIANT *psRequestId)

Parameters
sOrderID

The identifier of the entry order.

dSLRate

The rate or the offset in pips for the stop or limit order. The interpretation of the parameter depends on the value of the iSLType parameter.

For a stop order, the distance between the specified stop level and the entry order rate must be greater than the sum of the minimal conditional distance and the current spread.

For a limit order, the distance between the specified limit level and the entry order rate must be greater than the minimal conditional distance.

The value of the minimal conditional distance you can retrieve using methods of TradingSettingsProviderAut interface.

iSLType

The type of the stop or limit order. The value defines interpretation of dSLRate parameter. The parameter can have the following values:

TradeDeskAut.SL_STOP

Use this value in case the simple stop order must be added.

TradeDeskAut.SL_LIMIT

Use this value in case the simple limit order must be added.

TradeDeskAut.SL_PEGSTOPOPEN

Use this value in case the stop order must be the pegged stop order and its offset must be added to the open price (see Order Types for information about pegged orders).

The offset is specified in pips.

For buy orders, the stop order must be below open price minus current spread, i.e. offset must be negative and must be less than "-" spread.

For sell orders, the stop order must be above open price plus current spread. i.e. offset must be positive and must be bigger than spread.

TradeDeskAut.SL_PEGSTOPCLOSE

Use this value in case the stop order must be the pegged stop order and its offset must be added to the close price (see Order Types for information about pegged orders).

The offset is specified in pips.

For buy orders, the stop order must be below close price, i.e. offset must be negative.

For sell orders, the stop order must be above close price, i.e. offset must be positive.

TradeDeskAut.SL_PEGLIMITOPEN

Use this value in case the limit order must be the pegged limit order and its offset must be added to the open price (see Order Types for information about pegged orders).

The offset is specified in pips.

For buy orders, the limit order must be above the open price, i.e. offset must be positive.

For sell orders, the limit order must be below the open price, i.e. offset must be negative.

TradeDeskAut.SL_PEGLIMITCLOSE

Use this value in case the limit order must be the pegged limit order and its offset must be added to the close price (see Order Types for information about pegged orders).

The offset is specified in pips.

For buy orders, the limit order must be above the close price plus current spread, i.e. offset must be positive and must be bigger than spread.

For sell orders, the limit order must be below the close price minus current spread. i.e. offset must be negative and must be less than "-" spread.

For example, to set the simple limit order, specify in this parameter tradeDesk.SL_LIMIT. To set the pegged stop order the offset of which will be added to the open price, specify in this parameter tradeDesk.SL_PEGSTOPOPEN and so on.

iTrailMinMove

Controls the trailing stop or limit order.

In case the stop/limit order must not be trailing, specify 0 in this parameter.

In case the stop/limit order must be trailing with a dynamic step, specify 1 in this parameter.

In case the stop/limit order must be trailing with a fixed step, specify the size in pips of the market movement after which the order must be moved following the market. The value must be from the minimum to the maximum allowed value defined on the server. To check the values, use the methods of the TradingSettingsProviderAut interface.

Note that trailing stop or limit orders can be not available on the server. To check whether trailing stop/limit orders with a dynamic step are available, use the PermissionCheckerAut.CanUseDynamicTrailingForStop and PermissionCheckerAut.CanUseDynamicTrailingForLimit methods. To check whether trailing stop/limit orders with a fixed step are available, use the PermissionCheckerAut.CanUseFluctuateTrailingForStop and PermissionCheckerAut.CanUseFluctuateTrailingForLimit methods.

United States based accounts must specify 0 in this parameter. Please read NFA Compliance Rule 2-43(b). In case any other value is used Order2Go API will throw an Exception/Error.

psOrderId / psRequestId

[output] Returns the identifier of the stop or limit order.
For ChangeEntryOrderStopLimit3 this parameter will return OrderID.
For ChangeEntryOrderStopLimit3Async this parameter will return RequestID.

Details

Unlike the ChangeEntryOrderStopLimit and ChangeEntryOrderStopLimit2 methods the ChangeEntryOrderStopLimit3 method allows you to make your stop/limit orders a trailing orders with a dynamic or fixed step.

The ChangeEntryOrderStopLimit3 and ChangeEntryOrderStopLimit3Async methods are defined in the TradeDeskAut class.

back