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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        79 views
        0 likes
        Last Post PaulMohn  
        Working...
        X