Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ratio Chart

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

    #46
    If you want higher degrees of precision the indicator needs to be programmed to take advantage of FormatPriceMarkers().

    Code:
    public override string FormatPriceMarker(double price)
    {
         // Formats price values to 4 decimal places
         return price.ToString("N4");
    }
    Josh P.NinjaTrader Customer Service

    Comment


      #47
      Thanks Josh...
      So if the value I wish to adjust precision of is an indicator value being set as such:

      Value.Set(KDRatio(Closes[Instrument1][0], Instrument2Close[0], Normalize)


      How exactly would I treat this? Do I first pass Closes[Instrument1][0] and Instrument2Close[0] to "FormatPriceMarker", or do I just do something like:

      Value.Set(FormatPriceMarker(KDRatio(Closes[Instrument1][0], Instrument2Close[0], Normalize))


      Thanks
      Shawn



      public override string FormatPriceMarker(double price)
      {
      // Formats price values to 4 decimal places
      return price.ToString("N4");


      }

      Comment


        #48
        shawnh,

        You don't need to pass anything into FormatPriceMarker(). All you do is override the method and all plots of that indicator will take advantage of the formatting you applied to the indicator.
        Josh P.NinjaTrader Customer Service

        Comment


          #49
          What do you mean by "override the method"? How do you do that?

          Comment


            #50
            shawnh,

            Just copy paste the code I have provided below and outside of OnBarUpdate() and then you should be fine. Notice how Initialize() and OnBarUpdate() are on the same "level". FormatPriceMarker() should be on the same level as them.
            Josh P.NinjaTrader Customer Service

            Comment


              #51
              OK, thanks Josh.

              Shawn

              Comment


                #52
                I've posted an updated Ratio indicator in the Indicators section:

                http://www.ninjatrader-support2.com/...d=1&linkid=288

                Also, I've replaced the "Spread3.zip" file (3-instrument model indicator) in post #27 of this thread; it fixes a subtle synchronization problem, so anyone who is using the older version of that file should download the new version.

                -Kevin

                Comment


                  #53
                  Ratio indicator

                  I downloaded your ratio indicator to see the code because I am a novice working on something similar, however when I tried to compile it in NT7 I got an error on lines 412, 384, and 404 that namespace name "grid category" could not be found. Any suggestions to get this to work?

                  Comment


                    #54
                    It compiles fine for me under NT7 B13 (and previous versions also). I can't explain why it's not working for you. Are you compiling under NT7 B13?

                    Update: I just compiled under B14 and it works fine there too.
                    Last edited by kdoren; 04-13-2010, 09:47 PM.

                    Comment


                      #55
                      Resolved

                      I got it to work- was sending it to compile in NT6.5 careless mistake great indicator though.

                      Comment


                        #56
                        still searching

                        hi kevin, hi folks,
                        I´m still searching for such kind of ration indicators working with multiple instruments eg. cabe and euro - I already installed the correlation indicator which is great but even weightier is that I want to have displayed exact spread in points (difference) and percent.
                        can you (kevin) or anybody other assist me?
                        thanks!


                        Originally posted by kdoren View Post
                        I've posted an updated Ratio indicator in the Indicators section:



                        Also, I've replaced the "Spread3.zip" file (3-instrument model indicator) in post #27 of this thread; it fixes a subtle synchronization problem, so anyone who is using the older version of that file should download the new version.

                        -Kevin

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        599 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        344 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        103 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        558 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        557 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X