Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Averages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Averages

    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
    Attached Files

    #2
    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.

    Comment


      #3
      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.

      Comment


        #4
        Thank you for the suggestion. It is on our list of future considerations.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          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.

          Comment


            #6
            bkout, unfortunately not, for the indicator you would also need custom coding using double precision as Dierk indicated in his post 2.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by dcriador, Today, 12:06 PM
            0 responses
            6 views
            0 likes
            Last Post dcriador  
            Started by dcriador, Today, 12:04 PM
            0 responses
            5 views
            0 likes
            Last Post dcriador  
            Started by cutzpr, Today, 08:54 AM
            0 responses
            11 views
            0 likes
            Last Post cutzpr
            by cutzpr
             
            Started by benmarkal, Today, 08:44 AM
            0 responses
            17 views
            0 likes
            Last Post benmarkal  
            Started by Tin34, Today, 03:30 AM
            2 responses
            28 views
            0 likes
            Last Post Tin34
            by Tin34
             
            Working...
            X