Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to create long and short orders at same time?

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

    How to create long and short orders at same time?

    I have a strategy where I am trying to submit both a long stop entry order and a short stop entry order at the same time:

    EnterLongStopMarket(0,true,Pos1Size, longEntryPrice, LONG_ENTRY_1_NAME);
    EnterShortStopMarket(0,true,Pos1Size, shortEntryPrice, SHORT_ENTRY_1_NAME);

    However, the long entry is submitted but the short entry is rejected.

    Please tell me the correct method to enter two simultaneous entry orders: a long above the market and a short below the market

    #2
    You need to use the Unmanaged Approach to do that.

    Comment


      #3
      Hello westofpluto,

      Thanks for your post.

      An Unmanaged example that demonstrates is attached. It is built in close relation to the SampleOnOrderUpdate strategy, so if you are not as familiar with that strategy and the concepts involved, I suggest reviewing that strategy first.

      SampleOnOrderUpdate - https://ninjatrader.com/support/help...and_onexec.htm

      We look forward to assisting.
      Attached Files

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X