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 CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      52 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      29 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      194 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      355 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      274 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X