PureBytes Links
Trading Reference Links
|
Steve Duval wrote:
> In the latest issue of Stocks & Commodities, Perry Kaufman talks about his AMA. I am interested in this trading system and wonder if anyone has put
> this into a trading system and as an indicator for SuperCharts 4.0? Also, any comments relative to this system would be much appreciated.By the way,
> Happy New Year!Steve
=============================
inputs: period(10),filter(.3);Input:smthlen(1);
vars: noise(0),signal(0),dff(0),efratio(0),extlow(0),exthigh(0),
smooth(smthlen),fastend(.666),slowend(.0645),AMA1(0);
{CALCULATE EFFICIENCY RATIO}
dff = @AbsValue(close - close[1]);
if(currentbar <= period)then AMA1 = close;
if (currentbar > period)then begin
signal = @AbsValue(close - close[period]);
noise = @Summation(dff,period);
efratio = signal/noise;
smooth = @Power(efratio*(fastend - slowend) + slowend,2);
{ADAPTIVE MOVING AVERAGE}
AMA1 = AMA1[1] + smooth*(close - AMA1[1]);
{TREND CHANGE FILTER FROM LAST TURN}
if(AMA1 > AMA1[1] and AMA1[1] < AMA1[2]) then extlow = AMA1[1];
if (AMA1 < AMA1[1] and AMA1[1] > AMA1[2]) then exthigh = AMA1[1];
{TRADING SIGNALS}
if(currentbar > period + 5)then begin
if (AMA1 > AMA1[1] and AMA1 - extlow > filter) then buy AT MARKET ;
if (AMA1 < AMA1[1] and exthigh - AMA1 > filter) then sell AT MARKET;
end;
end;
|