Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

thread 'efficient Multi-Inst​rument strategy' removed for a wrong reason

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

    thread 'efficient Multi-Inst​rument strategy' removed for a wrong reason

    Hi NT

    I’ve noticed my thread 'efficient Multi-Inst​rument strategy' was removed today due to a spam response to my thread.Could you please make sure the thread is active again and shown as unanswered (I’m waiting for a response from NT community).

    I've sent a private message to administrator this morning but not sure if it went through.

    The last link that worked (not working now):



    Many thanks ionaz

    #2
    Hello ionaz,

    There was a Spam post that had to be removed but the whole thread was removed. We are looking into how this happened.

    I believe I saw the following that you responded back to:

    2. I'm going to deal with kinetick EOD data; my system is lenovo laptop with Intel core i5 2.6 GHz and 8Gb RAM. I guess there can only be a rough answer, but please let me know if this can be feasible.

    Kinetick - End of Day (Free) is only going to be historical data, so I would not imagine that you would have a problem with getting that many symbols. Real-Time data would be different.

    3. Sorry, so Global list is the one with ALL the trades made by the startegy across ALL the instruments. I need this list to be in place straigh after the backtest/optimisation ends. What I mean here, and what's critical for me, I don't want to work on compiling this list by clicking into each of 2000 stocks: copy trades of individual stock, paste them into excel & repeat this 2000 times manually. Would a Global list like I described be generated for me by NT?

    Thanks for the clarification. Yes, if you add all of the instruments into one strategy like the sample you will get this information all in one place.

    I will attach the sample one again.

    To Import
    1. Download the attached file to your desktop
    2. From the Control Center window select the menu File > Utilities > Import NinjaScript
    3. Select the downloaded file

    Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.
    Attached Files
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi JC

      Thanks for this

      There was more query in my last responce in the missing thread.
      Please see it attached.

      I look forward to the response.
      Attached Files

      Comment


        #4
        Hello ionaz,

        You would have to use the Add() method inside of your Strategy to add all of the instruments inside of your strategy that you would like just as in the SampleMultiInstrumentOrder.



        While it is not supported, you may try the following if you want to get an instrument list from this post.
        JCNinjaTrader Customer Service

        Comment


          #5
          Hi JC

          Thanks, I'm clear how to use Add() to add the instruments, my query was rather about HOW do I backtest such strategy = WHERE to click (what I need or do not need to select) to backtest it so that I get the list of trades I'm chaising for? As you may have noticed I have tried selecting a basket like DOW30 with your strategy attached, then clicking "backtest" as usual, but then I didn't see a list I need as a result. So my problem is how to backtest and get what I need, not how to add the instruments.

          Comment


            #6
            Hello ionaz,

            You would want to first make sure that you are connected to your data provider like Kinetick - End of Day (Free), and second is that you will want to change the "SampleMultiInstrumentOrder" strategy to add "Day" periods instead of "Minute".

            Code:
            Add("MSFT",PeriodType.Day, 1);
            Add("AAPL",PeriodType.Day, 1);
            Add("GOOG",PeriodType.Day, 1);
            Open up a Strategy Analyzer Window by going to File -> New -> Strategy Analyzer, select Backtest in the top toolbar indicated by the letter "b", select an instrument to start for example "IBM" from the DOW 30 Instrument List, select the strategy for this example "SampleMultiInstrumentOrders", set your variables (using the Kinetick - End of Day connection you will have to select daily or above), and then press Run Backtest.



            You should see results similar to this.
            Attached Files
            JCNinjaTrader Customer Service

            Comment


              #7
              Thansk a bunch JC!


              I finally saw the list of ALL trades I was so interested in. J
              • The only thing I don’t understand is why do I need to select IBM (or anything else) from the list in the backtest window before I can run a backtest of a strategy which has instruments of my interest already hardcoded in it (eg. MSFT, AAPL, GOOG).

              As per your suggestion, I also tried the batch import and liked it very much:
              Code:
              [FONT=Arial][COLOR=#282828][COLOR=#282828][FONT=Arial]NinjaTrader.Cbi.InstrumentList list = NinjaTrader.Cbi.InstrumentList.GetObject("DOW 30");[/FONT][/COLOR]
              [FONT=Arial][COLOR=#282828]foreach (Instrument i in list.Instruments) [/COLOR][/FONT]
              [COLOR=#282828][FONT=Arial]{[/FONT][/COLOR]
              [FONT=Arial][COLOR=#282828]Add(i.FullName, PeriodType.Day, 60);[/COLOR][/FONT]
              [FONT=Arial][COLOR=#282828]}[/COLOR][/FONT]
              [/COLOR][/FONT]

              A few more question I have
              1. When you showed me the thread with the code above, you said it is not supported. What do you mean by that exactly?
              2. Also, if I use this batch import method I wonder how do I reference individual stocks later in the code (ie under onbarupdate())?
              3. On the other hand, if I don’t want to reference individual stocks and rather apply the strategy logic to the whole DOW 30, isn't then the batch import method the best way to go?

              Comment


                #8
                Hello ionaz,

                1. Using a high level language like C#, almost anything is possible but it can require quite a bit of coding, knowledge, and time to accomplish this. With that said to keep our costs down, we only support a limited amount of NinjaScript. Our Support Forums is great to have other users input or experience so it can be shared as a whole like the following post that I sent you for some of the unsupported code.

                2. There are a few different ways depending on what you want to access. You may use something like BarsArray[] or Closes for example:




                3. You would have to add the stocks in one by one or create a loop to add all the ones you would like in. There is not supported batch way to import a list of stocks.
                JCNinjaTrader Customer Service

                Comment


                  #9
                  Hi JC

                  Thanks

                  3. You would have to add the stocks in one by one or create a loop to add all the ones you would like in. There is not supported batch way to import a list of stocks.
                  I didn't quite understand what you mean. So I this is what I mean by saying batch import of stocks (loop in your own words I guess), and think IT IS POSSIBLE:
                  Code:
                  [FONT=Arial][COLOR=#282828][COLOR=#282828][FONT=Arial]NinjaTrader.Cbi.InstrumentList list = NinjaTrader.Cbi.InstrumentList.GetObject("DOW 30");[/FONT][/COLOR][/COLOR][/FONT]
                  [FONT=Arial][COLOR=#282828][FONT=Arial][COLOR=#282828]foreach (Instrument i in list.Instruments) [/COLOR][/FONT][/COLOR][/FONT]
                  [FONT=Arial][COLOR=#282828][COLOR=#282828][FONT=Arial]{[/FONT][/COLOR][/COLOR][/FONT]
                  [FONT=Arial][COLOR=#282828][FONT=Arial][COLOR=#282828]Add(i.FullName, PeriodType.Day, 60);[/COLOR][/FONT][/COLOR][/FONT]
                  [FONT=Arial][COLOR=#282828][FONT=Arial][COLOR=#282828]}[/COLOR][/FONT][/COLOR][/FONT]
                  So just to clarify, this is what you meant by sayig loop is needed, correct?
                  By doing this I have also found that my strategy logic was successfully applied to all the stocks from DOW30 that met the strategy criteria.
                  Last edited by ionaz; 07-25-2013, 09:29 AM.

                  Comment


                    #10
                    Hello ionaz,

                    Correct, it is possible. This is something that we would not recommend as it is not supported, basically meaning that you may run into situations were it may not work properly or as expected.
                    JCNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by gbourque, Today, 06:39 AM
                    2 responses
                    14 views
                    0 likes
                    Last Post gbourque  
                    Started by rexsole, Today, 08:39 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post rexsole
                    by rexsole
                     
                    Started by trilliantrader, Yesterday, 03:01 PM
                    3 responses
                    31 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by cmtjoancolmenero, Yesterday, 03:58 PM
                    5 responses
                    26 views
                    0 likes
                    Last Post cmtjoancolmenero  
                    Started by Brevo, Today, 01:45 AM
                    1 response
                    14 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X