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 Rapine Heihei, 04-23-2024, 07:51 PM
            2 responses
            30 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by Shansen, 08-30-2019, 10:18 PM
            24 responses
            943 views
            0 likes
            Last Post spwizard  
            Started by Max238, Today, 01:28 AM
            0 responses
            9 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by rocketman7, Today, 01:00 AM
            0 responses
            4 views
            0 likes
            Last Post rocketman7  
            Started by wzgy0920, 04-20-2024, 06:09 PM
            2 responses
            28 views
            0 likes
            Last Post wzgy0920  
            Working...
            X