Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Emulate "Close" button action in NT8 strategy script

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

    Emulate "Close" button action in NT8 strategy script

    I have a working strategy which makes entry/exit criteria and works fine for my taste however adding any kind of a stop-loss to the strategy, tends to stop me out more frequently that I would like. I have found the "attach to indicator" in NT8 quite useful however this places an order outside the strategy (and hence needs monitoring). I am wondering if there is a way I can emulate the "Close" button action from Chart Trader in an NT8 script, which essentially closes any open positions and cancels open orders - would like to call this from the exit conditions of my strategy.

    #2
    Hello WattMan,

    Yes, call CloseStrategy() to close the strategy.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello WattMan,

      Yes, call CloseStrategy() to close the strategy.
      https://ninjatrader.com/support/help...sestrategy.htm
      Hi Chelsea - calling CloseStrategy does not cancel any open/pending orders I added through "Attach to indicator" (e.g. stop market)

      Comment


        #4
        Hello WattMan,

        CloseStrategy will close any orders that were submitted by the strategy and then will disable the strategy.

        It will not close any manually submitted orders.

        If you want to close all orders, manual and strategy, you can use Account.Flatten().
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        47 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        23 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        33 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Working...
        X