# VForce formula error?

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
Laurent
Posts: 159
Joined: 20 Nov 2010
Location: France
Has thanked: 76 times
Been thanked: 32 times

### VForce formula error?

To compute the Klinger Volume Oscillator, you need first to compute the Volume Force.

On the net (on a lot of Web sites) there is the following code to compute it:

Code: Select all

`Type: Function, Name: VForceVars: TSum(0), Trend(0), DM(0), CM(0);TSum = High + Low + Close;IF TSum > TSum[1] ThenTrend = 1ElseTrend = -1;IF Trend = Trend[1] ThenCM = CM + RangeElseCM = Range + Range[1];IF CM <> 0 ThenVForce = Volume * AbsValue(2 * (DM/CM) -1) * Trend * 100;`

...
It looks like there is a problem...
DM = 0... so AbsValue(2 * (DM/CM) -1) will always be equal to -1...
Is it normal? Did I miss something?

BTW what is DM? Would be cool to have the right formula!

TJ
Posts: 6704
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 974 times
Been thanked: 1934 times

### Re: VForce formula error?

this is from my archive:

Code: Select all

`// Type: Function, Name: VForceVars: TSum(0), Trend(0), DM(0), CM(0); TSum = High + Low + Close; DM = High - low;IF TSum > TSum[1] ThenTrend = 1ElseTrend = -1;IF Trend = Trend[1] ThenCM = CM + RangeElseCM = Range + Range[1];IF CM <> 0 ThenVForce = Volume * AbsValue(2 * (DM/CM) -1) * Trend * 0.01;   {0.01 works great too; original version had * 100.   Made smaller to decrease the plotted size of volume}     `

Laurent
Posts: 159
Joined: 20 Nov 2010
Location: France
Has thanked: 76 times
Been thanked: 32 times

### Re: VForce formula error?

Cool, thanks for your version!

There is the error on the multicharts website:
https://www.multicharts.com/support/base ... le&id=1387

I don't know if this can be fixed!

Return to “User Contributed Studies and Indicator Library”