Primitives
stopLoss
StopLossAlgo is a model that stops loss at a given percentage or ticks.
stopLoss (position)
StopLossAlgo is a model that stops loss at a given percentage or ticks.
Input parameters
| Prop | Type | Default | Description |
|---|---|---|---|
percent | number | 0 | The percentage of loss to stop |
ticks | number | 0 | The number of ticks to stop loss |
transmit | boolean | true | Whether to transmit the stop loss order |
SQL example
IF stopLoss ticks=10 transmit=false
POS pnlTicks < -10 THEN stopLoss SET ticks=10, transmit=truetrailingProfit
Trailing profit algorithm, close position when profit is above or below a certain percentage or ticks, with below options, you can set a trailing stop to close position when profit is below a certain percentage or ticks
trailingStopLoss
TrailingStopLossAlgo is a model that follows the position and adjusts the stop loss as the price moves in favor.