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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      68 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      36 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      61 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X