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

Instrument vs Master instrument classes

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

    Instrument vs Master instrument classes

    What's the logical / conceptual relation between class Instrument and MasterInstrument ?

    Instrument contains: Exchange, Expiry, FullName, ...
    MasterInstrument contains: Exchanges, InstrumentType, Commission, ... many other

    I would like to understand, what's the intention/logic behind this composition...
    Last edited by misova; 05-23-2015, 03:54 AM.

    #2
    Hello misova,

    Thank you for your post.

    MasterInstrument is called from Instrument. Instrument is used to call the BarsArray we are using, Instrument alone is the primary, Instruments allows for the call of additional bar series added. MasterInstrument allows us to pull specifics on the instrument.

    Please let me know if you have any questions.

    Comment


      #3
      Thank you,
      if Isummarize it shortly:
      • Instruments property represent array of Instruments (and bars) added by Add(xxx) in the Initialize() method.
      • MasterInstrument encapsulates real details of the instrument like (eur/usd, gold, sp500, ...)

      Now, I understand the structure, that's ok


      But the conceptual relation of them is still not crystal clear... maybe good question could clarify this:
      • So for example could'nt we have just MasterInstrument(s) array in the strategy?
      • Why it needs to be wrapped into Instrument, when most useful information is in MasterInstrument?

      Comment


        #4
        Hello,

        Thank you for the reply.

        I will try and clear up the difference between the two here.

        Instrument is considered Instance of the instrument and inherits from the MasterInstrument.

        Here is a simple example to explain this:

        ES 06-15 and ES 03-15 are two Instruments, they have pulled their specific settings (TickSize, Session etc..) from the ES MasterInstrument.

        The two objects are needed as the type of instrument can be the same name but different contracts but still need the same settings. Rather than have these individual settings for each instrument or contract, a MasterInstrument is used to define settings that a group of instruments would use.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Great explanation!

          I understand this completely now.
          Thank you very much!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,607 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          9 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          19 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          6 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          16 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X