The following code creates a Green or Red arrow when the price moves above the SMA AND when the MACD crosses above zero. I want to create a scan to scan for present day stocks and historical stocks. Is it possible to run this in the scanner and scan back say 6 months or a year ago and find companies that meet this criteria on a given day in history and then I can click ahead in time to see how they performed based on the arrows? #SMA input size=100; input price = close; input length = 10; Def SMA = Average(price,length); Def SMAup = price >= SMA; Def SMAdwn = price <= SMA; #MACD input fastLength = 8; input slowLength = 17; input MACDLength = 9; input averageType = AverageType.EXPONENTIAL; def Value = MovingAverage(averageType, close, fastLength) - MovingAverage(averageType, close, slowLength); def Avg = MovingAverage(averageType, Value, MACDLength); def Diff = Value - Avg; def ZeroLine = 0; def UpSignal = Diff > ZeroLine; def DwnSignal = Diff < ZeroLine; def status= if UpSignal AND SMAup then 1 else if DwnSignal AND SMAdwn then 2 else status[1]; plot bullish = UpSignal AND SMAup and status[1]==2; bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); bullish.SetDefaultColor(Color.UPTICK); bullish.SetLineWeight(3); plot bearish = DwnSignal AND SMAdwn and status[1]==1; bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); bearish.SetDefaultColor(Color.DOWNTICK); bearish.SetLineWeight(3); # END OF CODE #addOrder(OrderType.bUY_TO_OPEN, UpSignal[-1] AND SMAup[-1] and #statuS==2,close[-1],size,color.green,color.UPTICK ,"BUY" ); #addOrder(OrderType.sell_TO_CLOSE, DwnSignal[-1] AND SMAdwn[-1] and #status==1,close[-1],size,color.red,color.DOWNTICK ,"SELL" );