Announcement

Collapse
No announcement yet.

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 wftrrdt, Today, 05:01 AM
            0 responses
            2 views
            0 likes
            Last Post wftrrdt
            by wftrrdt
             
            Started by wellbeingcbd, Today, 04:41 AM
            0 responses
            1 view
            0 likes
            Last Post wellbeingcbd  
            Started by piydasuknu, Today, 03:45 AM
            0 responses
            3 views
            0 likes
            Last Post piydasuknu  
            Started by ajdfkgjiojjhfihjg, Today, 03:20 AM
            0 responses
            3 views
            0 likes
            Last Post ajdfkgjiojjhfihjg  
            Started by keravitahere, Today, 01:56 AM
            0 responses
            2 views
            0 likes
            Last Post keravitahere  
            Working...
            X