/*[[ Name := gann hi/lo activator real-time Author := Copyright © 2005, Nick Bilak Link := Separate Window := No First Color := blue First Draw Type := symbol First Symbol := 159 Use Second Data := yes Second Color := Red Second Draw Type := symbol Second Symbol := 159 ]]*/ Variables : i(0),hma(0),lma(0),startBar(0),up(false),sw(true),first(true); SetLoopCount(0); if first then { startbar=bars-5; first=false; }; startbar++; for i = startBar downto 0 { hma=(h[i+2]+h[i+1]+h[i])/3; lma=(l[i+2]+l[i+1]+l[i])/3; if c[i]hma then { //lo if up then SetIndexValue(i,hma); up=false; }; if up then SetIndexValue(i,hma) else SetIndexValue2(i,lma); startbar--; };