Set a trailing stop of x €,$ (in the currency of the instrument).
Syntax:
1 |
SET STOP $TRAILING x |
Example:
We are setting here a trailing stop at 100$ from the current average price
1 2 3 4 5 6 7 8 9 10 11 12 |
//indis i1 = average(close)[100] i2 = average(close)[5] tradeinitiate = Close>i1 AND Close<i2 AND Low[3]>Low[2] AND Low[2]>Low[1] AND Low[1]>Low IF NOT LongOnMarket AND tradeinitiate THEN BUY 1 CONTRACTS AT MARKET ENDIF //set stop loss trailing at 100$ from the current average price SET STOP $TRAILING 100 |