I loaded a EURUSD daily data series, Days to Load = 14, End Date = 5/9/2012 in a Default 24/7 Template.
The EURUSD chart painted 10 candles on the daily chart, the days plotted are 26 APR,27 APR,28 APR,1 MAY,2 MAY,3 MAY,4 MAY,5 MAY,8 MAY,9 MAY as shown below.
In the overidden plot function, my code read the very first value from BarsArray[0].GetTime(0) (when i=0) i.e. the very first date loaded, and the date shows 25 Apr 12. However, if you recall, my chart shows the first candle as 26 Apr 12 (seen from the NT data box above) . My code is as follows:
The codes above can be read in the below context :
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max) { int LastBar = Math.Min(ChartControl.LastBarPainted, Bars.Count - 1); int BarsPainted = Bars.Count - ChartControl.FirstBarPainted; int FirstBar = Math.Max(0, (LastBar - BarsPainted) + 1); int intFirstBarOnChart = ChartControl.FirstBarPainted; int intLastBarOnChart = ChartControl.LastBarPainted; int intBarsOnChart = intLastBarOnChart - intFirstBarOnChart; int iFontHt=0; List <int> XCoordOfSessions = new List<int>(); List <int> YCoordOfSessions = new List<int>(); List <string> ProfileAlphabetList = new List<string>(); DateTime FirstDay = new DateTime(); double FirstOpen=0; try { //Print(BarsArray[0].GetOpen(1)); for (int i =0;i<=LastBar+10;i++) { int watch = (i+1)%numberOfInputPeriodsPerProfile; #region Main loop //Add bar to custom bar list if (i==0) BarList.Clear(); MyBar mb = new MyBar(BarsArray[0].GetOpen(i),BarsArray[0].GetHigh(i),BarsArray[0].GetLow(i),BarsArray[0].GetClose(i),BarsArray[0].GetTime(i)); this.BarList.Add(mb); FirstOpen=BarsArray[0].GetOpen(i); FirstDay = BarsArray[0].GetTime(i); int TotalBars = BarsArray[0].Count;
Any help would be appreciated.
Thanks.
Comment