Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Closing a forex position with ExitLong()

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

    Closing a forex position with ExitLong()

    Hello, I was reading the Help on "Closing a Position or ATM Strategy", which talks about the benefit of the NT approach, but then adds the proviso: "The exception are currencies (FOREX) where all working orders are cancelled and then a market order is submitted to close the position."

    This makes me wonder: if I apply what the document is talking about to a generic NS order management strategy, it would seem that

    CancelOrder(myLimitSellOrder); ExitLong();

    is equivalent to just
    ExitLong()
    without the explicit cancel in all cases except in forex. But what I am uncertain of is whether the explicit cancel is still required when using NS to exit a position with a market order when a limit order is still pending. If NT already explicity closes all working orders and then resubmits a market order, why would I have to call CancelOrder() in NS explicitly?

    Am I interpreting the doc correctly?

    -Henry

    #2
    If you call ExitLong() and it closes the entire position, I beleive that the pending limit order will be cancelled. Please test this to confirm. Thanks.
    RayNinjaTrader Customer Service

    Comment


      #3
      If you don't explicitly cancel it the pending limit order should return something along the lines of "no matching exit" and cancel on its own.
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      12 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      7 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      6 views
      0 likes
      Last Post nandhumca  
      Started by The_Sec, Today, 03:37 PM
      0 responses
      3 views
      0 likes
      Last Post The_Sec
      by The_Sec
       
      Started by GwFutures1988, Today, 02:48 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Working...
      X