Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Color with less Opacity in a Data Series

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

    Color with less Opacity in a Data Series

    Hi NT,

    I had a quick question, as I could not find the answer in the forum.

    I read how it is possible to add a custom color. That is, add in the R,G,B color. That works.

    However for my purposes, I would like to use any color on the palette with a lower opacity for easier readability.

    Since it is a Data Series, not an indicator, I do not have access to add in a line of code for opacity.

    Any suggestions on how this can be achieved?

    Here is a screenshot of my Data Series, attached.

    Thanks Irv
    Attached Files

    #2
    Hello ij001,

    Thank you for your post.

    You could create an indicator that you could apply to the chart to automatically adjust the opacity of the bars.

    You can find the color the user chose for the up and down brushes from ChartBars.Properties.ChartStyle.DownBrush.Clone(); and ChartBars.Properties.ChartStyle.UpBrush.Clone();, clone those to a temp brush, adjust the opacity, freeze the temp brush and then assign it to BarBrushes[0] for each bar. I'm attaching a simple example script that demonstrates.

    Please let us know if we may be of further assistance to you.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello ij001,

      Thank you for your post.

      You could create an indicator that you could apply to the chart to automatically adjust the opacity of the bars.

      You can find the color the user chose for the up and down brushes from ChartBars.Properties.ChartStyle.DownBrush.Clone(); and ChartBars.Properties.ChartStyle.UpBrush.Clone();, clone those to a temp brush, adjust the opacity, freeze the temp brush and then assign it to BarBrushes[0] for each bar. I'm attaching a simple example script that demonstrates.

      Please let us know if we may be of further assistance to you.
      Hi Kate,

      I have been using the attached indicator since your post. It definitely is easier on the eyes.

      Today, in the Log, it printed in orange:

      "Brush series exceeds the maximum number (65535) of unique brushes"

      How do I set the number of brushes and then it can restart once exceeded?

      Please let me know, if there is a snippet in the NT8 guide.

      Thx Irv

      Comment


        #4
        The problem is that a new brush is created for every change of bar direction in OBU. Try using two custom brush names, one for the UpBrush and one for the DownBrush, and do the cloning, opacity and freezing in State.Configure. Then just use the two brushes in OBU.
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          I found a work around with opacity that fits my needs, instead of creating an indicator.
          I wanted to share it, in case someone else finds it useful.

          My example:

          - SpringGreen is my color of choice
          - I want 50% opacity, so it is easier on the eyes

          1. Print screen and use MS Paint to get the RGB of SpringGreen. i.e. RGB ~ 4, 255, 129
          2. Go to NT Color Picker and add % of opacity before the RGB

          That is, 50, 4, 255, 129



          See article below
          ARGB (Alpha, Red, Green, Blue) Value Transparent Brush A comma-separated ARGB value (eg. "50, 255, 192, 203" for Pink with 50% Opacity)
          Attached Files

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by WeyldFalcon, 12-10-2020, 06:48 PM
          14 responses
          1,426 views
          0 likes
          Last Post Handclap0241  
          Started by Barry Milan, Today, 10:35 PM
          0 responses
          2 views
          0 likes
          Last Post Barry Milan  
          Started by DJ888, Yesterday, 06:09 PM
          2 responses
          9 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          40 views
          0 likes
          Last Post jeronymite  
          Started by bill2023, Today, 08:51 AM
          2 responses
          16 views
          0 likes
          Last Post bill2023  
          Working...
          X