Weekly High or Low Days

DRAFT

This code reports the probability of the high or low, for the week, occurring on any given day.

In its current form it is designed for running as an exploration and then exporting the results to a spreadsheet for analysis.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//P_WeeklyHL   
// Day of week numerical descriptor is from 0 == Sunday to 6 == Saturday    
// Identifies 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);

It can also be inserted into an indicator pane to allow users to cross-check the code output against expected values.

WHLD001

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 2.67 out of 5)
Loading ... Loading ...

No comments yet. Be the first.

Leave a reply