PDA

View Full Version : Averages


MrBaffalo
07-04-2007, 02:25 AM
Hi Guys
A few questions regarding the averages's calculation method.
If I code a simple crossover (close and average) how many decimals are taken in consideration from ninja regarding the average?
Example, if I have a 200 EMA and its plotted value is 120.83, and my condition is close crosses over/below average, average is calculated with 2 decimal as the market value or ema is calculated taking in consideration N decimals?
Take a look at the attached image.

Best regards
Marcello

NinjaTrader_Dierk
07-04-2007, 03:56 AM
Not sure I follow.

Some hints:
- any comparison in NT goes with a precision of the .NET data type "double" (15 decimal places)
- values displayed on chart might be rounded and might not match the actual comparison
- in your custom code you might choose to go for your custom cross over check logic which then would go with the precision of your code.

bkout
05-20-2009, 10:10 AM
I'm surprised how often on my MA crossover systems the 2 MAs are the equal value at the close and I can't tell if there is a signal or not. If it's not already available somewhere that I haven't found please request that the option to set the data box to 4 decimals be available.

NinjaTrader_Josh
05-20-2009, 10:26 AM
Thank you for the suggestion. It is on our list of future considerations.

bkout
05-20-2009, 05:49 PM
Wondered if there is a workaround in the meantime without using code. If I understood the thread the actual trade signal would be based on the difference between the two EMAs to 15 decimal places! (That would do it!) -- any way to create an indicator without code that can tell me while a candle is forming what the difference is between the two EMAs (not based on two decimals which might look equal to each other). Obviously after the candle has formed I can see if the trade triggered or not.

NinjaTrader_Bertrand
05-21-2009, 06:30 AM
bkout, unfortunately not, for the indicator you would also need custom coding using double precision as Dierk indicated in his post 2.