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 Mongo, Today, 11:05 AM
      0 responses
      1 view
      0 likes
      Last Post Mongo
      by Mongo
       
      Started by Tim-c, Today, 10:58 AM
      0 responses
      1 view
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by traderqz, Yesterday, 09:06 AM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_ThomasC  
      Started by f.saeidi, Today, 10:19 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by kujista, Today, 06:23 AM
      5 responses
      18 views
      0 likes
      Last Post kujista
      by kujista
       
      Working...
      X