Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Manually exiting an order

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

    Manually exiting an order

    Hi
    Is there an obvious way to exit an order in progress from a Ninjascript strategy?
    I don't want to always do it but may need to do so occasionally so I don't want any complicated code.
    If I disable the strategy can I close the order via chart trader?

    #2
    Hello IndieTrader,

    Thanks for your post.

    If you use the "Close" button on the chart trader, on the same instrument that the strategy is running on, it will issue an order to close the active position and will disable the strategy.

    Comment


      #3
      Thanks....but I've noticed that's only true when you enable the strategy right off the chart. If I enable it from the strategies panel the chart trader is inactive. Or am I missing something?

      Comment


        #4
        Hello IndieTrader,

        Thanks for your reply.

        If the strategy and the chart trader are on the same instrument and same account you should see orders placed by the strategy on the chart and clicking the chart trader close button will close the position and will disable the strategy on the strategies tab.

        Alternately, you could disable the strategy on the strategy tab then go to the position tab and right mouse click on the existing position and choose "close position" or the all-encompassing "Flatten everything".

        Reference: https://ninjatrader.com/support/help...itions_tab.htm


        Comment


          #5
          Thank you very much I've got it now

          Comment


            #6
            Hi im using IBKR paper trading account, im unable to close the trades using chart trader for some reason, please advise. attached imageClick image for larger version

Name:	Screenshot 2021-03-30 at 15.32.29.png
Views:	653
Size:	77.8 KB
ID:	1149198

            Comment


              #7
              Found the answer, the chart shows SIm1 account whereas im using IBKR paper trading account. so please ignore

              Comment


                #8
                Originally posted by NinjaTrader_PaulH View Post
                If you use the "Close" button on the chart trader, on the same instrument that the strategy is running on, it will issue an order to close the active position and will disable the strategy.
                So, what if I want to manually close the position, but NOT disable the strategy?

                Comment


                  #9
                  Hello NjTMatthew,


                  Thank you for your post.


                  This is not recommended as it could cause the overall account position to become unsynced based on the logic behind the strategy. Manually closing an order while the strategy is still waiting for the criteria to be met could result in an unexpected position.

                  More information on best practices can be found here:
                  • https://ninjatrader[dot]com/support/helpGuides/nt8/index[dot]html?running_a_ninjascript_strategy[dot]htm#HowToRunAninjascriptStrategyInAChart

                  Please let us know if there's anything else we can assist with.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  60 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  39 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  21 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  23 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  51 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X