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 |

Overlayng vol bars on price pane Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
tarabia1
Posted : Monday, March 29, 2010 9:49:43 AM
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

Bruce_L
Posted : Monday, March 29, 2010 10:14:58 AM


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
tarabia1
Posted : Tuesday, March 30, 2010 3:35:43 PM
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
Bruce_L
Posted : Tuesday, March 30, 2010 3:38:53 PM


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
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.