Code is below but also here is the link: http://tos.mx/xTAfDSD SimpleMovingAvg("length" = 2)."SMA" crosses above SimpleMovingAvg("length" = 3, "displace" = -2)."SMA" or SimpleMovingAvg("length" = 2)."SMA" from 1 bars ago crosses above SimpleMovingAvg("length" = 3, "displace" = -2)."SMA" from 1 bars ago input price = close; input percent = .05; input Choice = {default greater, less}; input length = 10; def x = 100*(price / price[length]-1); plot scan; switch (Choice){ case greater:  scan = x >= percent; case less:     scan = x <= -percent;}