Nîmes France
Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker: NinjaTrader Brokerage
Trading: Oil
Posts: 51 since Nov 2010
Thanks Given: 81
Thanks Received: 18
|
Goôd day all
Can anybody point me to some Ninja 8 code for displaying the
dollar range of the current screen?
I had it somewhere in my notes but blowed if I can find it.
Ninja 7 code is
protected override void OnBarUpdate()
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
if (Bars==null || ChartControl==null)
return;
double mymax = double.MinValue, mymin = double.MaxValue;
//Print("first visible "+FirstVisibleBar+", last visible "+LastVisibleBar);
for (int i = Math.Min(CurrentBar,this.FirstVisibleBar); i >= Math.Max(0,this.LastVisibleBar); i--)
{
mymax = Math.Max(High[i],mymax);
mymin = Math.Min(Low[i],mymin);
}
double range = mymax - mymin;
double rangeDollars = (range * Instrument.MasterInstrument.PointValue);
DrawTextFixed("info",String.Format("Visible range {0:C}",rangeDollars),TextPosition.TopLeft,Color.Navy,font,Color.Empty,Color.Empty,0);
base.Plot(graphics,bounds,min,max);
}
|