/*[[ Name := BunnyCross EMA Author := Steven Retz Link := http://www.RetzNest.com Separate Window := No First Color := Blue First Draw Type := Line First Symbol := 217 Use Second Data := Yes Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ Inputs : FastBars(5),SlowBars(20),Filter(20); Variables : FPrev(0),FCrnt(0),Fast(0),SPrev(0),SCrnt(0),Slow(0); Variable : shift(0); SetLoopCount(0); if Fast < Slow then { shift = Bars - Fast; } else { shift = Bars - Slow; } FPrev = iMA(FastBars,MODE_EMA,shift); SPrev = iMA(SlowBars,MODE_EMA,shift); For shift=shift-1 Downto 0 Begin FCrnt = iMA(FastBars,MODE_EMA,shift); SCrnt = iMA(SlowBars,MODE_EMA,shift); if FPrev < SPrev and FCrnt > SCrnt then Fast = SPrev + Filter*Point; if FPrev > SPrev and FCrnt < SCrnt then Slow = SPrev - Filter*Point; if Fast <> 0 then SetIndexValue(shift,Fast); if Slow <> 0 then SetIndexValue2(shift,Slow); FPrev = FCrnt; SPrev = SCrnt; End;