Registered User Joined: 12/5/2008 Posts: 70
|
I like to work with the vol bars in the price pane because it allows space for another indicator at the bottom. The problem is that some of the high vol bars interfere with the price plots. Is there a way in SF 5 that allows me to truncate the long bars? If not can I get some direction for real code?
Thanks
Todd A
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The Clip Volume bars topic has an example that truncates the values of high value volume bars. That said, I would think this would make things worse, not better, as a higher percentage of the Bars would project further up into the Pane.
One possible suggestion would be to the opacity. The fromARGB method allows you to define the degree of transparency using an alpha channel so I was using it for testing.
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)
So you could replace everything after the Inherits line in the Class tab of the RealCode Editor with something similar to the following to adjust the opacity of the RealCode Paint Brush:
Sub New
AutoLoop = False
End Sub
Public Overrides Sub CallUserCode()
For i As Integer = 1 To Price.Line.Count - 1
If Price.Line.Value(i) >= Price.Line.Value(i-1) Then
AddToOutput(Price.Line.DateValue(i), Color.fromARGB(126, 0, 255, 0))
Else
AddToOutput(Price.Line.DateValue(i), Color.fromARGB(126, 255, 0, 0))
End If
Next
End Sub
End Class
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 12/5/2008 Posts: 70
|
Bruce
Your code did the trick. I may take a look at the "volume bar clip" series of posts also. Can I use that feature along with the code you sent me?
Thanks again
Todd A
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I don't see why you couldn't, but make sure you read through the topic and understand the Truncated Volume Bars along with their limitations (like not using it as a parent Indicator) if you do so..
-Bruce Personal Criteria Formulas TC2000 Support Articles
|