• 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

Indicators not Saving to charts on workspaces and chart templates

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

    Indicators not Saving to charts on workspaces and chart templates

    I have two custom indicators that will not save to chart templates or to charts on saved workspaces. Every time I load a workspace, I must manually apply these indicators. When I apply a chart template that containes these indicators, they do not appear on the chart. I have tried rebuilding workspaces with new charts and bui8lding new chart templates without success. When I manually apply these indicators they work correctly. I have several other custom indicators with do not behave this way, just only these two.

    Any suggestions on what I might have coded incorrectly?

    #2
    Hello MarthaClines,

    The most common reason is improperly serialized public objects.

    Are you seeing any errors appear in the Log tab of the Control Center when attempting to save the template or workspace?

    May I test an export of your script?

    To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
    1. Click Tools -> Export -> NinjaScript...
    2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
    3. Click the 'Export' button
    4. Enter a unique name for the file in the value for 'File name:'
    5. Choose a save location -> click Save
    6. Click OK to clear the export location message
    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
    Below is a link to the help guide on Exporting NinjaScripts.
    http://ninjatrader.com/support/helpG...-us/export.htm
    Last edited by NinjaTrader_ChelseaB; 04-15-2019, 10:49 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello MarthaClines,

      The most common reason is improperly serialized public objects.

      Are you seeing any errors appear in the Log tab of the Control Center when attempting to save the template or workspace?

      May I test an export of your script?

      o export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
      1. Click Tools -> Export -> NinjaScript...
      2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
      3. Click the 'Export' button
      4. Enter a unique name for the file in the value for 'File name:'
      5. Choose a save location -> click Save
      6. Click OK to clear the export location message
      By default your exported file will be in the following location:
      • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
      Below is a link to the help guide on Exporting NinjaScripts.
      http://ninjatrader.com/support/helpG...-us/export.htm
      I received an email from Patrick that was in response to some questions from Chris on another issues that they are working on. I have attacked my workspaces, and all my custom indicators to that email. The subject of the email to platform support is Re: ATTN CHRIS S 2122296 2127361, and it outlines the two indicators that will not save to workspaces or chart templates. I really don't want to upload these indicators here for public viewing.

      Thanks

      Comment


        #4
        Hello MarthaClines,

        Does this confirm that there are no errors in the Log tab of the Control Center when saving a template?

        If the script cannot be posted publicly, can you copy the script and then remove the logic from OnBarUpdate() to reduce the script and post the reduced version?

        A reduced version of the script that can reproduce is always preferable. Reducing the script will often highlight the code causing the issue.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello MarthaClines,

          Does this confirm that there are no errors in the Log tab of the Control Center when saving a template?

          If the script cannot be posted publicly, can you copy the script and then remove the logic from OnBarUpdate() to reduce the script and post the reduced version?

          A reduced version of the script that can reproduce is always preferable. Reducing the script will often highlight the code causing the issue.
          The attached script is one of two with this problem. They will not have to workspaces or chart templates, but rathe must manually be loaded to each chart on each work station each time NT is started.

          I relay cant post the other. I am hoping the problem will be the same in both.

          Attached Files

          Comment


            #6
            Hello MarthaClines,

            Does this confirm that there are no errors in the Log tab of the Control Center when saving a template?

            I would expect this script you have provided to cause errors.

            This script cannot be serialized in a workspace or template because the attribute tags are not correct.

            If you want public inputs to be in the parameters window these must be using [NinjaScriptProperty].
            https://ninjatrader.com/support/help...yattribute.htm

            You cannot serialize a brush and this must be using the [XmlIgnore()] attribute. You must have a separate input that converts this to a string.

            Below is a public link to the help guide.
            https://ninjatrader.com/support/help...definedbrushes

            Are you 100% there are no xml errors appearing in the Log?


            I recommend that you create the shell of these scripts with the Strategy Builder so that it constructs the frame and inputs for you so these are properly serialized. Then add the logic after.

            Below is a link to a forum post with helpful information about getting started with NinjaScript.
            https://ninjatrader.com/support/foru...040#post786040

            The public double values should be using the Range attribute.
            https://ninjatrader.com/support/help...eattribute.htm

            Last, this is not as important, but you are using ResourceType = typeof(Custom.Resource) in the Display attribute. This likely won't hurt anything, but I am doubtful you actually have a resource dictionary that these values are supposed to pull from.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7

              Hello mopa4000,

              I'm not quite sure I understand. Do you have a question I may assist with?
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by oscsoft, Today, 07:07 PM
              0 responses
              6 views
              0 likes
              Last Post oscsoft
              by oscsoft
               
              Started by PanicTrades, Today, 07:01 PM
              0 responses
              13 views
              0 likes
              Last Post PanicTrades  
              Started by dedouglas, Today, 03:38 PM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_ShawnB  
              Started by aligator, Today, 03:20 PM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by aramtrader, Today, 03:05 PM
              2 responses
              17 views
              0 likes
              Last Post aramtrader  
              Working...
              X