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

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 techgetgame, Yesterday, 11:42 PM
      0 responses
      8 views
      0 likes
      Last Post techgetgame  
      Started by sephichapdson, Yesterday, 11:36 PM
      0 responses
      2 views
      0 likes
      Last Post sephichapdson  
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,615 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Yesterday, 05:56 PM
      0 responses
      10 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      20 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Working...
      X