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

effect or rounding on indicator performance and calculation

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

    effect or rounding on indicator performance and calculation

    Hello All,

    I am using method- rounding to get values I can easily compare across multiple elements of my indicator . what is the effect of rounding on an indicator. I noticed some of my moving average lines are not as smooth when using rounding.

    Regards,
    George

    #2
    Hi traderfolife777,

    Rounding can cause jaggedness because there are not as many smaller increments of values in the indicator.

    Rounding rounds the price. It doesn't change anything else. But by rounding the smaller increments that make the line smoother are removed.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Rounding

      so if I have a condition in which I need 2 values to be exact. how do I do that considering values in indicator have many decimals. Example.4042.567986.. what are my options to get .. EMA 20 equal VWMA 14. then action is to color a region.

      Comment


        #4
        Hi traderfolife777,

        You can round values in your conditions if that is what is needed for your logic that calls the indicators.

        However, you would not need to round the indicator values in the indicator code..
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by traderfolife777 View Post
          so if I have a condition in which I need 2 values to be exact. how do I do that considering values in indicator have many decimals. Example.4042.567986.. what are my options to get .. EMA 20 equal VWMA 14. then action is to color a region.
          You do not need to round here. You would check for the VWMA crossing the EMA to color a region. You can use two different colors, when it crosses above from below, and when it crosses below from above.

          The first condition would be

          if(VWMA(14)[0] > EMA(20)[0] && VWMA(14)[1] <= EMA(20)[1])

          the second condition would be set up accordingly.

          You should never check doubles for equality. This is not possible.

          Theoretically, you could round any value to the full tick, but this more complex than the solution shown above.

          Comment


            #6
            thank you very much that was very helpfull

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by PaulMohn, Today, 12:36 PM
            0 responses
            2 views
            0 likes
            Last Post PaulMohn  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            38 views
            0 likes
            Last Post love2code2trade  
            Started by alifarahani, Today, 09:40 AM
            2 responses
            14 views
            0 likes
            Last Post alifarahani  
            Started by junkone, Today, 11:37 AM
            3 responses
            21 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by frankthearm, Yesterday, 09:08 AM
            12 responses
            44 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Working...
            X