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

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
    Kate W.NinjaTrader Customer Service

    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 WHICKED, Today, 12:45 PM
      2 responses
      18 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by GussJ, 03-04-2020, 03:11 PM
      15 responses
      3,276 views
      0 likes
      Last Post xiinteractive  
      Started by Tim-c, Today, 02:10 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      3 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      51 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X