Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exiting position

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

    Exiting position

    Hi,

    If im using,

    pEntry = EnterShortLimit(0,true, 1, hPiv - entryAllowance * TickSize, "pEntry");

    to enter a position and once executed a stop order is placed,

    pStop = ExitShortStop(0, true, execution.Order.Filled, hPiv + stop * TickSize, "Stop of Short", "pEntry");

    If I want to liquidate the position at a certain time before close can I just use,

    ExitLong("pEntry");

    and if so do I need to take-care of the stop order or will it automaticly get cancelled?

    #2
    Originally posted by GKonheiser View Post
    Hi,

    If im using,

    pEntry = EnterShortLimit(0,true, 1, hPiv - entryAllowance * TickSize, "pEntry");

    to enter a position and once executed a stop order is placed,

    pStop = ExitShortStop(0, true, execution.Order.Filled, hPiv + stop * TickSize, "Stop of Short", "pEntry");

    If I want to liquidate the position at a certain time before close can I just use,

    ExitLong("pEntry");

    and if so do I need to take-care of the stop order or will it automaticly get cancelled?
    Just exit. NT will take care of removing the attached StopOrder.

    Comment


      #3
      Hi GKonheiser,

      An exit should work ok. There may be times that both exits try and exit at the same time. If that happens, change the code so that the first stop exit order is cancelled first, and in the order update when its cancelled send the exit market order.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      656 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      371 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      579 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X