/*[[ Name := TDSGlobal Author := Copyright © 2005 Bob O'Brien / Barcode Link := Notes := Based on Alexander Elder's Triple Screen system. To be run only on a Weekly chart. Lots := 0 Stop Loss := 0 Take Profit := 0 Trailing Stop := 0 ]]*/ var: MacdCurrent(0), MacdPrevious(0), MacdPrevious2(0) ,Direction(0), PosNeg(""); Var: newbar(0),PrevDay(0),PrevMonth(0),PrevYear(0),PrevCurtime(0),GlobalName(""); If newbar != t[0] Then { newbar = t[0]; MacdCurrent = iOsMA(12,26,9,PRICE_CLOSE,0); MacdPrevious = iOsMA(12,26,9,PRICE_CLOSE,1); MacdPrevious2 = iOsMA(12,26,9,PRICE_CLOSE,2); If MacdPrevious > MacdPrevious2 then Direction = 1; If MacdPrevious < MacdPrevious2 then Direction = -1; If MacdPrevious = MacdPrevious2 then Direction = 0; If MacdPrevious > 0 then PosNeg = "Pos"; If MacdPrevious < 0 then PosNeg = "Neg"; If MacdPrevious = 0 then PosNeg = "Zro"; GlobalName = "Gb1_Wk_"+Symbol+"_Direction"; SetGlobalVariable(GlobalName, Direction); Print("Global=",GlobalName," ",Direction); };