Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Paul H.NinjaTrader Customer Service

    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 stafe, 04-15-2024, 08:34 PM
      11 responses
      57 views
      0 likes
      Last Post stafe
      by stafe
       
      Started by pechtri, 06-22-2023, 02:31 AM
      5 responses
      116 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Tim-c, Today, 03:54 AM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by FAQtrader, Today, 12:00 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by gnocchi, Today, 11:56 AM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Working...
      X