Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Halting a strategy

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

    Halting a strategy

    I would like to exit my strategy as soon as any order is filled and then let the stops manage the rest of the trade without the strategy running.

    Any ideas how to code a halt?

    Thanks,
    spikebuck77

    #2
    Welcome to our forums - here's a sample that would show how to programmatically halt a strategy to not process further OnBarUpdate() logic to trigger further entries - http://www.ninjatrader.com/support/f...ead.php?t=4804

    Comment


      #3
      I tried using the the SampleHaltBasicStrategy to see when it actually exits the program. I ran it all day and it continued to take new positions.

      Any idea how I can exit the strategy completely without manual intervention?

      Thanks again.

      Comment


        #4
        Unfortuantely you can't programmatically stop / disable the strategy instance or shutdown for example NT. The basic sample you ran would monitor strategy performance and exit ouf of the OnBarUpdate() logic if it either won 1000$ or lost 400$ - if this case was not hit in your testing, the strategy would continue to trade for sure.

        For a more advanced sample involving our event driven order management methods as well, please see the SampleHaltAdvancedStrategy offered on the same link.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        110 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        59 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        37 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        41 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        78 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X