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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        59 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X