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

Sample using Multi-Instruments in strategy

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

    #16
    Hello MGHORBEL,

    Please try using 4 as the entries per direction when you apply the strategy or using UniqueEntries for the EntryHandling mode. If you are trading multiple entries in the same direction you will need to increase the entries per direction to match what you want to allow.
    JesseNinjaTrader Customer Service

    Comment


      #17
      Hello Jesse
      I added as you recommended but nothing changes.
      I tested the code on another connection and it works.

      Comment


        #18
        The code used is in the attached file.
        Attached Files

        Comment


          #19
          Hello MGHORBEL,

          I am not certain I follow, you mentioned that you now see the code working are you just sharing what you used or did you still have a question? The code provided works for me to produce 4 entries for the 4 instruments being used.
          JesseNinjaTrader Customer Service

          Comment


            #20
            Hello Jesse

            I used shared file on my PC, it doesn't work.

            I tried a web server and it works well.

            I don't know why but it works

            Click image for larger version

Name:	image.png
Views:	21
Size:	55.8 KB
ID:	1294649
            Last edited by MGHORBEL; 03-07-2024, 07:50 AM.

            Comment


              #21
              Hello MGHORBEL,

              Are you using the same version of NinjaTrader and the same connection on both PC's?
              JesseNinjaTrader Customer Service

              Comment


                #22
                Yes I use the same version of NinjaTrader and the same connection on both PC's. The connection is not used in same time.

                Click image for larger version  Name:	image.png Views:	0 Size:	15.9 KB ID:	1294724
                Last edited by MGHORBEL; 03-07-2024, 11:15 AM.

                Comment


                  #23
                  Hello MGHORBEL,

                  Are you doing the exact same test with the same primary instrument being used? If any of the series are duplicated meaning if you use a primary that is also being added as secondary that will change how the Positions collection reports, you would need 4 different instruments for that test to show a position on each bars in progress.
                  JesseNinjaTrader Customer Service

                  Comment


                    #24
                    Hello Jesse
                    I performed the exact same test with the same main instrument used.
                    I used 4 different instruments.​

                    Comment


                      #25
                      Hello MGHORBEL,

                      In that case I would not be certain what would cause a difference, the code that was provided is working correctly when I test it on my end. You can try using TraceOrders to check if the orders are being ignored for some reason.

                      JesseNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by port119, Today, 02:43 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post port119
                      by port119
                       
                      Started by Philippe56140, Today, 02:35 PM
                      0 responses
                      2 views
                      0 likes
                      Last Post Philippe56140  
                      Started by 00nevest, Today, 02:27 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post 00nevest  
                      Started by Jonafare, 12-06-2012, 03:48 PM
                      5 responses
                      3,986 views
                      0 likes
                      Last Post rene69851  
                      Started by Fitspressorest, Today, 01:38 PM
                      0 responses
                      2 views
                      0 likes
                      Last Post Fitspressorest  
                      Working...
                      X