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

    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 NullPointStrategies, Today, 05:17 AM
          0 responses
          23 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          120 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          63 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          45 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X