07:30, 14:00, etc. Time[0] = mm/dd/yy hh:mm:ss. If I do ToTime(Time[0]) I get 73000, 140000, etc. Do I need to dig to a lower level and format to 07:30, 14:00 or is there some method/function available in NinjaScript to do this, or are NT charts smart enough to do the conversion. For instance:
graphics.DrawString("myString", textFont, textBrush, Time[0], Close[0], stringFormat);
I've tried the above, doesn't work, but I've tried this:
protected override void OnBarUpdate()
{
if (CurrentBar == 0){
Plot0.Set(0);
thisX = 0;
thisY = 0;
}
else
{
Plot0.Set(Close[0]);
}
}
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
if (Bars == null)
return;
// Default plotting in base class. Uncomment if indicators holds at least one plot.
base.Plot(graphics, bounds, min, max);
// this var is needed for calc'ing height
// we just need any text here to init height
SizeF heightVal = graphics.MeasureString("Height", textFont);
//
stringFormat.Alignment = StringAlignment.Near;
textBrush.Color = Color.Black;
//thisX = bounds.X+90;
//thisY = bounds.Y;
thisX = ToTime(Time[0]);
thisY = (float)Close[0];
//
graphics.DrawString("hello", textFont, textBrush, thisX, thisY, stringFormat);
}
and I get the out of bounds error again...
"Error on plotting indicator...Please check the 'Plot' method: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"
Hmm, please point me in the right direction.
Comment