• 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

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 ralett, Yesterday, 07:29 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by bboyle1234, Yesterday, 10:46 PM
        1 response
        5 views
        0 likes
        Last Post bltdavid  
        Started by swcooke, Yesterday, 04:29 PM
        0 responses
        5 views
        0 likes
        Last Post swcooke
        by swcooke
         
        Started by bboyle1234, Yesterday, 04:27 PM
        0 responses
        2 views
        0 likes
        Last Post bboyle1234  
        Started by swcooke, Yesterday, 03:31 PM
        2 responses
        12 views
        0 likes
        Last Post swcooke
        by swcooke
         
        Working...
        X