Optimization, Trading Strategy, Fmz Quant, Cryptocurrency, Trends.
shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop dir = 1 dir := nz(dir[1], dir) dir := dir == -1 and MAvg > shortStopPrev ? 1 : dir == 1 and MAvg < longStopPrev ? -1 : dir MT = dir == 1 ? longStop : shortStop OTT = MAvg > MT ? MT * (200 + percent) / 200 : MT * (200 - percent) / 200