protected override void OnBarUpdate()
{
double PriorWkHigh = PriorWeekOHLC().PriorWeekHigh[0];
double PriorWkLow = PriorWeekOHLC().PriorWeekLow[0];
if(Bars.FirstBarOfSession) {
sessionCount++;
}
if (sessionCount < 2)
return;
if(Time[0].DayOfWeek == DayOfWeek.Monday)
{
bar = CurrentBar;
}
// High and Low for Monday
if (bar !=0 ) {
highMON = PriorDayOHLC().PriorHigh[CurrentBar - bar];
lowMON = PriorDayOHLC().PriorLow[CurrentBar - bar];
}
// High and Low for Monday
if (bar !=0 ) {
highMON = PriorDayOHLC().PriorHigh[CurrentBar - bar];
lowMON = PriorDayOHLC().PriorLow[CurrentBar - bar];
}
if (Close[0] > highMON ) {
if (colorBars) {
BarColor = Color.Blue;
}
}
else if (Close[0] < lowMON ) {
if (colorBars) {
BarColor = Color.Red;
}
}
else if (colorBars) {
BarColor = Color.DimGray;
}
}
Comment