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

Saving indicator settings multiple workspaces

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

    Saving indicator settings multiple workspaces

    I have multiple workspaces that use the same custom indicator. How do I save each indicator's settings so that when I open the workspace they maintain the indicator settings?

    #2
    Hello habibalex,

    An indicator with properly serialized inputs will have all parameters saved with the workspace.

    Are you finding that you are setting parameters, saving the workspace, and then after closing and re-opening the workspace the parameters are different?

    Are you asking if indicator settings can be saved with a template to be applied to a new chart?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Are you finding that you are setting parameters, saving the workspace, and then after closing and re-opening the workspace the parameters are different?
      Yes

      These are the in the Properties section, is there a way I can check to make sure they are serialized correctly?

      Code:
      [XmlIgnore]
      		[Display( Name = "Scale", GroupName = "A settings",Description="Colors for bar.")]
              public float Scale{
      			get { return scale;}
      			set{ scale = value;}
      		}
      		
      		[XmlIgnore]
      		[Display( Name = "Use Outline", GroupName = "A settings",Description="Outlines everything.")]
              public bool UseOutline{get;set;}

      Comment


        #4
        I think I needed to see what this was, I kept looking for properties

        Comment


          #5
          Hello habibalex,

          I would expect the Scale float to be saved with the workspace but not the UseOutline bool which has XmlIgnore().

          Workspaces and templates are xml files. If XmlIgnore is used, these values will not be saved.

          May I confirm the Scale float value is not being saved?

          If yes, may I test this on my end?

          To export a NinjaTrader 8 NinjaScript do the following:
          1. Click Tools -> Export -> NinjaScript...
          2. Click the 'add' link -> check the box(es) for the script(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.



          The Browseable attribute prevents the input from showing in the Indicator property grid at all. Basically this will hide that input in the parameters window completely when set to false.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hi Chelsea, i just deleted the XMLIgnore statements and everything is saving properly. I have a few more settings that I will test after the market closes today.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bmartz, 03-12-2024, 06:12 AM
            5 responses
            33 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Started by Aviram Y, Today, 05:29 AM
            4 responses
            13 views
            0 likes
            Last Post Aviram Y  
            Started by algospoke, 04-17-2024, 06:40 PM
            3 responses
            28 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by gentlebenthebear, Today, 01:30 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by cls71, Today, 04:45 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X