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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X