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

indicator parameter with no parmeter

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

    indicator parameter with no parmeter

    I want to create a parameter in my indicator to specify the recent version of date update.

    ie:

    Latest Version: XXXXXXXXX

    Parameter Font size 12
    etc
    etc
    etc

    is there a way that I can place that within the parameter section?

    #2
    Hi ballboy11,

    I am not sure what exactly you mean, and where you are going with this but if you simply want a version number for your indicator, you can always create it as a read only property and it shows up in your property grid.

    I am not sure how Font size is relevant to Latest Version so I think I am misunderstanding what it is that you want to accomplish. If it is a complex property you are trying to create, simply put it in a class and apply the ExpandableObjectConverter to it. Hope this helps. Otherwise, more info is needed as to what exactly you wish to accomplish.

    Comment


      #3
      Hello ballboy11, and thanks Zeos6 for your helpful reply.

      I agree that a read only property would be the best way to accomplish what you would like to do in the Property Grid.

      We have a sample that describes how this can be done here: http://ninjatrader.com/support/forum...ad.php?t=97919

      If you have any questions on the sample, please don't hesitate to ask.
      JimNinjaTrader Customer Service

      Comment


        #4
        Thanks

        Thanks I got what I was looking for ALMOST but it does the trick.

        private String sVersion= "August 28. 1017";
        [NinjaScriptProperty]

        [Display(ResourceType = typeof(Custom.Resource), Name = "1.0.0.1", Order =1,GroupName = " Version")]
        public String Version
        {
        get { return bShowNews; }
        set {; }
        }

        I just would like to know how to get the textbox enabled = false;

        even if one tries to erase the date it re appears..

        I want to have a last updated version date in the parameter because the users ask the most useless questions sometimes

        Comment


          #5
          I still fail to understand why you don't simply make it a read only property. In your SetDefaults put

          Code:
          if (State == State.SetDefaults)
          {
               Indicator_Version = "3.1 | 28 August 2017";            // version number of indicator (read only)
          }
          And in your properties put

          Code:
          [ReadOnly(true), NinjaScriptProperty]
          [Display(ResourceType = typeof(Custom.Resource), Name = "Indicator Version", GroupName = "Parameters", Order = 99)]
          public string Indicator_Version
          { get; set; }
          The Order = 99 will put it at the bottom of your parameters group.

          This makes the version information appear as read only and you don't need to worry about tampering on the user's part.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GLFX005, Today, 03:23 AM
          0 responses
          1 view
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          11 views
          0 likes
          Last Post XXtrader  
          Started by Waxavi, Today, 02:10 AM
          0 responses
          6 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by TradeForge, Today, 02:09 AM
          0 responses
          14 views
          0 likes
          Last Post TradeForge  
          Started by Waxavi, Today, 02:00 AM
          0 responses
          3 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Working...
          X