I try to plot current day open and previous day high and low levels on a intraday chart. Here is steps;
1. Added 3 plots in SetDefaults state;
AddPlot(new Stroke(Brushes.Gray, 2), PlotStyle.Hash, "DailyOpenLevel");
AddPlot(new Stroke(Brushes.Red, 2), PlotStyle.Hash, "DailyHighLevel");
AddPlot(new Stroke(Brushes.Blue, 2), PlotStyle.Hash, "DailyLowLevel");
2. Aded daily data series;
AddDataSeries(BarsPeriodType.Day, 1);
3.OnBarUpdate setting values;
if (BarsInProgress == 0)
{
if (IsFirstTickOfBar)
{
DailyOpenLevel[0] = Opens[1][0];
if (CurrentBars[1] > 0)
{
DailyHighLevel[0] = Highs[1][1];
DailyLowLevel[0] = Lows[1][1];
}
}
}
But result did not happen as I imagined. I see that open level is actually previous day open. High and low levels are the day before yesterday's high and low. Could you please tell me where am I doing wrong?
Also could you please tell me. When i add additional dataseries only with BarsPeriodType an value. Is it inherit other properties from primary dataseries? For example bars to load, trading hours and break EOD property?
Thanks,
Aytac
Comment