• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Price Markers for fractional instruments like ZB

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

  • Jim W.
    started a topic Chart Price Markers for fractional instruments like ZB

    Chart Price Markers for fractional instruments like ZB

    The 30 Year U.S. Treasury Bonds Futures (ZB) instrument's prices are in 32nds and 1/2 of 1/32. Charting ZB shows a price axis displayed with the format xxx'xxx, which is correct. Price Markers for price data and the cursor are also displayed as xxx'xxx. However, Price Markers from Indicators are always displayed as xxx.xxxxxx.

    Please change Indicator Price Markers to display as xxx'xxx when they are the decimal equivalent of 32nds and xxx.xxxxxx when they are not.

  • pppatil
    replied
    Please add below code in the class of your indicator. This will fix price markers issues with bond futures.

    Code:
    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;
    }

    Leave a comment:


  • NinjaTrader_Jason
    replied
    Hello dwt__,

    Unfortunately there is no change in this regard.

    Leave a comment:


  • dwt__
    replied
    Originally posted by NinjaTrader_Jason View Post
    Unfortunately fractional prices for the ZB will not be supported in NinjaTrader 7.
    Any update on this? Change of heart, perhaps?

    Regards.

    dwt

    Leave a comment:


  • dwt__
    replied
    Originally posted by NinjaTrader_Jason View Post
    Unfortunately fractional prices for the ZB will not be supported in NinjaTrader 7.
    Agree that it's unfortunate.

    Oddly, even the fib tool "gets" 32nd's and 1/2 32nd's.

    Guess we'll need to use jh1962's kludge until NT gets it right.

    dwt

    Leave a comment:


  • jh1962
    replied
    What works for me

    When calculating an indicator for bonds, the raw value (i.e. with ZB at 119^05 the value would be 119.15625) works fine, but it is inelegant for display purposes. So I simply use this when I Print() or DrawText() and it suits me.

    Where x = Bond Price

    System.Math.Floor(x) + "^" + ((x - System.Math.Floor(x))*32).ToString("00")

    Comes out as

    119^05

    Leave a comment:


  • NinjaTrader_Jason
    replied
    Unfortunately fractional prices for the ZB will not be supported in NinjaTrader 7.

    Leave a comment:


  • billitin
    replied
    To raise this question again, will fractional prices be supported in NT 7? I have to duplicate and then modify every single system indicator I am using by hand which is quite annoying.

    Leave a comment:


  • NinjaTrader_Jessica
    replied
    Thank you for the additional comments.

    Leave a comment:


  • AgeKay
    replied
    I second both suggestions. I would like to add that you should also be able to specify the number of decimals after the comma of prices and indicator values that are displayed in the decimal format. Right now it's only 2 decimals.

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    Thanks for the suggestions. We will put them on the list of future considerations.

    Leave a comment:


  • clearpicks
    replied
    I would like to suggest NT provide both options ( xxx'xxx and xxx.xxxx ) for the price labels on y-axis (both prices and indicators). I get more used to the format xxx.xxxx for all instruments so that I can easily add/substract 0.5 or 1 point from some points on ZN, ZB, etc. chart to calculate R/S lines. Perhaps there are some other traders who prefer xxx.xxxx format as I do.

    - Clearpicks

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Hi Jim,

    Thank you for your suggestion. I will forward on to our development team.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by akuntysh, Today, 02:43 AM
0 responses
4 views
0 likes
Last Post akuntysh  
Started by thgamey, Today, 02:05 AM
0 responses
7 views
0 likes
Last Post thgamey
by thgamey
 
Started by tpdk2012, Today, 12:51 AM
1 response
11 views
0 likes
Last Post NinjaTrader_ChrisSch  
Started by simonerg, Today, 12:13 AM
0 responses
8 views
0 likes
Last Post simonerg  
Started by rickyblah12, 07-20-2019, 01:01 PM
2 responses
24 views
0 likes
Last Post NinjaTrader_ChrisSch  
Working...
X