Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Price marker format for T-Notes Futures Pivot Points

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

    Price marker format for T-Notes Futures Pivot Points

    I'm setting up chart for ZN with Pivots
    Looks like the pivot lines are at correct levels unfortunately values for price markers are not showing correct format. e.g. S2 line at 120'005 having price marker indicating 120.15625
    Is there any way to provide value in correct format?
    Any help/suggestions greatly appreciated.

    #2
    Hello soroka21,

    Welcome to the NinjaTrader Support Forums!

    These calculated (Pivot) values will be plotted using this standard decimal representation since the values are exact calculate outputs (not rounded). However, this type of indicator plot that you mention would be possible but would require custom programming in NinjaScript. Let me know if this is of interest & I can offer some helpful links to get you started.

    Please let me know if you have any additional questions.
    ChipNinjaTrader Customer Service

    Comment


      #3
      I have some programming experience. So, please, provide link

      Comment


        #4
        Hello soroka21,

        Here are some resource links for NinjaScript. NinjaScript is NinjaTrader's extension to the powerful Microsoft C# language. In addition to the core functionality of C# and the Microsoft .NET framework we have added features designed for the rapid implementation of custom indicators, automated trading systems and custom drawing. I have included some resources & links to help you get started.

        This link will take you to the NinjaScript section of our Help Guide:


        C# Method (Functions) Reference:


        Please feel free to join any of our Free educational webinars. You may be especially interested in one entitled “Automated Strategy Development I” – here is the detail:


        You can also register for our Free Support Forum. There is a large community of programmers & traders that you can share ideas with & ask questions. Just follow this link:


        NinjaScript File Sharing:


        NinjaScript Development Support:


        NinjaScript Educational Resources:


        If you have limited time or programming capabilities, you can discuss your requirements with any of our NinjaScript consultants.


        Please let me know if I can answer any additional questions.
        ChipNinjaTrader Customer Service

        Comment


          #5
          I think I found algorythmic solution - will post it and explanation as soon as I will finish coding.
          The only 2 questions I'm currently have are:
          1) Knowing the symbol e.g. ZN (for US 10 Y. T-notes future) is it possible to know what ticks are not decimal (tick format)? If I would know this I will apply my formatting only to the symbols (instruments) really requiring such formatting
          2) Is Price Marker for line some how accessible through the properties of the line so I can substitute decimal value with one representing appropriate ticks format?

          I was trying to find this in documentation but was not succesfull.

          Comment


            #6
            Hello soroka21,

            1) Unfortunately this is not exposed. By the time you have access to prices they are all double values. You may consider working with Round2TickSize() method to identify a specific size here.

            2) You can see here for the method on formatting price markers.
            Last edited by NinjaTrader_RyanM1; 12-20-2010, 05:30 PM.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Hello soroka21,

              I corrected my post above. There is option of using FormatPriceMarkers()
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Overriden FormatPriceMarker method is below. I'm using TickSize to distinguish between T-notes and other instruments.
                Code is only covering T-notes and must be changed for other "exotic" tick sizes.

                Code:
                 
                public override string FormatPriceMarker(double price)
                {
                double integerPart = Math.Floor(price);
                double fraction = price - integerPart;
                string priceMarker = "";
                // For T-notes
                if(TickSize == 0.015625) {
                priceMarker = integerPart.ToString() + "'" + Math.Round(((fraction / TickSize)*5)).ToString().PadLeft(3, '0');
                } else {
                priceMarker = price.ToString();
                }
                 
                return priceMarker;
                }

                Comment


                  #9
                  Thanks for sharing your code for this, soroka21.
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    FormatPriceMarkers() shifts the Y-Axis to the Left

                    Whenever I use public override string FormatPriceMarker() in an indicator, this shifts the Y-Axis to the Left.

                    There is an empty space created on the right side of the Y-Axis, see chart below. This empty space is independent from the code used. For example, the code

                    Code:
                    public override string FormatPriceMarker(double price)
                    {
                    	string priceMarker = price.ToString();
                    	return priceMarker;
                    }
                    shifts the y-axis to the left.

                    The amount shifted depends on the instrument. For bonds the shift is larger as opposed to other instruments. It seems that space reserved is the sum of the space required for the defined ticksize of the instrument and the space required for the newly defined format. Looks like a bug.
                    Attached Files
                    Last edited by Harry; 01-16-2011, 04:22 PM.

                    Comment


                      #11
                      Thank you for the report, Harry. We will look into this and reply tomorrow, Tuesday.
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_RyanM View Post
                        Thank you for the report, Harry. We will look into this and reply tomorrow, Tuesday.
                        Thank you for your answer. It is not a big problem, but it reduces the size of the chart without need. I'd rather have that space within my chart.

                        Comment


                          #13
                          Harry,

                          We are still looking into this here. I will edit this post once we finish investigating.
                          Last edited by NinjaTrader_RyanM1; 01-19-2011, 10:48 AM.
                          Ryan M.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks for the feedback.

                            Comment


                              #15
                              Hi Harry,

                              Updating here as this was found to be expected. Please see my previous reply.
                              Ryan M.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Mestor, 03-10-2023, 01:50 AM
                              16 responses
                              387 views
                              0 likes
                              Last Post z.franck  
                              Started by rtwave, 04-12-2024, 09:30 AM
                              4 responses
                              31 views
                              0 likes
                              Last Post rtwave
                              by rtwave
                               
                              Started by yertle, Yesterday, 08:38 AM
                              7 responses
                              29 views
                              0 likes
                              Last Post yertle
                              by yertle
                               
                              Started by bmartz, 03-12-2024, 06:12 AM
                              2 responses
                              22 views
                              0 likes
                              Last Post bmartz
                              by bmartz
                               
                              Started by funk10101, Today, 12:02 AM
                              0 responses
                              7 views
                              0 likes
                              Last Post funk10101  
                              Working...
                              X