Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 Documentation Request - Attributes, Properties, NinjaScriptProperty

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

    NT8 Documentation Request - Attributes, Properties, NinjaScriptProperty

    It would be really helpful to have some documentation regarding all the annotations and syntax for indicator and strategy parameters. There is a big change in this area compared to NT7, yet I could not find any documentation, and it is coming down to looking at existing NinjaScript for examples and a lot of trial and error to reverse engineer this information.

    In case I am not making myself clear, here are some examples of what I mean:

    Code:
            [Range(0, 100)]
            [Display(ResourceType = typeof(Custom.Resource), Name = "NinjaScriptDrawingToolAreaOpacity", GroupName = "NinjaScriptGeneral")]
            public int AreaOpacity
            {
                get { return areaOpacity; }
                set
                {
                    areaOpacity = Math.Max(0, Math.Min(100, value));
                    if (areaBrush != null)
                    {
                        Brush newBrush        = areaBrush.Clone();
                        newBrush.Opacity    = areaOpacity / 100d;
                        newBrush.Freeze();
                        areaBrush            = newBrush;
                    }
                }
            }
    
            [XmlIgnore]
            [Display(ResourceType = typeof(Custom.Resource), Name = "Small area color", GroupName = "NinjaScriptGeneral")]
            public Brush SmallAreaBrush
            {
                get { return smallAreaBrush; }
                set { smallAreaBrush = value; }
            }
    
            [Browsable(false)]
            public string SmallAreaBrushSerialize
            {
                get { return Serialize.Brush2String(SmallAreaBrush); }
                set { SmallAreaBrush = Serialize.String2Brush(value); }
            }
    
            [Browsable(false)]
            [XmlIgnore]
            public Series<double> TestPlot
            {
                get { return Values[0]; }
            }
    I still haven't found an example of a property description tag. Does NT8 support these? I no longer see a description box when looking at the parameters of an indicator in the UI. If yes, how do I define the description for a property?

    Thanks!

    #2
    Good call, yea don't disagree will add it to the list for us to look at improving documentation.

    NT8 we dropped description, no longer is used on per property basis.
    Last edited by NinjaTrader_Brett; 06-01-2015, 01:01 PM.

    Comment


      #3
      Originally posted by NinjaTrader_Brett View Post
      NT8 we dropped description, no longer is used on per property basis.
      That's too bad. I always give a description to my parameters. Maybe you guys could implement as a tooltip?

      Comment


        #4
        Thanks. Actually already on our list for review on the tooltip.

        Comment


          #5
          Originally posted by NinjaTrader_Brett View Post
          Good call, yea don't disagree will add it to the list for us to look at improving documentation.

          NT8 we dropped description, no longer is used on per property basis.
          Not sure of that one. I am sure that I have Descriptions on my properties, but I am rebuilding my Virtual Machine at this time. If I confirm it, I will post some pictures.

          Comment


            #6
            No need just tested and works. I guess it was already on my plate and I already handled Should be in the tooltip.

            Let me know if your mileage varies.

            Comment


              #7
              Originally posted by NinjaTrader_Brett View Post
              No need just tested and works. I guess it was already on my plate and I already handled Should be in the tooltip.

              Let me know if your mileage varies.
              Well, I'm not seeing my description show up in the tooltip of Strategy Analyzer. Not sure I am defining it correctly:

              Code:
                      [Description("Number of prior days used to calculate rolling statistics.")]
                      [Range(1, int.MaxValue), NinjaScriptProperty]
                      [Display(ResourceType = typeof(Custom.Resource), Name = "Days", GroupName = "NinjaScriptStrategyParameters", Order = 1)]
                      public int Days
                      { get; set; }
              What I see in the tooltip in both Strategy Analyzer and Indicators Dialog is the value of Name.

              Comment


                #8
                You should use the 'Description' public property of 'Display' attribute.
                [Display(ResourceType = typeof(Custom.Resource), Name = "Name of property", GroupName = "NinjaScriptGeneral", Description = "Some description...")]
                It just provides a tooltip to your property.

                Comment


                  #9
                  Thanks leoxander. If you guys see it not working after using correct description let me know could be a bug where one grid does not respect correctly.

                  Comment


                    #10
                    Originally posted by leoxander View Post
                    You should use the 'Description' public property of 'Display' attribute.
                    [Display(ResourceType = typeof(Custom.Resource), Name = "Name of property", GroupName = "NinjaScriptGeneral", Description = "Some description...")]
                    It just provides a tooltip to your property.
                    That works. Thanks!

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Davide999, 05-18-2023, 03:55 AM
                    4 responses
                    554 views
                    1 like
                    Last Post kcwasher  
                    Started by Stanfillirenfro, Today, 07:23 AM
                    2 responses
                    9 views
                    0 likes
                    Last Post Stanfillirenfro  
                    Started by rexsole, Today, 08:39 AM
                    2 responses
                    6 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Started by cmtjoancolmenero, Yesterday, 03:58 PM
                    6 responses
                    29 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by gbourque, Today, 06:39 AM
                    2 responses
                    14 views
                    0 likes
                    Last Post gbourque  
                    Working...
                    X