Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Terminated

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

    Strategy Terminated

    Hello,

    I am trying to run a strategy on my chart, but after clicking "OK" in the strategy window, nothing happens. My strategy simply prints the state it is currently in (i.e. SetDefaults, Configure, Active, etc). In fact, I copied the SampleMACrossOver strategy and added a single unconditional line Print(State) inside of the OnStateChange() event handler. I can see that it goes through SetDefaults, Terminated, and Configure just fine, but after clicking "OK" in the strategy configuration window, the strategy shows "Terminated" four times in the output window and then (obviously) does nothing. I also added a single unconditional line Print("Bar Update") to the OnBarUpdate() event handler, and it is never called --which verifies that the strategy is indeed terminated.

    I am using NT8 and I do have chart trading disabled (Set to "Off", not hidden) so I am very confused why I'm having so much trouble getting a sample strategy to run properly. Your input is much appreciated.

    Thank you!

    jflaggs
    Attached Files

    #2
    Hello jflaggs,

    Thanks for your post and welcome to the NinjaTrader forums!

    As a general guide, if you apply a strategy and it does not operate as expected, check the strategy name on the chart in the upper left corner, if it shows (D) in front of the name the strategy is or has become disabled. Another check is to examine the "Log" tab of the control center to see if any error messages are shown from run time type errors that would disable the strategy.

    I downloaded and ran your script without any issues. In NT8 you can run the strategy on the chart with the chart trader enabled.

    Please make sure that you check the "enable" check box in the strategy parameters before clicking the OK button.

    Comment


      #3
      Ah, rookie mistake, indeed! I didn't realize there is a log to show messages like this. Turns out that the strategy you downloaded was never enabled in my platform. My custom strategy has data loading issue that causes it to be immediately disabled. Thank you for the help, Paul!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      44 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X