Thanks in advance...
protected override void Initialize()
{
Overlay = true;
Add(new Plot(new Pen(Color.Green, 2), PlotStyle.Square, "high2DA"));
Add(new Plot(new Pen(Color.Red, 2), PlotStyle.Square, "low2DA"));
Add(new Plot(new Pen(Color.Blue, 2), PlotStyle.Square, "highMON"));
Add(new Plot(new Pen(Color.Violet, 2), PlotStyle.Square, "lowMON"));
Plots[0].Pen.DashStyle = DashStyle.Dash;
Plots[1].Pen.DashStyle = DashStyle.Dash;
Plots[2].Pen.DashStyle = DashStyle.Dash;
Plots[3].Pen.DashStyle = DashStyle.Dash;
}
protected override void OnBarUpdate()
{
if(Bars.FirstBarOfSession) {
sessionCount++;
}
if (sessionCount < 2)
return;
if(Time[0].DayOfWeek == DayOfWeek.Monday) {
bar = CurrentBar;
}
double highSOD = CurrentDayOHL().CurrentHigh[0];
double lowSOD = CurrentDayOHL().CurrentLow[0];
high2DA = PriorDayOHLC().PriorHigh[Bars.BarsSinceSession + 1];
low2DA = PriorDayOHLC().PriorLow[Bars.BarsSinceSession + 1];
if (bar !=0 ) {
highMON = PriorDayOHLC().PriorHigh[CurrentBar - bar];
lowMON = PriorDayOHLC().PriorLow[CurrentBar - bar];
}
Comment