logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
wdgigi  
#1 Posted : Monday, August 10, 2009 4:10:32 AM(UTC)
wdgigi

Rank: Member

Groups: Registered, Registered Users
Joined: 3/6/2008(UTC)
Posts: 16

Hi Wabbitt,

I'd like to return on some indicators for hurst's analisis.

The "Speed" is the difference between the last value of the "centered ma" and the "centered ma" of the prior day. This "Speed" crosses the zero-line on the top and on the bottoms.

Than the "Acceleration" is the difference between the "Speed" and the "Speed" of the prior day. This "Acceleration" make a top on a bottom of the security and a bottom on the top of the security.

Here is the code of the "centered ma" by J.Silva.

{ Centered Moving Average - v3.0 }

{ Uses forward-referencing to center Mov Avg

and project future direction.}

{ Uses hindsight - do not trade! }

{ CCopyright 2005 Jose Silva

For personal use only.

http://www.metastocktools.com }

{ User inputs }

fwPds:=Input("Forward-referencing periods (automatic = -1)",-1,2600,-

1);

proj:=Input("Project last known MA: [1]Direction, [2]Value",1,2,1);

pds:=Input("Mov Avg periods",1,2600,21);

type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol [7]Wght",1,7,

2);

{ Choose MovAvg type:

1 - Exponential MA

2 - Simple MA

3 - Time Series MA

4 - Triangular MA

5 - Variable MA

6 - Volume adjusted MA

7 - Weighted MA }

ma:=

If(type=1,Mov(C,pds,E),

If(type=2,Mov(C,pds,S),

If(type=3,Mov(C,pds,T),

If(type=4,Mov(C,pds,TRI),

If(type=5,Mov(C,pds,VAR),

If(type=6,Mov(C,pds,VOL),

Mov(C,pds,W)))))));

{ Automatic period-centering }

center:=LastValue(If(fwPds<0,Int(pds/2),fwPds));

{ Forward-referenced MovAvg }

fwd:=Ref(ma,center);

{ Last valid MovAvg plot point }

lastVal:=IsUndefined(fwd)

AND Alert(IsUndefined(fwd)=0,2);

{ Extend MovAvg plot into future null zone }

xtend:=LastValue(fwd+PREV-PREV);

{ Restrict invalid initial MovAvg plot }

movAvg:=Ref(Ref(xtend,pds-1),-pds+1);

{ Last MA known direction & future projection }

init:=Cum(IsDefined(movAvg))=1;

direction:=movAvg+

( ValueWhen(1,init OR lastVal,Ref(movAvg,-1))

-ValueWhen(1,init OR lastVal,Ref(movAvg,-2)))

*(BarsSince(init OR lastVal)+1);

{ Plot MovAvg on price chart }

If(proj=1,direction,movAvg)

Have You any idea how to build theese new indicators? I've tried but it is something wrong on the projection, or to change the projection with a mathematical calculation, for example, with a average o the last values or other.

Thanks for the help. If you need other best explanation, ask me.

gg

johnl  
#2 Posted : Tuesday, August 11, 2009 10:43:10 PM(UTC)
johnl

Rank: Advanced Member

Groups ready for retrieval: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

The difference of a value and a previous value is:
VV-Ref(VV,-1) where "VV" is your variable.

Strip away the code might make it easier.
wdgigi  
#3 Posted : Wednesday, August 12, 2009 3:22:03 AM(UTC)
wdgigi

Rank: Member

Groups: Registered, Registered Users
Joined: 3/6/2008(UTC)
Posts: 16

I've tried so, but the projection is incorrect.

FmlVar("Centered Moving Average - v3.0","MOVAVG") - Ref( FmlVar("Centered Moving Average - v3.0","MOVAVG"),-1)

The mathematical calculation for the projection may be made so:

average of the difference between the value of Centered ma and the prior value for n-days (the displaced days).

this average must be added to the last known value of the Centered ma and so for the others following values, for ex:

last value known of centered = 10

average of the difference = 0.5

new value projected = 10+0.5 = 10.5

new value after= 10.5+0.5 = 11, 11+0.50=11.50, 11.50+0.5=12 and so until the last day of the security.

Now have you any idea to build an indicator?

thanks.

gg

wabbit  
#4 Posted : Monday, August 17, 2009 11:26:08 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
For all its worth, the centered moving averages cannot be used to generate trading signals on the last bar of the chart, although depending on how you employ the indicator will determine the signal generation and its useful in trading on the last bar.

Simple calculus says the velocity of price is the rate of change of that price, or the first derivative of the position; very simplistically in MS this is:
Code:
data:=CLOSE;
speed:=ROC(data,1,$);
{plot}
speed;

You can also change the units to percent if you like. "Acceleration" is the rate of change of velocity, or the second derivative of position; again in its simplistic MS implementation:
Code:
data:=CLOSE;

speed:=ROC(data,1,$);
acceleration:=ROC(speed,1,$);
{plot}
acceleration;

For those that are interested, the 3rd derivative is often called "jerk", the 4th, 5th and 6th haven't been afforded "proper names" but in physics they are often derided as "snap", "crackle" and "pop" respectively. [:)]


wabbit [:D]


wdgigi  
#5 Posted : Tuesday, August 18, 2009 1:52:32 AM(UTC)
wdgigi

Rank: Member

Groups: Registered, Registered Users
Joined: 3/6/2008(UTC)
Posts: 16

That's right Wabbit, thanks.

But what i want are two indicators for hurst's studies. And, as you know, his lesson is about the centered ma. I know that the cent.ma. is not to trade because we can see the result after, but with the projection with a line or with one formula like i wrote above, we could have an idea where the security could go and with the others teachings we could trade.

So is what Hurst teaches us...

thanks.

gg

Users browsing this topic
Guest (Hidden)
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.