Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

real code change for opacity of volume bars Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
tarabia1
Posted : Wednesday, December 16, 2009 12:40:07 PM
Registered User
Joined: 12/5/2008
Posts: 70

I would like to have the volume bars on my price pane in the chart.  I was able to reduce the height  of the bars to a reasonable level but I would like to reduce the opacity level to make them transparent.  I was not successful.  Does this require real code?  If so, can you help me?  At present I'm using, in real code, red and black for the bar colors.

Thanks in advance

Todd A

Bruce_L
Posted : Wednesday, December 16, 2009 4:26:11 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (tarabia1)
At present I'm using, in real code, red and black for the bar colors.

If you are already using a RealCode Paint Brush, you might want to just use the fromARGB method for Color instead of Color.Red and Color.Black.

The fromARGB method allows you to define the degree of transparency using an alpha channel.

PlotColor = Color.fromARGB(255, 255, 255, 255)

The first number is the Alpha (and affects transparency) - 0 is transparent, 255 is solid.
The second number is Red - 0 means no red, 255 means max red.
The third number is Green - 0 means no green, 255 means max green.
The fourth number is Blue - 0 means no blue, 255 means max blue.

Each of the numbers is a byte and must be between 0 and 255 (inclusive).

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
runningdawgcaptlst1
Posted : Wednesday, December 16, 2009 9:32:59 PM
Platinum Customer Platinum Customer

Joined: 10/7/2004
Posts: 357
here is a site for the decimal color codes or BING  RGB and get lots of hits.

http://www.tayloredmktg.com/rgb/
tarabia1
Posted : Thursday, December 17, 2009 11:22:02 AM
Registered User
Joined: 12/5/2008
Posts: 70
I dont  know an awful lot about realcode,  just enough to be dangerous.  The following are the original code code I was using and my interpretation of what you had suggested.  In my versions I got errors on lines 6 and 9 which stated that boolean data was not compatible with system colors and integer type data was also not compatible with system colors.

Need help 

Thanks again

Todd A


For i As Integer = 1 To price.Line.count - 1
            If price.line.value(i) >= price.line.value(i-1) Then
                        MyBase.addtooutput(price.line.datevalue(i),color.black)
                       
            Else
                        MyBase.addtooutput(price.line.datevalue(i),color.red)
                       
            End If
Next
 
 
 
 
  
 
 
 
For i As Integer = 1 To price.Line.count - 1
            If price.line.value(i) >= price.line.value(i - 1) Then
                        MyBase.addtooutput(price.line.datevalue(i), plotcolor = color.FromArgb(100, 0, 0, 0))
 
                                                           
            Else
                        MyBase.addtooutput(price.line.datevalue(i), plotcolor = color.FromArgb(100, 255))
 
           
            End If
Next
 
 
 
 
                       
          
 
 
 
 
 
 
 
Bruce_L
Posted : Thursday, December 17, 2009 11:30:27 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
tarabia1,
If you are using AddToOutput(), you don't need to use PlotColor = as they are different ways of doing the same thing (this is what it looks like in the Code tab, but there are other things going on in the Class tab that set up the AutoLoop = False and make it all work):

For i As Integer = 1 To price.Line.count - 1
    If price.line.value(i) >= price.line.value(i-1) Then
        MyBase.addtooutput(price.line.datevalue(i), color.fromARGB(100, 0, 0, 0))
    Else
        MyBase.addtooutput(price.line.datevalue(i), color.fromARGB(100, 255, 0, 0))
       
    End If
Next

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.