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 Sparkyboy, Today, 10:57 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by swestendorf, Today, 11:14 AM
      1 response
      2 views
      0 likes
      Last Post swestendorf  
      Started by TheMarlin801, 10-13-2020, 01:40 AM
      21 responses
      3,917 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by timmbbo, 07-05-2023, 10:21 PM
      3 responses
      156 views
      0 likes
      Last Post grayfrog  
      Started by Lumbeezl, 01-11-2022, 06:50 PM
      30 responses
      812 views
      1 like
      Last Post grayfrog  
      Working...
      X