/*[[ Name := Daily Open at 0 GMT Author := David W Thomas Link := davidwt@usa.net Notes := This is too inform on the daily open price for use in Bunnygirl's wma cross. Separate Window := No First Color := DarkViolet First Draw Type := Line First Symbol := 217 Use Second Data := No Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ Input : TimeZoneOfData(2); Variables : shift(0), prevbars(0), first(True), loopbegin(0), dailyopen(0); SetLoopCount(0); if Period > 60 then exit; // use comment to print the daily open in the upper left. Comment("Current daily open = ", dailyopen); // check conditions are ok. if Bars < 3 Or Bars = prevbars then exit; // check for additional bars loading or total reloading If Bars < prevbars or Bars-prevbars>1 Then first = True; prevbars = Bars; If first Then Begin // loopbegin prevent counting of counted bars exclude current loopbegin = Bars - 3; first = False; End; loopbegin++; // loop from first bar to current bar (with shift=0) For shift=loopbegin Downto 0 Begin if ((TimeMinute(Time[shift]) == 0) and (TimeHour(Time[shift]) - TimeZoneOfData == 0)) then begin dailyopen = Open[shift]; end; loopbegin--; SetIndexValue(shift, dailyopen); End;