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 ghoul, Today, 06:02 PM
      0 responses
      7 views
      0 likes
      Last Post ghoul
      by ghoul
       
      Started by Barry Milan, Yesterday, 10:35 PM
      6 responses
      18 views
      0 likes
      Last Post Barry Milan  
      Started by DanielSanMartin, Yesterday, 02:37 PM
      2 responses
      13 views
      0 likes
      Last Post DanielSanMartin  
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      13 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      12 views
      0 likes
      Last Post terofs
      by terofs
       
      Working...
      X