Page 1 of 1

VForce formula error?

Posted: 10 Feb 2011
by Laurent
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: VForce

Vars: TSum(0), Trend(0), DM(0), CM(0);

TSum = High + Low + Close;
IF TSum > TSum[1] Then

Trend = 1
Else
Trend = -1;
IF Trend = Trend[1] Then
CM = CM + Range
Else
CM = Range + Range[1];
IF CM <> 0 Then
VForce = 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! ;)

Re: VForce formula error?

Posted: 10 Feb 2011
by TJ
this is from my archive:

Code: Select all

// Type: Function, Name: VForce

Vars:
TSum(0),
Trend(0),
DM(0),
CM(0);

TSum = High + Low + Close;
DM = High - low;

IF TSum > TSum[1] Then
Trend = 1
Else
Trend = -1;

IF Trend = Trend[1] Then
CM = CM + Range
Else
CM = Range + Range[1];

IF CM <> 0 Then
VForce = 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}

Re: VForce formula error?

Posted: 10 Feb 2011
by Laurent
Cool, thanks for your version!

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

I don't know if this can be fixed!