• 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

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.
    JesseNinjaTrader Customer Service

    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.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bubblegum, Today, 01:13 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by TraderYoda, Today, 03:33 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_EricB  
            Started by fredfred, Today, 03:41 AM
            4 responses
            15 views
            0 likes
            Last Post fredfred  
            Started by pjsmith, Today, 02:56 AM
            0 responses
            6 views
            0 likes
            Last Post pjsmith
            by pjsmith
             
            Started by ntbone, Yesterday, 08:10 PM
            0 responses
            13 views
            0 likes
            Last Post ntbone
            by ntbone
             
            Working...
            X