The NT7 uses Plot(Graphics graphics, Rectangle bounds, double min, double max) and NT8 uses OnRender(ChartControl chartControl, ChartScale chartScale).
In the code pasted below could you please help me identify what would be the bounds?
It is used in these lines:
int rangeHighY = (bounds.Y + bounds.Height) - ((int) ((( highPrice - min ) / ChartControl.MaxMinusMin(max, min)) * bounds.Height))-1;
int rangeLowY = (bounds.Y + bounds.Height) - ((int) ((( lowPrice - min ) / ChartControl.MaxMinusMin(max, min)) * bounds.Height))-1;
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
base.Plot(graphics, bounds, min, max);
if (Bars == null)
return;
int actualRange = (int) Math.Round(Math.Max(Close[0] - Low[0], High[0] - Close[0]) / Bars.Instrument.MasterInstrument.TickSize);
int rangeCount = Bars.Period.Value - actualRange ;
int barRange = (int) Math.Round( (High[0] - Low[0]) / Bars.Instrument.MasterInstrument.TickSize);
int margin = (Bars.Period.Value - barRange);
double highPrice = High[0] + (margin*TickSize);
double lowPrice = Low[0] - (margin*TickSize);
int rangeHighY = (bounds.Y + bounds.Height) - ((int) ((( highPrice - min ) / ChartControl.MaxMinusMin(max, min)) * bounds.Height))-1;
int rangeLowY = (bounds.Y + bounds.Height) - ((int) ((( lowPrice - min ) / ChartControl.MaxMinusMin(max, min)) * bounds.Height))-1;
int height = rangeLowY - rangeHighY;
int rangeX = ChartControl.GetXByBarIdx(Bars, CurrentBar) - (ChartControl.BarSpace/2) ;
int width = (ChartControl.BarSpace);
}

Comment