I just completed example #3:Three bar breakout trading system from the tutorial download. How can I set a trailing stop for this? for example a trailing stop of the low of the last three bars?
thanks in advance
thanks in advance
var Lows = getValue("Low", -3, 3);
var vLow = low(-1);
for (i = 0; i < 3; ++i) {
vLow = Math.min(Lows[i], vLow)
}
if (Strategy.isLong() && close() <= vLow) {
Strategy.doSell("Stopped", Strategy.MARKET, Strategy.THISBAR);
}
Comment