Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot Colors Not Changing From Input Params

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

    Plot Colors Not Changing From Input Params

    I know it's late, but I can't seem to change colors from an input parameter...

    I've attached a simple test case that I think outlines the problem

    Once the indicator is added to a chart, go to the parameters and change the color. The indicator color doesn't update.


    Thoughts?

    Matt
    Attached Files

    #2
    After some testing, I realize that this is more with my code and not NT 7.

    I found this thread on Serializing colors:


    But what I'm missing is, can this be applied to plots?

    ie, Create a custom input color that can be applied to plots?

    why? I have several different plot types (sub-indicators) that can be plotted (only one at a time, and selected at runtime ), and requires their own input values.

    Possible? Thoughts?

    Comment


      #3
      tazatek, I'm not sure if it is possible. I will have someone respond to you on Monday regarding this issue.

      As a side note, you may want to search the forums for "serialize plot color" to see if it has been done already.
      AustinNinjaTrader Customer Service

      Comment


        #4
        After searching through hundreds of indicators, I think you're right, that this isn't possible.

        I configured my code to do what others had done, and it will work fine. I just thought I'd seen it used in a different manner.

        I found the serialization examples, and it seems to work for everything except plot()

        Thanks

        Matt

        Comment


          #5
          Matt,

          You could just set a dummy color in the Initialize() method for the plot, but in OnBarUpdate() you set it to the color you selected via the color inputs.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Josh View Post
            Matt,

            You could just set a dummy color in the Initialize() method for the plot, but in OnBarUpdate() you set it to the color you selected via the color inputs.
            Ahh Yes... that'll work.

            Seems I've had a mis-understanding with the Initialize() method... but I think I understand now... just don't use it

            Thanks

            Matt

            Comment


              #7
              Matt,

              Actually you could do it in the OnStartUp() method which may be a better spot for this.

              Code:
              protected override void OnStartUp()
              {
                   Plots[0].Pen.Color = SomeColorVariable;
              }
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                onStartUp()

                That's a good one to know. That's what I was thinking that Initialize() was doing.

                So I'm guessing that onStartUp () is guaranteed to only be called once? Until I remove an indicator and add it back?

                I'm not seeing this in the NT6.5 docs... is it new to NT7 and is it officially supported?

                Comment


                  #9
                  Yes, it runs once and only once on indicator/strategy start. Starting a second time will call it a second time.

                  It is a new method and is officially supported for NT7.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  591 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  342 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  555 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  552 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X