Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Use the rounded value instead of the exact value with decimals?

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

    Use the rounded value instead of the exact value with decimals?

    I want the strategy to use indicator's rounded value that is displayed in the price marker on the chart. When the moving averages are displayed in Panel 2 and I can see the extra decimal points. I don't want to use those exact values/calculations just the rounded ones.

    #2
    Are you using the wizard or programming directly?
    RayNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ray View Post
      Are you using the wizard or programming directly?
      The Wizard.

      Comment


        #4
        Thanks for the clarification. Unfortunately this is not possible to do in the wizard. By directly programming it is using the Instrument.Round2TickSize() method.

        More information on this here - http://www.ninjatrader-support.com/H...2TickSize.html
        RayNinjaTrader Customer Service

        Comment


          #5
          Thanks for the help.

          Comment


            #6
            I'm having trouble doing this. Is the Round2Tick Method the only way?

            Comment


              #7
              You could code yourself what we have wrapped in the Round2TickSize method but this wil be a lot harder than just using the method already provided.
              RayNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Ray View Post
                You could code yourself what we have wrapped in the Round2TickSize method but this wil be a lot harder than just using the method already provided.
                {
                double price; Instrument.MasterInstrument.Round2TickSize();
                }

                Is this the correct way? I put this ^^^under


                protected override void OnBarUpdate()
                {

                Comment


                  #9
                  No, something like:

                  double myDouble = Instrument.MasterInstrument.Round2TickSize(yourInd icatorValue);
                  RayNinjaTrader Customer Service

                  Comment


                    #10
                    More info here...


                    Rounds a value to the nearest integer or specified number of decimal places.


                    This example of the decimal.Round( decimal, Integer )
                    method generates the following output.

                    Argument``` Digits ```Result
                    -------- ```------ ```------
                    1.45 ````````1``````` 1.4
                    1.55 ````````1 ```````1.6
                    123.456789 ``4 `````123.4568
                    123.456789 ``6 `````123.456789
                    123.456789 ``8 `````123.456789
                    -123.456 ````0 `````-123
                    -123.0000000 3 `````-123.000


                    decimal == Argument
                    Integer == Digits
                    Result == the final output.



                    I also used this to convert a dataseries double value to an integer...

                    period = (int) Math.Round(Value5[0]);

                    Good Luck,

                    RJay
                    Last edited by RJay; 07-09-2008, 10:25 AM.
                    RJay
                    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                    Comment


                      #11
                      Originally posted by rt6176 View Post
                      More info here...


                      http://msdn.microsoft.com/en-us/library/system.decimal.round(VS.71).aspx

                      This example of the decimal.Round( decimal, Integer )
                      method generates the following output.

                      Argument``` Digits ```Result
                      -------- ```------ ```------
                      1.45 ````````1``````` 1.4
                      1.55 ````````1 ```````1.6
                      123.456789 ``4 `````123.4568
                      123.456789 ``6 `````123.456789
                      123.456789 ``8 `````123.456789
                      -123.456 ````0 `````-123
                      -123.0000000 3 `````-123.000


                      decimal == Argument
                      Integer == Digits
                      Result == the final output.



                      I also used this to convert a dataseries double value to an interger...

                      period = (int) Math.Round(Value5[0]);

                      Good Luck,

                      RJay
                      Thanks for the help. I really appreciate. Still trying to get it working.

                      Comment


                        #12
                        I've given up on doing this myself but I'm trying to get in contact with NinjaScript consultants to have this done instead. 2 of them haven't replied to emails, one of them being Ben from AffordableIndicators. The other one Kama has no links to get in contact which is weird. The one who actually replied is too expensive. Are there any other consultants that help with this or another way to get in contact with Ben from AffordableIndicators?

                        Please help

                        Comment


                          #13
                          On KamaCoder there is a "Contact Us" menu - http://www.kamacoder.com/ContactUs.aspx

                          I will send a note to Ben.
                          RayNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by aussugardefender, Today, 01:07 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post aussugardefender  
                          Started by pvincent, 06-23-2022, 12:53 PM
                          14 responses
                          238 views
                          0 likes
                          Last Post Nyman
                          by Nyman
                           
                          Started by TraderG23, 12-08-2023, 07:56 AM
                          9 responses
                          383 views
                          1 like
                          Last Post Gavini
                          by Gavini
                           
                          Started by oviejo, Today, 12:28 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post oviejo
                          by oviejo
                           
                          Started by pechtri, 06-22-2023, 02:31 AM
                          10 responses
                          125 views
                          0 likes
                          Last Post Leeroy_Jenkins  
                          Working...
                          X