//P_WeeklyHL // Day of week numerical descriptor is from 0 == Sunday to 6 == Saturday // Indentifies which day had the low and the high for the week // Export to Excel for counting // Note Excel has an upper limit of approx 65000 rows
Filter = 1; WeeklyHigh = IIf(DayOfWeek() == 5, HHV(H,5),0); Plot(WeeklyHigh,"HighOfWeek(Value)",1,1); HSB = HighestSinceBars(DayOfWeek() == 1,H,1); HighOfWeekArray = 5 - HSB; HighOfWeek = IIf(DayOfWeek() == 5, HighOfWeekArray, 0); Plot(HighOfWeek,"HighOfWeek(Day)",2,1); AddColumn(HighOfWeek,"HighDayOfWeek",1,1); /////////////////////////////////////////// //WeeklyLow = IIf(DayOfWeek() == 5, LLV(L,5),0); //Plot(WeeklyLow,"LowOfWeek(Value)",1,1); //LSB = LowestSinceBars(DayOfWeek() == 1,L,1); //LowOfWeekArray = 5 - LSB; //LowOfWeek = IIf(DayOfWeek() == 5, LowOfWeekArray, 0); //Plot(LowOfWeek,"LowOfWeek(Day)",2,1); //AddColumn(LowOfWeek,"LowDayOfWeek",1,1); --- In [email protected], "brian_z111" <[EMAIL PROTECTED]> wrote: > > Code tweaking required. > > I have posted a short exploration to report the days when the weekly > high and low occurs (at the UKB). > > At the moment I am exporting to a spreadsheet to total the number of > times it happens on a Mon or Tue etc. > > If anybody would like to have a go at improving, or completing the > code, please feel free (assuming there is nothing good on TV this > weekend). > > http://www.amibroker.org/userkb/2008/03/06/weekly-high-or-low-days/ > > It would be better if I could do the counting in AB (ATC?) > > Any comments on the elegance (?) of the code? > Any easier ways to do this? > Anybody seen anything similar elsewhere (AFL library)? > > Maybe the returns could be reported as a pretty chart (don't know if it > would be worth the effort)? > > http://www.amibroker.org/userkb/2008/03/06/weekly-high-or-low-days/ > > Anybody up for a challenge? > > brian_z11 >
