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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      64 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X