Primitives

followStopLoss

Follow Stop Loss with a stop loss percentage or ticks and some options to make it invisible(not visible to the broker), it follows the the position price and modifies the stop loss order to trail the position.

followStopLoss (position)

Follow Stop Loss with a stop loss percentage or ticks and some options to make it invisible(not visible to the broker), it follows the the position price and modifies the stop loss order to trail the position.

Input parameters

PropTypeDefaultDescription
percentnumber0.3The percentage of risk to take
ticksnumber3The number of ticks of risk to take
invisiblebooleantrueWhether to make the stop loss invisible to the broker
transmitbooleantrueWhether to transmit the stop loss order to the broker

SQL example

IF POS followStopLoss invisible=false transmit=false
        POS pnlTicks > 5 THEN followStopLoss SET ticks=10 transmit=true

On this page