Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy compiles with no errors but does not show up

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

    Strategy compiles with no errors but does not show up

    Strategy compiles with no errors but does not show up in strategy selector on the chart nor in the control center. any ideas what would cause this?

    #2
    Hello Skizz,

    Thank you for your post.

    If your strategies are not showing up in the list of Available strategies 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 us know if you need further assistance. ​

    Comment


      #3
      I looked in the logs and there is no mention of the strategy or any strategy. This is the only script I have active but I checked through the inactive ones and still no name conflicts. anything else I could try?

      Comment


        #4
        Hello Skizz,

        Does the filename of the strategy match the public class name?

        In OnStateChange and within State.SetDefaults, does the Name = field (This is what the drop-down or strategy selector uses) match the public class name?​

        Comment


          #5
          Does the filename of the strategy match the public class name?​ Yes
          In OnStateChange and within State.SetDefaults, does the Name = field (This is what the drop-down or strategy selector uses) match the public class name?​​ yes I have double checked both before answering.

          9/13/2024 1:46:19 PM,Default,Unhandled exception: Unable to cast object of type 'System.Object' to type 'NinjaTrader.Gui.NinjaScript.StrategyRenderBase'., I deleted all strategies and re made the strategy and got this

          Comment


            #6
            ok... i took all the indicators off my chart, then put them all back on exactly how it was... and now its working... I have no idea why or how either

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            43 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            21 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            30 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            50 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            40 views
            0 likes
            Last Post CarlTrading  
            Working...
            X