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.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Chart Price Markers for fractional instruments like ZB
Collapse
X
-
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.Tags: None
-
NinjaTrader_Eamon
-
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
Comment
-
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
Comment
-
-
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; }
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
10 responses
1,767 views
0 likes
|
Last Post
by Leafcutter
Today, 03:01 AM
|
||
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, 04-23-2024, 07:51 PM
|
2 responses
30 views
0 likes
|
Last Post
by Max238
Today, 02:25 AM
|
||
Started by Shansen, 08-30-2019, 10:18 PM
|
24 responses
943 views
0 likes
|
Last Post
by spwizard
Today, 01:29 AM
|
||
Started by Max238, Today, 01:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Max238
Today, 01:28 AM
|
||
Started by rocketman7, Today, 01:00 AM
|
0 responses
7 views
0 likes
|
Last Post
by rocketman7
Today, 01:00 AM
|
Comment