PDA

View Full Version : MA rounding numbers


billitin
12-21-2010, 10:58 PM
I've noticed that if an indicator outputs a large integer number it gets rounded up in MA (say, 12345678 would be displayed as "12M"). While it's nice for most users, in my case all decimal places are meaningful and I'd like to see a complete number like it was in NT 6.5. Can I adjust this setting somewhere? Thanks!

NinjaTrader_Brett
12-22-2010, 06:25 AM
Hello,

I will check into this with development.

Thanks for your patience.

NinjaTrader_Brett
12-22-2010, 08:48 AM
Hello,

Please add this to your code above or below OnBarUpdate()

public override string FormatPriceMarker(double price)
{
return price.ToString();
}

http://www.ninjatrader.com/support/helpGuides/nt7/formatpricemarker.htm

Let me know if I can be of further assistance.

murthymsr
12-22-2010, 10:59 AM
Hello Brett,
Thanks for the link provided by you, which facilitates selection of number of decimals. I was looking out for this facility for Market Analyser window and got it now.

Now I am able to set Bliinger Band Position (0 to 100% Range) to zero decimals.

I have a two questions on this.

1) I have an indicator using the 'public enum Selector'. I prefer to select a different value for the number of decimals for each enum selectior option. If I put the same code in each of the option with a different value for each enum selector option, I am getting error.

// Original code
// Please add this to your code above or below OnBarUpdate()

// FormatPriceMarker method of a custom indicator
public override string FormatPriceMarker(double price)
{

// Formats price values to 4 decimal places
return price.ToString("N4");
}

Can I write something like:

// Formats price values to 'int variable' decimal places
int decimals;
decimals = 0; // choose the number of decimals for that enum selector option.
return price.ToString("N"+str(decimals);

2) This method can be used for third party Indicators only. Editing of Indicators supplied with NT7 is not possible and making another with each of the supplied / used indicators cannot be done by ordinary users and very difficult for others with coding skills.

Is it not possible to supply each system indicator, where the number of decimals can be chosen by user with the properties?

Thanks for your time & prompt responses as always.

murthymsr

NinjaTrader_Brett
12-22-2010, 12:11 PM
Hello,

Yes this should be possible.

Also, I will send this recomendation to development.

Let me know if I can be of further assistance.

billitin
12-23-2010, 11:40 PM
Thanks Brett, this does show all the digits. As a remark, it's not backwards compatible and breaks the code in NT6.5, but that's small potatoes.

NinjaTrader_Brett
12-26-2010, 09:20 AM
Hello,

Yes this is correct as this is new to NinjaTrader 7 from 6.5 and would be a code breaking change. Glad you got your Ninja7 up and running however.

Let me know if I can be of further assistance.

murthymsr
01-04-2011, 11:14 AM
Hello,

Yes this should be possible.

Also, I will send this recomendation to development.

Let me know if I can be of further assistance.

hello Brett,

Thanks, it was possible. i have defined a int variable which decides the number of decimals. In each enum selection option, I could have a different number of decimals in MA display.

murthymsr

NinjaTrader_Brett
01-04-2011, 12:01 PM
Excellent! Thanks for posting back for others to benefit!