Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    BertrandNinjaTrader Customer Service

    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 Haiasi, 04-25-2024, 06:53 PM
      2 responses
      16 views
      0 likes
      Last Post Massinisa  
      Started by Creamers, Today, 05:32 AM
      0 responses
      4 views
      0 likes
      Last Post Creamers  
      Started by Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,786 views
      0 likes
      Last Post Leafcutter  
      Started by poplagelu, Today, 05:00 AM
      0 responses
      3 views
      0 likes
      Last Post poplagelu  
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,407 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Working...
      X