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

Color missing in indicator config

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

    Color missing in indicator config

    Hi,
    I have a custom indicator, that has one color missing in the config.
    that color should show up where the arrow is

    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


    this is varialbles section:

    Code:
    #region Variables
                public int        xTF                = 1;
                public bool        showEBOnly        = true;
                public bool        showPriorBar    = true;
                public bool        showLast200        = true;
            
                public double    offset            = 1;
                public int        Font            = 7;
                public bool        sAlert           = false;
                public Color    fontColor        = Color.Black;
                public Color    backColor        = Color.Yellow;
            
                string xtF_Short, xtF_Long;
                double xTF1;
                double Toffset;
                double lastClose = 0;
            #endregion
    and this is property section

    Code:
            #region Properties
             //[Browsable(false)]    // this line prevents the data series from  being displayed in the indicator properties dialog, do not remove
             [XmlIgnore()]        // this line ensures that the indicator can be  saved/recovered as part of a chart template, do not remove
    
            [Description("Number of Ticks from Signal Bar")]
            [GridCategory("Parameters")]
            [NinjaTrader.Gui.Design.DisplayName("\t\t\t\tNumber of Ticks")]
            public int Ticks
            {
                get { return xTF; }
                set { xTF = Math.Max(1, value); }
            }
    
            [Description("Show Entry Bar only (bar after Signal Bar)")]
            [GridCategory("Parameters")]
            [NinjaTrader.Gui.Design.DisplayName("\t\t\tShow Entry Bar only")]
            public bool zShowEBOnly
            {
                get { return showEBOnly; }
                set { showEBOnly = value; }
            }
    
            [Description("Show tF from Prior Bar")]
            [GridCategory("Parameters")]
            [NinjaTrader.Gui.Design.DisplayName("\t\tShow Prior Bar")]
            public bool zShowPriorBar
            {
                get { return showPriorBar; }
                set { showPriorBar = value; }
            }
    
            [Description("Show for last 200 bars only")]
            [GridCategory("Parameters")]
            [NinjaTrader.Gui.Design.DisplayName("\tShow Last 200")]
            public bool zShowLast200
            {
                get { return showLast200; }
                set { showLast200 = value; }
            }
            
            //-----------------------------------------------------------------------
            [Description("Show Alert")]
            [Category("Sound Alerts")]
            [NinjaTrader.Gui.Design.DisplayName("Alert")]
            public bool ShowAlert
            {
                get { return sAlert; }
                set { sAlert = value; }
            }
    
            
            //-----------------------------------------------------------------------
            [Description("Distance of markers from bar H/L in ticks")]
            [Category("Display Options")]
            [NinjaTrader.Gui.Design.DisplayName("Offset")]
            public double Offset
            {
                get { return offset; }
                set { offset = Math.Max(1, value); }
            }
            
            [Description("Font Size")]
            [Category("Display Options")]
            [NinjaTrader.Gui.Design.DisplayName("Font Size")]
            public int FontSize
            {
                get { return Font; }
                set { Font = Math.Max(6, value); }
            }
            
            [Description("Color of Font")]
            [Category("Display Options")]
            [NinjaTrader.Gui.Design.DisplayName("Font Color")]
            public Color FontColor
            {
                get { return fontColor; }
                set { fontColor = value; }
            }
    
            [Browsable(false)]
            public string FontColorSerialize
            {
                get { return NinjaTrader.Gui.Design.SerializableColor.ToString(fontColor); }
                set { fontColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
            }
            
            [Description("BackColor for Entry Bar")]
            [Category("Display Options")]
            [NinjaTrader.Gui.Design.DisplayName("Entry Bar BackColor")]
            public Color BackColor
            {
                get { return backColor; }
                set { backColor = value; }
            }
    
            [Browsable(false)]
            public string BackColorSerialize
            {
                get { return NinjaTrader.Gui.Design.SerializableColor.ToString(backColor); }
                set { backColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
            }
            
            #endregion
    Any ideas, why that is happening?

    Many thanks

    Thomas

    #2
    Hello td_910,

    Thank you for the post.

    In this case, you would need to use a different name for your public color property. BackColor already is a property of an indicator: https://ninjatrader.com/support/help...tsub=BackColor

    You could name this BackColor2 or pretty much anything else. After compiling, remove the indicator from the chart and re-add it and it should show up.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by trilliantrader, 04-18-2024, 08:16 AM
    4 responses
    16 views
    0 likes
    Last Post trilliantrader  
    Started by mgco4you, Today, 09:46 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by wzgy0920, Today, 09:53 PM
    0 responses
    6 views
    0 likes
    Last Post wzgy0920  
    Started by Rapine Heihei, Today, 08:19 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    9 views
    0 likes
    Last Post Rapine Heihei  
    Working...
    X