[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Momentum (speed and acceleration)



PureBytes Links

Trading Reference Links

I consulted my dictionnary, and unlike what I thought, the translation into
french was correct.

In physics, momentum is the product of mass by speed (known here as quantity
of movement).
It ha its equivalent in technical analysis if you refer volume to mass and
speed to ...speed( known as momentum for Technical analysts).
Money Flow is something close to momentum ( taken as quantity of movement). 

Q= m*v

Momentum (v) in a general manre means "speed".
Speed is defined as the first derivative of  the space vector MM' (M and M'
are price data for us)

v= d(MM')/dt
with dt -->0

In technical analysis, dt cannot be set to an infinitesimal quantity, because
the minimum time between M and M' is the duration of the considered bar.

If we admit that the minimum time unit is one bar duration, the formula gives:

v=  d(MM') /dt = (C-C[1]) / 1 = C-C[1].

A one bar momentum is the true  speed definition.

Now, due to the noise present in market data, this value is of a poor use
(jaggy).
So, we use C-C[n] that has the same dimention where the divisor has been
omitted (should be n).
But the shape of the fuction is the same.
This "momentum is also as kind of speed calculation , but calculated on a N
bar window that overlap of one bar from the previous one.

To avoid the noise problem, we can calculate the speed  by using a exponential
average technique:
We still use the C-C[1] definition, and the averaging technique does the rest
This function is closer of the true definition of momentum that C-C[n] is.


Here is an example given on close data
{
VEL User function
=============
}

inputs:ww(numericsimple);
vars:ex0(0), Factor(0),ex1(0);
	{cours}
ex0=xaverage(c,ww);
	{vitesse}
If ww + 1 <> 0 then Begin
  If CurrentBar <= 1 then begin
    Factor = 2 / (ww + 1);
    ex1 = ex0;
  End
  Else  
   ex1 = Factor *(ex0-ex0[1]) + (1 - Factor) *ex1[1];
End;
vel=ex1;

One can also calculate d²(MM')/Dt² (acceleration, that is the second
derivative of momentum or speed, the third derivative ....)
This is otherwise impossible with the classical definition because prices
varies  discontinuously. his efect is even more obvious with acceleration.

{
Velocity/ Acceleration
User function (set to "series")
___________________________
Code by Pierre Orphelin
110, avenue du President Wilson
F 93100 Montreuil. 
France.
E-Mail Orphelin@xxxxxxx
Fax + 33 1 42 87 30 81

www.sirtrade.com
___________________________
}

inputs:ww(numericsimple);
vars:ex0(0), Factor(0),ex1(0),ex2(0),ex3(0),ex4(0);
	{cours}
ex0=xaverage(c,ww);

	{vitesse}
If ww + 1 <> 0 then Begin
  If CurrentBar <= 1 then begin
    Factor = 2 / (ww + 1);
    ex1 = ex0;
  End
  Else  
   ex1 = Factor *(ex0-ex0[1])+ (1 - Factor) *ex1[1];	

	{accélération}
If ww + 1 <> 0 then Begin
  If CurrentBar <= 1 then begin
    Factor = 2 / (ww + 1);
    ex2 = ex1;
  End
  Else  
   ex2 = Factor *(ex1-ex1[1]) + (1 - Factor) *ex2[1];
End;
accel=ex2;										

You can replace "c" by price(numericseries) if you want a more flexible
function.
These functions could be  very interesting, once normalized,  as inputs to
some neurofuzzy software too.

Sincerely,

-Pierre Orphelin