Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change color property of an indicator called from strategy

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

    Change color property of an indicator called from strategy

    Hello,
    I have this Color property in an indicator.
    I can change the color when I use the indicator in the chart, but I cant see ir when I add this indicator from an strategy with AddChartIndicator(),
    Why? how could I see and change the indicator property color when I call from and strategy as indicator ?
    Thank you


    Code:
            [Display(Name="myColor", Description="My Color", Order=8, GroupName="Visual")]
            public SolidColorBrush myColor
            { 
                get {return myColorVar;}
                set {myColorVar= value;}
            }

    #2
    Hello ninjo,

    In this case, you cannot see or change this from the UI because the strategy added the indicator.

    You would need to recreate this property in your strategy for it to also show up in the strategy properties. After doing that, you would also need to supply the SolidColorBrush to the indicator when you call it in the strategy.


    I look forward to being of further assistance.

    Comment


      #3
      Hello Jesse, thnak you,

      If I try with other indicator, for example SMA() o EMA() I can change the color of line...

      Comment


        #4
        Its possible to know the color property of a plot object via code?

        Comment


          #5
          Originally posted by ninjo View Post
          Its possible to know the color property of a plot object via code?
          Plots[0].Brush is color of the first plot.

          Comment


            #6
            Hello ninjo,

            Thank you for your reply.

            Yes, this is still possible however this is a different process than your first example. In your first example, the indicator already had a brush input where the SMA does not. As nkhoi noted, you would need to access the properties of the indicator to set its Plot's color.

            Here is a small example using AddChartIndicator, however this concept applies anywhere you create a variable for an indicator like this.
            Code:
            SMA mySma = SMA(12);
            mySma.Plots[0].Brush = Brushes.Plum;
            AddChartIndicator(mySma);
            I look forward to being of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            71 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            143 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            76 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            47 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            51 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X