Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using EnterLongStop and EnterShortStop

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

    Using EnterLongStop and EnterShortStop

    I have a simple breakout strategy that uses EnterLongStop and EnterShortStop, but they are not working as I was expecting. When I am short in the market and give an EnterLongStop() that does hit my stop price on the next bar, I was expecting that the short position would be closed and a new long position would be created. Is that correct? Right now it would seem that the EnterLongStop() is ignored and only fires off when the strategy is flat with no position.

    #2
    Hello,

    This may be due to one of the conditions leading up to the EnterLongStop, It is hard to say with little details. The expected action would be a reversal if you submit the opposite direction Entry order and it gets filled.

    Here is a simple example that would show reversals using Stop orders:

    Code:
    protected override void OnBarUpdate()
    {
         
          if (Position.MarketPosition == MarketPosition.Long)
          {
    	  EnterShortStop(Close[0] - 2 * TickSize);
          }
          if (Position.MarketPosition == MarketPosition.Short)
          {
    	  EnterLongStop(Close[0] + 2 * TickSize);
          }			
         if (Position.MarketPosition == MarketPosition.Flat)
          {
               EnterLongStop(Close[0] + 2 * TickSize);
          } 
    }
    You may try using the Output Window to see if any Ignore order messages are in there, also TraceOrders is very helpful for tracking down order issues.



    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      The expected action would be a reversal if you submit the opposite direction Entry order and it gets filled.
      Thanks, Jesse. I wanted to confirm that that was the expected action, so I'll dig into it further.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      630 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      566 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X