Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with ninjascript

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

    Problem with ninjascript

    Hi,

    I wrote the code for a strategy in ninjascript editor, and it compiled correctly, but now that strategy doesn't appear in the list of strategies in strategy analyzer or in the charts themselves. What could be the cause?

    #2
    Hello Carlos19,

    Thank you for your post.

    If your strategies are not showing up in the drop-down list of strategies of the analyzer then that suggests there is an issue with the strategies themselves. Specifically, there is likely an error in OnStateChange().

    Keep in mind that while it may compile successfully, the compiler cannot check "run time" logic errors, which can only occur when you run (or load) the strategy.

    A good first step here is to check the "Log" tab of the Ninjatrader Control center and look for any errors related to the strategies as if there is a run time error is would show in the log tab.

    If there are no log errors, check (in the Ninjascript editor open each strategy) to see if the strategies have the same name (IE you made a copy of the strategy and made your changes but unintentionally left the name the same as an existing one).

    In general, you want the filename of the strategy (this is what Ninjascript editor uses to open the script) to be the same as the public class name and most importantly that inside OnStateChange and within State.SetDefaults, the Name = field (This is what the drop-down or strategy selector uses) shows the same name as the public class name.​

    Please let me know if you need further assistance.

    Comment


      #3
      Indeed, the public class name was a different one. Fixed. Thanks a lot for the help Gaby!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      19 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      119 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      63 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      45 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X