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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            87 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            132 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            68 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            118 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            67 views
            0 likes
            Last Post PaulMohn  
            Working...
            X