input price = close; input calculationMode = {default Normal, Alternate}; def fastLine; switch (calculationMode) { case Normal: fastLine = Average(price, 3) - Average(price, 10); case Alternate: fastLine = Average(price - Average(price[3], 3), 2); } def slowLine = Average(fastLine, 16); def crossAbove = fastLine[1] < slowLine[1] and fastLine > slowLine; def crossBelow = fastLine[1] > slowLine[1] and fastLine < slowLine; plot data = if crossAbove then 1 else if crossBelow then -1 else 0; data.AssignValueColor(if data <> 0 then Color.BLACK else Color.CURRENT); AssignBackgroundColor(if data > 0 then Color.GREEN else if data < 0 then Color.RED else Color.CURRENT);