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 |

Need help with creating a real code indicator Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
hacker13
Posted : Tuesday, September 13, 2011 10:22:00 AM
Platinum Customer Platinum Customer

Joined: 10/7/2004
Posts: 42
I would like to plot to showcumulative volume for days that are up and cumulative volume for days that are downexamplestock up day 1 vol= 1m, plot = 1mday 2 stock up again vol = 800k, plot = 1.8m etc untilday 6 stock down vol = 500k, plot = 500kday 7 stock down vol = 300k, plot = 800k etc.I will then use paint for the colorsthanksMark
Bruce_L
Posted : Tuesday, September 13, 2011 10:44:33 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Cumulative Directional Volume
'|******************************************************************
Static Sum As Single
If isFirstBar Then
    Sum = 0
Else
    Dim NewVal As Single = System.Math.Sign(Price.NetChange) * Volume.Value
    If System.Math.Sign(NewVal) = System.Math.Sign(Sum) Then
        Sum += NewVal
    Else
        Sum = NewVal
    End If
End If
Plot = Sum

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
hacker13
Posted : Tuesday, September 13, 2011 10:56:19 AM
Platinum Customer Platinum Customer

Joined: 10/7/2004
Posts: 42
Bruce,That is what I am looking for but, is there a way to have the plot show only positive values and then I can color it to see the up vs down action?ThanksMark
Bruce_L
Posted : Tuesday, September 13, 2011 11:03:39 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Absolute Cumulative Directional Volume
'|******************************************************************
Static Sum As Single
If isFirstBar Then
    Sum = 0
Else
    Dim NewVal As Single = System.Math.Sign(Price.NetChange) * Volume.Value
    If System.Math.Sign(NewVal) = System.Math.Sign(Sum) Then
        Sum += NewVal
    Else
        Sum = NewVal
    End If
End If
Plot = System.Math.Abs(Sum)

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
hacker13
Posted : Tuesday, September 13, 2011 11:06:53 AM
Platinum Customer Platinum Customer

Joined: 10/7/2004
Posts: 42
PerfectThanks againMark
Bruce_L
Posted : Tuesday, September 13, 2011 11:13:09 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

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