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

multi instrument add question

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

    multi instrument add question

    Hi all,

    I have a multi instrument indicator and strategy - I want to call Add() and have the period type and period be the same as the Primary Bars.

    I need to call Add() in the initialize section but I can see from the docs that BarsPeriod should not be accessed in the initialize section.

    Is there a way to do this?

    Onn

    #2
    Hi Onn, unfortunately we could support dynamic call of Add(). You could pass in a user input though and set as needed from the UI.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Just to confirm I understand correctly Add can only be called from within Initialize?
      Also, I understand that Initialize is called after the properties dialog is shown to the user?

      Onn

      Comment


        #4
        Hello Onn,

        That is correct on both counts.
        JCNinjaTrader Customer Service

        Comment


          #5
          More on this topic

          Can I access the instrument name in the Initialize method?
          If yes, Instrument.FullName would be the name to pass into Add()?

          Comment


            #6
            Hello Onn,

            Yes, you can access the Instrument.FullName inside of the Initialize() method.

            Using the Add() method one of the overloads you can add another bars object from the Primary Instrument so you would not need to pass the FullName of the instrument to it.

            Add(PeriodType periodType, int period)

            JCNinjaTrader Customer Service

            Comment


              #7
              sweet - thanks!

              Comment


                #8
                I need to create a drop down list of instruments for the user; instruments from this list will be used to call Add(). Is it possible to retrieve one of the NT instrument lists (like the default list)?

                I saw that there is an Instruments object - is that the list of instruments that I added to the chart?

                Comment


                  #9
                  Hello Onnb1,

                  While we would not be able to support an Instrument drop down menu list for example the "Default" list like inside the chart.

                  Here are two different examples that may try, but note dynamically selecting an instrument would still but no supported by us.

                  MA Cross Builder has an selectable MA type that you can use as a reference for a drop down menu list.


                  Spread indicator takes a user defined string for an Instrument name.
                  JCNinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_JC View Post
                    Hello Onnb1,

                    While we would not be able to support an Instrument drop down menu list for example the "Default" list like inside the chart.

                    Here are two different examples that may try, but note dynamically selecting an instrument would still but no supported by us.

                    MA Cross Builder has an selectable MA type that you can use as a reference for a drop down menu list.


                    Spread indicator takes a user defined string for an Instrument name.
                    http://www.ninjatrader.com/support/f...d=4&linkid=367
                    Thanks for these.
                    Is there an unsupported/undocumented object through which I can access the instrument list?

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by futtrader, Today, 01:16 PM
                    0 responses
                    4 views
                    0 likes
                    Last Post futtrader  
                    Started by Segwin, 05-07-2018, 02:15 PM
                    14 responses
                    1,789 views
                    0 likes
                    Last Post aligator  
                    Started by Jimmyk, 01-26-2018, 05:19 AM
                    6 responses
                    838 views
                    0 likes
                    Last Post emuns
                    by emuns
                     
                    Started by jxs_xrj, 01-12-2020, 09:49 AM
                    6 responses
                    3,294 views
                    1 like
                    Last Post jgualdronc  
                    Started by Touch-Ups, Today, 10:36 AM
                    0 responses
                    13 views
                    0 likes
                    Last Post Touch-Ups  
                    Working...
                    X