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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      89 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X