PDA

View Full Version : Indicator Plot Formating Help


Json
11-28-2007, 10:55 AM
I'm having trouble matching my variable (a double) when ploted on a chart.

ZB is charted as "116 8/32"

my variable charts as "116.25000"

How and where should i convert my variable to display in fractions as well?

NinjaTrader_Ray
11-28-2007, 11:05 AM
Unfortunately there is no way to format a plot's value based on the display formatting of the underlying price.

Json
11-28-2007, 11:26 AM
Since I can't match the formating of the underlying, is the formating of ZN exposed so I can hard code the same?

In an older post I seen -
PriceDisplay=Bars.Instrument.MasterInstrument.Form atPrice(High[1]);

Not sure if this applies nor could I get it to work.

NinjaTrader_Ray
11-28-2007, 11:42 AM
There is a method that will format a price to a string for use with the Print() method or any other custom drawing you might do.

Instrument.MasterInstrument.FormatPrice(double priceValue)

Something like this would work for example:

double myCustomCalculation = // Some price
Print("Formatted price is " + Instrument.MasterInstrument.FormatPrice(myCustomCa lculation));