Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Incorrectly Getting plot color -

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

    Incorrectly Getting plot color -

    I have in "SetDefaults"

    AddPlot(...Brushes.Green..);

    in DataLoaded:

    myBrush = Plots[0].Brush;



    in OnBarUpdate();

    --> myBrush is Green.


    However, if in DataLoaded, I code:

    myBrush = Plots[0].Brush; //even tried: new SolidColorBrush((Plots[0].Brush as SolidColorBrush).Color);
    Plots[0].Brush = Brushes.Transparent;


    then `myBrush` is also transparent in OnBarUpdate.
    what to do?


    #2
    Hello ttodua,

    Thank you for your note.

    I'm not seeing this behavior on my end.

    While setting Plots[0].Brush to transparent in State.DataLoaded would mean the plot would remain transparent unless you reset that brush to green again in OnBarUpdate, myBrush should remain green. I've attached a test indicator you can try out to see if you get the same effect on your end. When you load it on your chart and leave "IsTransparent" unchecked, you should see a green center line plotted on the chart, and green text in the bottom right corner. If you check the "IsTransparent" box, it will reassign Plots[0].Brush to transparent in State.DataLoaded. However, the Text.DrawFixed that is in the bottom right corner should still be green.

    Do you experience different behavior with this test Script?

    Thanks in advance; I look forward to assisting you further.
    Attached Files

    Comment


      #3
      theoretically you should be right, but i will submit my indicator later to see that behavior. thanks i will test yours too

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      72 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      152 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X