Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to code the termination of an unmanaged strategy

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

    How to code the termination of an unmanaged strategy

    Hi,

    I know how to code the canceling of orders. I know how to code the closing of positions. How do I actually terminate/disable the strategy using code???

    Thanks,

    #2
    Hello jm_test19,

    You can use CloseStrategy()

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
    JesseNinjaTrader Customer Service

    Comment


      #3
      I tried that it didn't seem to work. I asked DeepSeek and it said I should use "SetState(State.Terminated);" as "CloseStrategy()" doesn't work on strategies where orders are unmanaged.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Pointtoni, Yesterday, 11:41 PM
      0 responses
      7 views
      0 likes
      Last Post Pointtoni  
      Started by DayTradingDEMON, Yesterday, 02:10 PM
      2 responses
      20 views
      0 likes
      Last Post DayTradingDEMON  
      Started by Marble, 03-20-2025, 05:00 AM
      7 responses
      34 views
      0 likes
      Last Post Marble
      by Marble
       
      Started by laketrader, 03-10-2025, 07:20 AM
      6 responses
      59 views
      0 likes
      Last Post laketrader  
      Started by clintonbullocks15, Yesterday, 07:47 PM
      0 responses
      5 views
      0 likes
      Last Post clintonbullocks15  
      Working...
      X