PDA

View Full Version : Display Instrument values on chart


tquinn
01-27-2007, 06:50 AM
I like to display Instrument values on my chart. Is there a method I can call which returns a string ready to display on the chart?

The returned string should have the correct # of decimals, and display fractions as appropriate.

Something like High[0].ToDisplay() that returned
"1.0045"
"798.4"
"115 16/32" or "115^16"
"115 32/64" or "115'32"

NinjaTrader_Dierk
01-28-2007, 09:09 AM
Instrument.MasterInstrument.FormatPrice(High[0]) return a formated string

tquinn
01-28-2007, 12:25 PM
Dierk,
I'm really struggling with C#, thanks for your patience. With PriceDisplay declared as a string variable. The statement

PriceDisplay=Instrument.MasterInstrument.FormatPri ce(High[1]);

produces this error

The name "Instrument" does not exist in the current context

I know this will eventually mean something to me, but for now I need more help.

NinjaTrader_Dierk
01-28-2007, 12:30 PM
My apologies. Please try:
PriceDisplay=Bars.Instrument.MasterInstrument.Form atPrice(High[1]);