Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instruments/Symbols for different datafeeds...

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

    Instruments/Symbols for different datafeeds...

    I'm currently developing an indicator which needs to do a SizeF() on a string to determine height/width etc. The function needs to know what "Instrument" is being used. For instance, I'm using Zen-Fire, and I'm familiar with the "symbols" like ES, ZB, for S&P, and Bonds, but for other datafeeds these symbols may be different. Is there a "master list" somewhere or a C#/NinjaScript function that can grab a list from the "connected datafeed" at runtime? so I may "map" my indicator according to what feed, etc?

    #2
    funk101, you can take a look at the instrument class for this - http://www.ninjatrader-support.com/H...mentClass.html

    However, there should be no need to access a datafeed specific symbol for your products in NinjaScript, as the needed datafeed mapping is setup for each connectivity provider in the Instrument Manager.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Ok, well let me give you an example...

      When I call GetCurrentBid() on ES it returns ie: 858.xx . If I call it on ZB(zenfire bonds), I get:
      123.xxxxx when I really want 123'xxx. In order to get that result, I have to do a conditional like such:

      if (Instrument.MasterInstrument.Name == "ZN" ||
      Instrument.MasterInstrument.Name == "ZB" ||
      Instrument.MasterInstrument.Name == "ZT")
      {
      bid = String.Format("{0}'{1:000}", Math.Truncate(GetCurrentBid()), (GetCurrentBid() - Math.Truncate(GetCurrentBid())) * 320);
      ask = String.Format("{0}'{1:000}", Math.Truncate(GetCurrentAsk()), (GetCurrentAsk() - Math.Truncate(GetCurrentAsk())) * 320);
      }
      else
      {
      bid = GetCurrentBid().ToString(sizeFormat);
      ask = GetCurrentAsk().ToString(sizeFormat);
      }

      Now, what I'm asking is, is there a master list somewhere, or some runtime way of getting the possible symbol values from the "detected" datafeed so I don't have to "hard-code" each potential symbol?

      Comment


        #4
        Thanks funk101, unfortunately not.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        3 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        238 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        4 views
        0 likes
        Last Post oviejo
        by oviejo
         
        Started by pechtri, 06-22-2023, 02:31 AM
        10 responses
        125 views
        0 likes
        Last Post Leeroy_Jenkins  
        Working...
        X