Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Long/Short

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

    Long/Short

    Hello,
    Is it possible to EnterLong and short at the same time with the same instrument if some conditions are met?
    I tried:
    if (myconditions)
    EnterLong

    if(myconditions)
    EnterShort

    But it didn't worked. Any idea?

    Thanks

    Daniel

    #2
    Hello,

    When using the Managed approach, you will not be able to go long and short at the same time.

    However you can accomplish this by using the unmanaged order types from your code. Please see our Help Guide article on this subject for more information:

    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by dvercher View Post
      Hello,
      Is it possible to EnterLong and short at the same time with the same instrument if some conditions are met?
      I tried:
      if (myconditions)
      EnterLong

      if(myconditions)
      EnterShort

      But it didn't worked. Any idea?

      Thanks

      Daniel
      No matter the method you use, that is physically impossible in the same account. The second order will always act to cancel the first. In the same account, a short order received when in a long position will always act to reduce/reverse the long position and vice-versa.

      In the particular code that you wrote, as you have no protective orders on your entries, your code will in all case act to reverse you on the next tick.

      Comment


        #4
        What about if I have protective orders? If the long/short orders are at the same time, do they cancel themselves automatically?

        So, no way of doing this?

        Thanks

        Daniel

        Comment


          #5
          Originally posted by dvercher View Post
          What about if I have protective orders? If the long/short orders are at the same time, do they cancel themselves automatically?

          So, no way of doing this?

          Thanks

          Daniel
          That is a very different, uglier can of worms. We went through that in this thread, among others.

          ref: http://www.ninjatrader.com/support/f...42666#poststop

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          647 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X