Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

be able to change color in exported strategy with indicator

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

    #16
    well i guess this answers the question.
    An indicator added by a strategy cannot be configured manually.

    I wanted the user to be able to change line colors of the indicator, when I export the strategy that is calling indicator.. I guess its not possible and only solution is to provide user with seperate indicator where he actually can change color lines.



    Comment


      #17
      Hello tkaboris,

      Correct, as stated in post # 9 a an indicator added by a strategy cannot be configured manually, and will only use the settings supplied by the strategy.

      "I wanted the user to be able to change line colors of the indicator, when I export the strategy that is calling indicator.. I guess its not possible and only solution is to provide user with seperate indicator where he actually can change color lines."

      Also, as suggested post # 2 you could add public properties to the strategy and use these to set the indicator values.
      Have you done this as directed?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Also, as suggested post # 2 you could add public properties to the strategy and use these to set the indicator values.
        Have you done this as directed?​

        I couldnt figure out how to do that,

        Comment


          #19
          Hello tkaboris,

          In the Strategy:

          [NinjaScriptProperty]
          [XmlIgnore]
          [Display(Name="DownTrendColor", Description="Color of the down trend line.", Order=6, GroupName="Parameters")]
          public Brush DownTrendColor
          { get; set; }

          [Browsable(false)]
          public string DownTrendColorSerializable
          {
          get { return Serialize.BrushToString(DownTrendColor); }
          set { DownTrendColor = Serialize.StringToBrush(value); }
          }​

          In OnStateChange() when State is State.DataLoaded of the strategy:

          BTL = BBTrendLine(false, Strength, true, false, 60, DownTrendColor, Brushes.Green, Brushes.Black, Brushes.Green,3);
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            ok and inside indicator, I dont have value plotted that references from strategy. DOes this look as it should if I want to add public properties to the strategy and use these to set the indicator values.
            set { DownTrendColor = Serialize.StringToBrush(value); }

            AlertOnBreak = false;
            Strength = 5;
            ShowHistory = true;
            LimitHistory = false;
            LimitHistoricalLookback = 60;
            DownTrendColor = Brushes.Black;
            UpTrendColor = Brushes.Green;
            lineWidth = 3;
            DownHistColor = Brushes.Black;
            UpHistColor = Brushes.Green;​
            Click image for larger version

Name:	image.png
Views:	70
Size:	37.7 KB
ID:	1315949

            Comment


              #21
              Hello tkaboris,

              Any values you want the user to be able to set on the indicator from the strategy, create a public input for that property and supply this to the indicator.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              88 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              134 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