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

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
      JimNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by PaulMohn, Today, 05:00 AM
      0 responses
      7 views
      0 likes
      Last Post PaulMohn  
      Started by ZenCortexAuCost, Today, 04:24 AM
      0 responses
      6 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by ZenCortexAuCost, Today, 04:22 AM
      0 responses
      3 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by SantoshXX, Today, 03:09 AM
      0 responses
      16 views
      0 likes
      Last Post SantoshXX  
      Started by DanielTynera, Today, 01:14 AM
      0 responses
      5 views
      0 likes
      Last Post DanielTynera  
      Working...
      X