Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to detect plot color change according to bar?

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

    Is it possible to detect plot color change according to bar?

    Hi
    I know the following:

    Code:
    protected override void OnStateChange()
    {
    if(State == State.SetDefaults)
    {
    Name = "Example Indicator";
    AddPlot(Brushes.Transparent, "Any");
    }
    }
    
    protected override void OnBarUpdate()
    {
    if (Close[0] > Open[0])
    PlotBrushes[0][0] = Brushes.Blue;
    else
    PlotBrushes[0][0] = Brushes.Red;
    }
    The plot color is drawn differently in each bar depending on the close and open price.

    However, what I want is the opposite.
    There is an indicator that I cant see source.
    I can access this plot in my code and get its value, but I can't get its color.
    Is there any way to implement this?

    I apologize if I didn't explain it well.
    Thanks.
    Last edited by truepenny; 11-13-2024, 11:35 PM.

    #2
    Hello truepenny,

    Thank you for your post.

    To clarify, you want to programmatically get the color the bar is being painted via another closed source script?

    Unfortunately, there are no supported or documented means for checking if the brush color of a third-party indicator's plot is a specific brush color for conditions.

    You could reach out to the developer of the closed source script, and request they implement something so you can obtain this information programmatically, or let you know the logic they're using for painting the bars so you could implement this within your own script.

    Please let us know if you have any further questions.

    Comment


      #3
      Thanks,Gaby.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X