Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

change the transparency of the color using the volume filter

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

    change the transparency of the color using the volume filter

    Hello everyone,
    There is a task to change the transparency of the color using the volume filter

    the code

    Code:
    if (Volume >=1000)
    {
    
    Brush newBrush = Brushes.Green.Clone();
    newBrush.Opacity = 0.2;
    
    BarBrushes[0] = newBrush;
    }
    a task:

    If the volume is equal to the minimum = transparency 0.2 (Min)

    if the volume is 2 x times greater than the = transparency 0.9 (Max)


    It is necessary for the transparency to change itself in the min-max range, depending on the volume

    what is the easiest way to implement this?

    please with an example with syntax
    Thanks in advance!

    #2
    Hello memonolog,
    Having if else conditions for all rules to change transparency is good, you should define all conditions. In terms of syntax you're missing newBrush.Freeze(); add it to avoid any surprises. Be sure to define Brushes in State.Configure. I believe you've defined Volume, it must be invoked before you can use it. Having all conditions for both Up Bar & Down Bar will be a good idea to avoid any confusions. Hope it helps!

    Comment


      #3
      Hello memonolog,

      s.kinra, thank you for the helpful input. This is correct to use newBrush.Freeze(). Volume I would expect to be Volume[0] as you would like the current bar's value of the Volume series.
      https://ninjatrader.com/support/help...ies_volume.htm

      The code you have appears to be the easiest way to implement this. Is the behavior not as you expect?
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ct, Today, 04:16 AM
      1 response
      12 views
      0 likes
      Last Post ct
      by ct
       
      Started by aeadon, Today, 02:27 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by op1031, Today, 01:52 AM
      0 responses
      1 view
      0 likes
      Last Post op1031
      by op1031
       
      Started by Aramunno, Yesterday, 10:11 PM
      2 responses
      18 views
      0 likes
      Last Post Aramunno  
      Started by sdauteuil, Yesterday, 09:38 PM
      0 responses
      6 views
      0 likes
      Last Post sdauteuil  
      Working...
      X