• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy name disappeared

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

    Strategy name disappeared

    Hello

    I have been trying to make some very frequent changes in my script last night and at some point, the script name disappeared from the list of available strategies to apply to the chart, despite it being available in the Script Editor window.

    I've saved it with a different name, but I still can't see it in the list of available strategies to add to chart.

    As you see from attachment, I have in the following scripts in the editor: Divergence, Divergence5min, DivergenceArray, DivergenceList, DivergenceList5m, DivergenceSystem, but Divergence5min and DivergenceList5m are missing from the smaller window of scripts available to load on the chart.

    The script I modified a lot last night was DivergenceList5m, then after it vanished from the list of available strategies, I saved it as Divergence5min, but it is still missing.

    Restarting the platform did nothing to solve it.
    Attached Files
    Last edited by itrader46; 01-17-2020, 02:30 PM.

    #2
    Hello itrader46,

    Thank you for your note.

    First thing to do would be to check your log tab of the control center for any errors - do you see any errors being thrown by the missing indicators? If so, what is the text of the error(s)?

    The next thing to check would be the Name = "your strategy name"; line that should be at the top of State == State.Set Defaults in OnStateChange. Is this the same as the file name for each strategy? If not, modify it to be the same as the file name and recompile, then check the indicators list again.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      The name is fine - that's the first thing I checked.

      The Log shows the error: " Stratey 'DivergenceList5m': Error on calling 'OnStateChange' method: owner " and same error on Divergence5min

      There are no compiling errors, though.

      Comment


        #4
        Hello itrader46,

        Thank you for your reply.

        This would indicate you have an issue somewhere in OnStateChange that isn't allowing the strategies to even load fully in the Strategies window. Could you provide the full code you have for OnStateChange()?

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Please see the attachment
          Attached Files

          Comment


            #6
            Hello itrader46,

            Thank you for your reply.

            Looks like there's a lot going on in your OnStateChange code.

            From the error message, we know the error has to do with "owner". In looking at your code, it looks like you're trying to use Draw.VerticalLine() in State==State.SetDefaults.

            SetDefaults is always called when displaying objects in a UI list such as the Indicators dialogue window since temporary objects are created for the purpose of UI display. When you're in State.SetDefaults, there's no owner available for the Draw.VerticalLine() so you get an error and the Strategy fails to appear in the list. Remove that Draw.VerticalLine and recompile, then try again to see if it's in the list for you.

            I'd recommend keeping SetDefaults as lean as possible - you really just want to be setting default values for the strategy in there.

            Here's a link to our help guide on OnStateChange() that has information on what you should be focusing on in each state:
            https://ninjatrader.com/support/help...tatechange.htm

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Yes, I've got it in the meantime. I was trying to draw the line there out of despair, due to a bug in NT8 not allowing lines to be drawn on indicator panels generated by strategy script.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by borjanews, Yesterday, 06:13 PM
              2 responses
              11 views
              0 likes
              Last Post borjanews  
              Started by Austiner87, Yesterday, 04:58 PM
              1 response
              2 views
              0 likes
              Last Post NinjaTrader_ChrisSch  
              Started by Gerik, Today, 12:53 AM
              0 responses
              4 views
              0 likes
              Last Post Gerik
              by Gerik
               
              Started by teafortwo, Yesterday, 04:26 AM
              4 responses
              13 views
              0 likes
              Last Post bltdavid  
              Started by Austiner87, Yesterday, 05:13 PM
              0 responses
              2 views
              0 likes
              Last Post Austiner87  
              Working...
              X