Announcement

Collapse
No announcement yet.

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.

    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.

          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:	74
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?

              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.

                  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.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Mindset, 04-21-2026, 06:46 AM
                      0 responses
                      88 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by M4ndoo, 04-20-2026, 05:21 PM
                      0 responses
                      134 views
                      0 likes
                      Last Post M4ndoo
                      by M4ndoo
                       
                      Started by M4ndoo, 04-19-2026, 05:54 PM
                      0 responses
                      68 views
                      0 likes
                      Last Post M4ndoo
                      by M4ndoo
                       
                      Started by cmoran13, 04-16-2026, 01:02 PM
                      0 responses
                      119 views
                      0 likes
                      Last Post cmoran13  
                      Started by PaulMohn, 04-10-2026, 11:11 AM
                      0 responses
                      69 views
                      0 likes
                      Last Post PaulMohn  
                      Working...
                      X