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 samir, Today, 07:00 PM
            0 responses
            9 views
            0 likes
            Last Post samir
            by samir
             
            Started by travisloneker, Today, 06:52 PM
            0 responses
            4 views
            0 likes
            Last Post travisloneker  
            Started by InfraredBusa, Today, 05:50 PM
            0 responses
            3 views
            0 likes
            Last Post InfraredBusa  
            Started by White Fork, Today, 04:56 PM
            1 response
            8 views
            0 likes
            Last Post White Fork  
            Started by steveyinyang, Today, 02:48 PM
            3 responses
            20 views
            0 likes
            Last Post steveyinyang  
            Working...
            X