David, My back test [tbar := -1] gives last week. You got !SP-NB Cross week of 6.10 !SP-E Cross week of 6.10 because you catch last 2 weeks with your scan.
Might mention that I always use the IRL indices [inet downloaders get the daily variety every Saturday] instead of the SPs. The scan below gives all 196 [for use with <F1><F3>, but it might be a starting point [use weekly for your CCI scan] -Bob --- // IRL scan -- general health plus output = "irldaily.lst"; exchange = irldaily; float delOBV; integer tbar, lbar, obvt; daystoload 300; tbar:= 0; set MACD = 13,34,89; obvt := 0; if close(tbar) > 0 then delOBV := obv(tbar) - obv(tbar-1); if delOBV > 0 then obvt := 1; endif; if delOBV < 0 then obvt := -1; endif; println symbol,",",date(tbar),",",delOBV,",",obvt,",", 100*(close(tbar)-MovAvg(tbar,20,cl))/close(tbar):4:3,",", 100*(close(tbar)-MovAvg(tbar,150,cl))/close(tbar):4:3,",", MACD(tbar) -MACDSignal(tbar):4:2,",",Description,",",IRLSymbol,",", IRLDailyIndex; endif; |