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

[EquisMetaStock Group] Re: Adaptive Moving Average



PureBytes Links

Trading Reference Links

------------------------------------------------------------------------
You cannot reply to this message via email because you have chosen not
to disclose your email address to the group.

To reply:  http://groups.yahoo.com/group/equismetastock/post?act=reply&messageNum=5265
------------------------------------------------------------------------

Praktikus

Thanks for sharing the indicator and system.
Here's another in the series:

Kaufman's Adaptive Moving Average II
{ Kaufman AMA indicator }
PriceSeries:=Input("Prices series - 0:O|1:H|2:L|3:C",0,3,3);
Periods:=Input("Periods",1,32767,10);
FEndF:=Input("Fast end factor",0,1,0.666);
SEndF:=Input("Slow end factor",0,1,0.0645);
Pr:=If(PriceSeries=0,OPEN,If(PriceSeries=1,HIGH,If
(PriceSeries=2,LOW,CLOSE)));
Signal:=Abs(Pr-Ref(Pr,-Periods));
Dnoise:=Abs(Pr-Ref(Pr,-1));
Noise:=Sum(Dnoise,Periods);
EffRatio:=If(Noise>0.,Signal/Noise,0.);
FERatio:=FEndF*EffRatio+SEndF*(1-EffRatio);
SmoothF:=Power(FERatio,2);
PKAMA:=Pr*SmoothF+(1-SmoothF)*PREV;
PKAMA;

I'd like to play a bit with yours though. Why don't we look under the 
hood a bit.
Let's consider what your indicator does. First, lets get the 
volatility factor. This would be 
the variable named "Constant".  If you display just this much of the 
indicator, you will get 
an indicator that goes from 0.0 to 0.45. The indicator would be:

Direction:=CLOSE - Ref(CLOSE,-10);
Volatility:=Sum(Abs(ROC(CLOSE,1,$)),10);
ER:=Abs(Direction/Volatility);
FastSC:=2/(2+1){.667};
SlowSC:=2/(30+1){.0645};
SSC:=ER*({FastSC-SlowSC}0.6025)+{SlowSC}.O645;
Constant:=Pwr(SSC,2);
constant;

Let's move on to the rest of the indicator.
If(Cum(1)=10+1,{then}
Ref(CLOSE,-1)+constant*(CLOSE-Ref(CLOSE,-1)),{else}
PREV+constant*(CLOSE-PREV));

This is the final output. The first line simply secures that a count 
will 
start on day eleven so all that you are really getting here is middle 
line
which states Ref(CLOSE,-1)+constant*(CLOSE-Ref(CLOSE,-1)),{else}.
First, lets state the line a little differently using the value of 8 
for yesterdays close
and 10 for todays close. We'll also use a constant of .30 to make our 
calculations.

8 +(constant*(10-8)) or
8 + (.30 * 2) or
8 + .60 for a final plot value of 8.60 when the value of the close is 
10.

This does change daily simply because the value of the closes and the 
constant change. 
Consider though how adaptive you really are. As you can see we are 
really relying more 
heavily on yesterdays closing value. 

Going back now to our volatility constant, ask yourself what would 
happen if we used 
something different and then plugged this into the place of the 
constant value. Might make for 
an even more interesting moving average, don't you think?

Preston
   
--- In equismetastock@xxxx, "praktikus_ms" <mluescher@xxxx> wrote:
> --- In equismetastock@xxxx, "robert@xxxx" <robert@xxxx> wrote:
> > praktikus:
> > 
> > Could you give some detail on the adaptive moving average
> > that you are using?  Did you write some Metastock code for
> > it?  Would you mind sharing it?
> > 
> > Thanks.
> > 
> > Bob
> 
> Hello Bob
> 
> First let me explain the adaptive moving average (ama)to all those 
> not familiar with it. The original design belongs to Perry Kaufman. 
> Adaptive means that the periods of this moving average (ma) are not 
> fixed as it is normally. The period-lenght is allowed to adjust 
> itself (done by a smoothing constant) from slow (486 periods) to 
fast 
> (30 periods), according to the market noise. So if there is a lot 
of 
> noise and not much of price action (higher or lower) the ama turns 
> almost flat.
> 
> The real idea behind the tradingsystem with the ama is that Kaufman 
> doesn't look for crosses or else, he is just watching the change 
and 
> direction in the ama-trendline (wether it's up or down). To prevent 
> too many whipsaws, he uses a self-adjusting filter to get buy or 
sell 
> signals.
> 
> I did som MS-coding, but I know for sure that there are a lot of 
> people around who are a lot smarter programming MetaStock than I 
am. 
> So if there are ways to improve my MS-Language let me know, Im 
always 
> eager to learn more and sharpen my skills.
> 
> The following system works quite well (maybe not in every market 
> environment but pretty well with European bonds). There is one 
point 
> where I think the system is not doing what it is supposed to do: if 
> the system is long and turns short and the long signal is still 
> = "true"(and vice versa). Now when the signal turns from "true" 
> to "not true", my system enters long again. After inspecting many 
of 
> those "false" trades, I was surprised that they often produced a 
> gain. It seems that the system catches some retracement-moves even 
if 
> it was not designed for that.
> -----------------------------
> {ama}
> 
> Direction:=CLOSE - Ref(CLOSE,-10);
> Volatility:=Sum(Abs(ROC(CLOSE,1,$)),10);
> ER:=Abs(Direction/Volatility);
> FastSC:=2/(2+1);
> SlowSC:=2/(30+1);
> SSC:=ER*(FastSC-SlowSC)+SlowSC;
> Constant:=Pwr(SSC,2);
> If(Cum(1)=10+1,Ref(CLOSE,-1)+constant*(CLOSE-Ref(CLOSE,-
> 1)),PREV+constant*(CLOSE-PREV));
> 
> 
> {enter long}
> 
> (Fml( "ama") -  LLV( Fml("ama"), 10)) 
> > (opt1* 
> ( Stdev( Fml("ama") - Ref(Fml( "ama"),-1) , 20)))
> 
> 
> {enter short}
> 
> (HHV( Fml("ama"), 10)- Fml( "ama")) 
> > (opt1* 
> ( Stdev( Fml("ama") - Ref(Fml( "ama"),-1) , 20)))
> 
> -----------------------
> 
> For opt1 you can insert 0.01 (equals faster trades) to 1.00 (for 
> larger moves). It helps also to try out different stop-methods 
(when 
> to get out seem to me to be even more important than the entry).
> 
> praktikus


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for a more powerful website? Try GeoCities for $8.95 per month.
Register your domain name (http://your-name.com). More storage! No ads!
http://geocities.yahoo.com/ps/info
http://us.click.yahoo.com/auyVXB/KJoEAA/jd3IAA/BefplB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/