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

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 Jonafare, 12-06-2012, 03:48 PM
            5 responses
            3,984 views
            0 likes
            Last Post rene69851  
            Started by Fitspressorest, Today, 01:38 PM
            0 responses
            2 views
            0 likes
            Last Post Fitspressorest  
            Started by Jonker, Today, 01:19 PM
            0 responses
            2 views
            0 likes
            Last Post Jonker
            by Jonker
             
            Started by futtrader, Today, 01:16 PM
            0 responses
            7 views
            0 likes
            Last Post futtrader  
            Started by Segwin, 05-07-2018, 02:15 PM
            14 responses
            1,791 views
            0 likes
            Last Post aligator  
            Working...
            X