Trailing stop loss
About
Contains distance trailing stop loss configuration
Fields
Name |
Type |
Required |
Description |
distance |
DistanceTrailingStopLoss |
|
distance trailing stop loss configuration. If both distance and threshold TSL are set, then the resulting SL will be the one which is closest to the current price |
threshold |
ThresholdTrailingStopLoss |
|
threshold trailing stop loss configuration. If both distance and threshold TSL are set, then the resulting SL will be the one which is closest to the current price |
DistanceTrailingStopLoss model fields
Name |
Type |
Required |
Description |
distance |
number |
Yes |
SL distance relative to current price, interpreted according to units field value |
units |
string |
|
distance trailing stop loss units. RELATIVE_* means that the distance field value contains relative stop loss expressed either in price, points, pips, account currency or balance percentage. Default is RELATIVE_PRICE, enum: RELATIVE_PRICE , RELATIVE_POINTS , RELATIVE_PIPS , RELATIVE_CURRENCY , RELATIVE_BALANCE_PERCENTAGE |
ThresholdTrailingStopLoss model fields
Name |
Type |
Required |
Description |
thresholds |
Array |
Yes |
stop loss threshold |
units |
string |
|
threshold stop loss units. ABSOLUTE_PRICE means the that the value of stop loss threshold fields contains a final threshold & stop loss value. RELATIVE_* means that the threshold fields value contains relative threshold & stop loss values, expressed either in price, points, pips, account currency or balance percentage. Default is ABSOLUTE_PRICE, enum: ABSOLUTE_PRICE , RELATIVE_PRICE , RELATIVE_POINTS , RELATIVE_PIPS , RELATIVE_CURRENCY , RELATIVE_BALANCE_PERCENTAGE |
stopPriceBase |
string |
|
defined the base price to calculate SL relative to for *_MODIFY and pending order requests. Default is OPEN_PRICE, enum: CURRENT_PRICE , OPEN_PRICE |
StopLossThreshold model fields
Name |
Type |
Required |
Description |
threshold |
number |
Yes |
price threshold relative to position open price, interpreted according to units field value |
stopLoss |
number |
Yes |
stop loss value, interpreted according to units and basePrice field values |
Example
{
"distance": {
"distance": 0.1,
"units": "RELATIVE_PRICE"
},
"threshold": {
"thresholds": [
{
"threshold": 1.3,
"stopLoss": 1.1
}
],
"units": "ABSOLUTE_PRICE",
"stopPriceBase": "CURRENT_PRICE"
}
}
Usages