Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Instrument Issues

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

    Multi Instrument Issues

    Hello,

    I am running a multi instrument strategy. In this strategy I have two different instruments. One instrument has data that goes back at least 10 years. and a 2nd instrument only goes back 5 years. However, I'm noticing that the strategy will ignore the first 5 years of data from the 10 yr instrument -which is when the start date of 2nd instrument begins. Is there a way to correct this with additional code?

    2nd thing is I'm noticing is that the BarsSinceEntry command doesn't seem to work properly when given all of the proper overloads. Is there a know issue with this command in a Multi Instrument strategy? Thank you.

    Mr. Lee
    Last edited by ciro1963; 11-01-2017, 10:30 AM. Reason: grammatical errors

    #2
    Hello Mr. Lee,

    Thanks for the post.

    The Strategy will not work until all data series are loaded. There is no way to change this behavior.

    Could you please clarify specifically what problem you are having with BarsSinceEntry?

    I look forward to your reply.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Bars Since Entry Issue in Multi Instrument Mode

      Hello Chris,

      I've noticed that the bars since entry command does not reset to zero once a trade is made in multi-instrument mode. For instance it's my impression that the BarsSinceEntry(5,"BuyMkt5",0) command should return a 0 value (reset) for the BIP=5 instrument once shares are bought. As an example, I'm using the EnterLong(nShares,"BuyMkt5") command to purchase the instrument in the BIP 5 routine. To verify the issue, I'm printing to the output window and confirming that the values do not reset properly. Is there something wrong with the above overloads?


      It's not a show stopper since I was able to create my own counter which I reset to -1 when I buy and increment by 1 every pass. Just a curiosity of mine. Thanks.
      Last edited by ciro1963; 11-01-2017, 06:36 PM. Reason: grammar

      Comment


        #4
        Hello Mr.Lee,

        Thanks for the reply.

        I was able to confirm that BarsSinceEntry() works with both time series. Please see the example attached. I would have to look at your code to see that is going wrong. If you would like for me to look at your script please post it here or you can send it into platformsupport[at]ninjatrader[dot]com and paste this forum link in the body of the email.

        You can attach your indicator to your response by going to File > Utilities > Export NinjaScript > Export selected source files > select your Strategy > select the right arrow to add it to the list> Export. The file will be located under (My) Documents\NinjaTrader 7\bin\Custom\ExportNinjaScript.

        I look forward to hearing of your results.
        Attached Files
        Last edited by NinjaTrader_ChrisL; 11-02-2017, 02:15 PM. Reason: Attachment
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hello Chris,

          Yes I was able to find the issue.

          Question: Is there a limit to how many instruments one can use in a multi-instrument strategy before problems arise?

          I have about a dozen instruments in a strategy but none of the region variables are loading into the back tester GUI. the code does compile properly however.

          Mr. Lee

          Comment


            #6
            Hello Mr. Lee,

            Thanks for the follow up.

            The only limit to how much data a script can process is your CPU/RAM/internet speed, etc.

            Could you please post your "#region Properties" code so I can take a look?

            I look forward to your reply.
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by warreng86, 11-10-2020, 02:04 PM
            7 responses
            1,360 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Perr0Grande, Today, 08:16 PM
            0 responses
            5 views
            0 likes
            Last Post Perr0Grande  
            Started by elderan, Today, 08:03 PM
            0 responses
            9 views
            0 likes
            Last Post elderan
            by elderan
             
            Started by algospoke, Today, 06:40 PM
            0 responses
            10 views
            0 likes
            Last Post algospoke  
            Started by maybeimnotrader, Today, 05:46 PM
            0 responses
            14 views
            0 likes
            Last Post maybeimnotrader  
            Working...
            X