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, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X