Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterShort when in a long position

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

    EnterShort when in a long position

    If I'm in a long position, let's say with the default quantity of 1. Then my strategy submits a EnterShort order. Does NT automatically submit a sell order of 2?

    #2
    Hello several,

    Yes that will both close and reverse the position.

    Comment


      #3
      Thanks, I have a follow up question;

      I created a basic test:

      if (Close[0] >= Open[0])
      {
      EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Low[0] - (20 * TickSize)) , @"myLong");
      }

      // Set 2
      if (Close[0] < Open[0])
      {
      EnterShortLimit(Convert.ToInt32(DefaultQuantity), (High[0] + (20 * TickSize)) , @"myShort");
      }​

      In this instance, I would expect a green bar to submit a limit order long, and a red bar to submit a limit order short. What happens is that once a green bar finishes, a long limit order is indeed submitted. Then I would expect if the next bar is red, a short limit order is submitted. But that doesn't happen. Instead the Long limit order is cancelled, but no short order is submitted.

      If the next bar is red, then a short order is submitted. But why does it need 1 bar in between each order?

      Comment


        #4
        Hello several,

        That would be expected, those are non live until cancelled orders meaning they will last for 1 bar if you don't call the order method again.You also cant reverse using limit orders in the same was as market orders, to do a reversal immediately you would need to use market orders.

        Comment


          #5
          I had this issue some days ago... here is the explanation and how I solved it: https://forum.ninjatrader.com/forum/...get-not-woking

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          87 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          128 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          65 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          117 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          67 views
          0 likes
          Last Post PaulMohn  
          Working...
          X