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

Re: Changing output from AMA



PureBytes Links

Trading Reference Links

Adam et al

Sorry ... I forgot all about the DBS Lookback formula.

X:=Stdev(C,30);
Y:=Ref(X,-1);
Z:=1+((X-Y)/X);
If(Cum(1)=1,20,Min(Max(PREV*Z,20),60));

I guess that I could use it.

Best regards and Happy Holidays

Walter

----- Original Message -----
From: "Walter Lake" 
To: "Metastock bulletin board" 
Sent: Thursday, December 23, 1999 10:17 AM
Subject: Changing output from AMA


| Hi Adam and other formula writers
|
| How would I rewrite this AMA formula to output the number of days that the
| AMA is using rather than the AMA value for the tradeable?
|
| I want to use it in the following Stochastic formula to define the number
of
| days in Range:
|
| (Current Value - Low of Range)/(High of Range-Low of Range)
|
| Thanks for your help
|
| Best regards
|
| Walter
|
| ===========================
|
| Periods := Input("Time Periods",1,1000, 10);
|
| Direction := CLOSE - Ref(CLOSE,-periods);
|
| Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods);
|
| ER := Abs(Direction/Volatility);
|
| FastSC := 2/(2 + 1);
|
| SlowSC := 2/(30 + 1);
|
| SSC := ER * (FastSC - SlowSC) + SlowSC;
|
| Constant := Pwr(SSC,2);
|
| AMA := If(Cum(1) = periods +1, Ref(CLOSE,-1) + constant * (CLOSE -
| Ref(CLOSE,-1)),PREV + constant * (CLOSE - PREV));
|
| AMA
|
|
|