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 fmcap, Today, 10:49 PM
      0 responses
      2 views
      0 likes
      Last Post fmcap
      by fmcap
       
      Started by iradielt, Today, 10:06 PM
      0 responses
      2 views
      0 likes
      Last Post iradielt  
      Started by gbajaj, Today, 03:35 PM
      2 responses
      11 views
      0 likes
      Last Post gbajaj
      by gbajaj
       
      Started by space_trader, Today, 03:19 PM
      2 responses
      8 views
      0 likes
      Last Post space_trader  
      Started by max1ci6, Today, 02:02 AM
      4 responses
      28 views
      0 likes
      Last Post joromero  
      Working...
      X