Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicators plotting wrong values on ZB

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

    Indicators plotting wrong values on ZB

    Hi,
    I have noticed this weird problem with ZB, possible bug maybe in reading tick size,
    when I load indicators to the chart, I get wrong values plotted. (see attached screenshot)
    The value should have been somewhere between 137.00 to 137.01,
    Instead its showing a value of 137.02, which is wrong.
    Is this a known issue? how can this be fixed ?

    Thanks in advance,

    best regards

    Noam Barel
    Attached Files
    Last edited by NoamBarel; 09-23-2014, 06:02 AM.

    #2
    Hello Noam,

    Unfortunately this is as expected. Indicators reports decimal values while ZB price bars use fractional prices. The same applies for the ZN and ZF.

    There is no setting in NinjaTrader available that will plot indicator values in fractional prices.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Hi Jason,
      Thanks for your quick replay.

      So no solution in this case?

      Comment


        #4
        Unfortunately I am not aware of a way to have indicators plot fractional prices for futures such as ZB and ZN.

        You could calculate the fractional price manually - divide the decimal value by 0.03125.
        JasonNinjaTrader Customer Service

        Comment


          #5
          Well, actually that's a great solution.. I can manually code it.

          Thanks alot Jason !

          Comment


            #6
            You can use the following code and insert it after the properties region.


            Code:
            #region Miscellaneous
            
            public override string FormatPriceMarker(double price)
            {
                double trunc = Math.Truncate(price);
                int fraction = Convert.ToInt32(320 * Math.Abs(price - trunc) - 0.0001); // rounding down for ZF and ZT
                string priceMarker = "";
                if (TickSize == 0.03125) 
                {
                    fraction = fraction/10;
                    if (fraction < 10)
                        priceMarker = trunc.ToString() + "'0" + fraction.ToString();
                    else 
                        priceMarker = trunc.ToString() + "'" + fraction.ToString();
                }
                else if (TickSize == 0.015625 || TickSize == 0.0078125)
                {
                    if (fraction < 10)
                        priceMarker = trunc.ToString() + "'00" + fraction.ToString();
                    else if (fraction < 100)
                        priceMarker = trunc.ToString() + "'0" + fraction.ToString();
                    else    
                        priceMarker = trunc.ToString() + "'" + fraction.ToString();
                }
                else
                    priceMarker = price.ToString(Gui.Globals.GetTickFormatString(TickSize));
                return priceMarker;
            }        
            #endregion
            Your indicators should now work properly with bond futures, see chart below.
            Attached Files

            Comment


              #7
              Originally posted by NinjaTrader_Jason View Post
              Unfortunately I am not aware of a way to have indicators plot fractional prices for futures such as ZB and ZN.

              You could calculate the fractional price manually - divide the decimal value by 0.03125.
              The SessionPivots indicators in the download section also plot fractional prices for interest rate futures.

              Attached Files
              Last edited by Harry; 09-27-2014, 04:27 AM.

              Comment


                #8
                Thanks Harry !

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ETFVoyageur, 04-30-2024, 02:04 PM
                11 responses
                91 views
                0 likes
                Last Post ETFVoyageur  
                Started by bubblegum, 03-18-2024, 10:41 AM
                3 responses
                43 views
                0 likes
                Last Post vjsworld  
                Started by JamesK1, Today, 02:48 PM
                1 response
                10 views
                0 likes
                Last Post JamesK1
                by JamesK1
                 
                Started by llanqui, Today, 03:51 PM
                0 responses
                9 views
                0 likes
                Last Post llanqui
                by llanqui
                 
                Started by Quanto, 04-17-2024, 10:43 AM
                2 responses
                24 views
                0 likes
                Last Post Quanto
                by Quanto
                 
                Working...
                X