Hello,
I meet a difficulty to plot a Kaufman AMA function from AB menu Charts
| Averages
I installed two AFL scripts as follows.
I created,with notepad, a function that is saved in dir C:\Program
Files\AmiBroker\Formulas\Include\KamaFunction.afl
function KamaFunction(P,periods,fast,slow)
{
T1=periods;
V2=fast;
V3=Slow;
F1=2/(V2+1);
S1=2/(V3+1);
ER=(abs(P-Ref(P,-T1))/Sum(abs(P-Ref(P,-1)),T1));
A1=ER*(F1-S1)+S1;
A2=A1^2;
kama = AMA2(P,A2,1-A2);
return kama;
}
I created,with notepad, an afl that is saved in dir C:\Program
Files\AmiBroker\Formulas\Averages\KAMA - Kaufman Adaptive Moving
Average.afl
#include_once<KamaFunction.afl>
P = ParamField("Price field",-1);
Periods = Param("Periods", 14, 2, 200, 1, 10 );
fast = Param("Fast", 2, 2, 200, 1, 10 );
slow = Param("Slow", 30, 2, 200, 1, 10 );
Plot(KamaFunction( P, Periods, fast, slow ), _DEFAULT_NAME(),
ParamColor( "Color", colorCycle ), ParamStyle("Style") );
When I insert or overlay from Charts | Average, the KAMA simple plot
on the close does not appear until I click on to the chart. Then the
plot appears instantly.
Another annoying thing, the AA backtest does not run a trading system
that use the KamaFunction.
I implanted a Hull MA and a T3 MA the same way, both are plotted
without click and the respectives functions are recognized by backtester.
I would appreciate any help to find the tiny blocking point, my ideas
ran out...
Regards