Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy with 2 instruments doesn't place orders

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

    Strategy with 2 instruments doesn't place orders

    I am trying to build a test strategy that places orders on 2 different instruments. When strategy places an order on the second instrument (with added data series), the first and second instrument orders stop working. I have attached the example strategy A1STest1.

    It is a modification of the included startegy SampleMACrossOver. It works as expected until the 2 lines under BarsInProgress==1 is uncommented.

    I have tested it with default data set = AAPL 1 Day. Strategy adds MSFT 1 Day.

    What am I doing wrong?
    Attached Files

    #2
    It looks like EntriesPerDirection has something to do with this issue. when set to 1, first expected appl trade is as expected but subsequent trades don't work. I increased it to 10 and both appl and msft trades worked as expected.

    How does EntriesPerDirection behave when there are multiple instruments traded within the same strategy?

    Comment


      #3
      Hello afshinmorhrefi,

      Thank you for your note.

      In a strategy with multiple instruments traded with EntriesPerDirection set to 1 and Entry methods omitting unique signal names, only 1 entry order total would be submitted.

      If you would like your strategy to place buy orders in two different markets/instruments, I would suggest uniquely naming each entry within the code.

      So within the code,
      EnterLong(0,1,"Buy AAPL"); //Where 0 is BIP, 1 is Quantity, and “Buy AAPL” is the signal name.
      EnterLong(1,1,"Buy MSFT");

      See EnterLong method section of our helpguide,


      Then, when applying the strategy, under Order Handling, set Entry Handling=Unique Entries and Entries Per Direction to how many times you want to allow the same order in the same direction to be submitted. For example Entries Per Direction set to 1, Entry Handling to Unique Entries and unique signal names above, would execute a long in both AAPL and MSFT.

      See EntriesPerDirection section of our helpguide,


      See EntryHandling section of our helpguide,


      Please let us know if you need further assistance.
      Alan P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      54 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      72 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X