Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Converting ZN prices from MarketData

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

    Converting ZN prices from MarketData

    Hi

    On the ZN, if I look at the charts or Time & Sales I can see prices like 122'075 which MarketData reports as 122.234375.

    I have a few questions about this:

    1 - Can I get MarketData to give me the abbreviated price?
    2 - If not - is there any standard method I can call to convert the price to the correct format?
    3 - In the case of number 2 - is there any way to recognise which symbols need to have this price formatting applied?

    Many thanks

    Pete

    #2
    Hi Pete, unfortunately you could not access the price in fractions - a forum member shared his custom code used to convert as needed which you might be able to use as well - http://www.ninjatrader.com/support/f...41&postcount=8

    To see what instruments need what formatting / conversion applied you could check their ticksizes directly with NinjaScript.

    Comment


      #3
      Thanks for that but I found a solution...

      Code:
      [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]
      [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (TickSize == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080].0625[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] || TickSize == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080].03125[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] || TickSize == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080].015625[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])
      {
      [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]thirtyTwos = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];
      }
      [/SIZE][/FONT][/SIZE][/FONT]
      and elsewhere....

      Code:
      [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]textPrice = Bars.Instrument.MasterInstrument.FormatPrice(thisPrice);
      [/SIZE][/FONT][/SIZE][/FONT]
      Thanks

      Pete

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      647 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X