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

How to Gui.CategoryOrder Plots?

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

    How to Gui.CategoryOrder Plots?

    Hi,

    I would like to group some of my Plots into a different Category in the settings screen of the indicator.

    Now I can add parameters to the Plots category by using:
    Code:
    # NOTE just reformatted the code a bit for clarity
    [XmlIgnore]
    [Display(ResourceType = typeof(Custom.Resource), 
                  Name               = "Placid lake filler", 
                  Description       = "Sets the color of a placid lake condition", 
                  GroupName     = "Plots", Order = 1)]
    public System.Windows.Media.Brush PlacidLakeBrush
    	{ get; set; }
    That is working fine, but now the other way around, take one plot and put it into a different category?,

    How would I move one Plot from the Plots category into a new category? How do I do that? I tried the following but it is not working

    Code:
    # NOTE just reformatted the code a bit for clarity
    [Browsable(false)]
    [XmlIgnore]
    [Display(ResourceType          = typeof(Custom.Resource), 
                               Name           = "Placid lake condition", 
                               Description   = "Placid lake condition", 
                               GroupName = "Market Analyser Conditions", 
                               Order            = 1)]
    public Series<double> PlacidLake
    {
    	get { return Values[2]; }
    }
    Many thanks in advance for the help.

    JWR

    #2
    Hello Wessel,
    Thanks for your post.

    To make your "Market Analyzer Conditions" category viewable in the settings screen of the indicator you will need to either remove the top line "[Browsable(false)]" or change the boolean to "true".

    That being said, even though the property will be viewable with the change mentioned above you will not be able to modify that series. What kind of setting are you trying to add here?

    I look forward to your reply.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      I'm trying to do this as well and am having difficulties with it because like you said, when Browsable is true I am not able to modify the plot.

      I would like to edit the color, dashstyle, plotstyle, width, and opacity of this plot under a different group name. It's basically moving the plot from GroupName "Plots" to a new GroupName.

      Any guidance is much appreciated.

      Thank you.

      Comment


        #4
        Hi KINGKODA, thanks for your note.

        The Plots sections is handled by NinjaScript when loaded on the menu. Series objects just hold values, so there are not any properties to change about that. As an example see the SMA indicator. When you add a plot to your script with AddPlot this Plots section will already have properties you can edit. To have a group of properties in their own section you can make a collapsable class property type like this:

        Code:
        [TypeConverter(typeof(ExpandableObjectConverter))]
        public class LevelIIColorCollection : ICloneable
        {
            [Browsable(false), XmlIgnore]
            public System.Windows.Media.Brush[] MyBrushes;
        
            public LevelIIColorCollection()
            {
                MyBrushes = new System.Windows.Media.Brush[2];
            }
        
            public object Clone()
            {
                LevelIIColorCollection newCollection = new LevelIIColorCollection()
                {
                    Level01Color    = Level01Color,
                    Level02Color    = Level02Color
                };
        
                return newCollection;
            }
        
            public override string ToString()
            {
                return string.Empty;
            }
        
            [XmlIgnore]
            [Display(Name = "Level 1 Color", Order = 6, GroupName = "Parameters")]
            public Brush Level01Color
            {
                get { return MyBrushes[0]; }
                set { MyBrushes[0] = value; }
            }
        
            [Browsable(false)]
            public string Level01ColorSerializable
            {
                get { return Serialize.BrushToString(Level01Color); }
                set { Level01Color = Serialize.StringToBrush(value); }
            }
        
            [XmlIgnore]
            [Display(Name = "Level 2 Color", Order = 7, GroupName = "Parameters")]
            public Brush Level02Color
            {
                get { return MyBrushes[1]; }
                set { MyBrushes[1] = value; }
            }
        
            [Browsable(false)]
            public string Level02ColorSerializable
            {
                get { return Serialize.BrushToString(Level02Color); }
                set { Level02Color = Serialize.StringToBrush(value); }
            }
        }
        
        ...
        
        [Display(Name = "Level II Colors", Description = "Level II Colors", Order = 6, GroupName = "Parameters")]
        public LevelIIColorCollection LevelIIColors
        { get; set; }
        Please let me know if I can assist any further.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by junkone, Today, 11:37 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by frankthearm, Yesterday, 09:08 AM
        11 responses
        41 views
        0 likes
        Last Post frankthearm  
        Started by quantismo, 04-17-2024, 05:13 PM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by proptrade13, Today, 11:06 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        34 views
        0 likes
        Last Post love2code2trade  
        Working...
        X