merhaba,
al
hilo:HPeriod:=opt1;
LPeriod:=opt2;
periods:=opt3;
periods2:=opt4;
periods3:=opt5;
HLd:=If(C>Ref(Mov(H,HPeriod,S),-1),1,If(C<Ref(Mov(L,LPeriod,S),-1),-1,0));
HLv:=ValueWhen(1.,HLd<>0,HLd);
HiLo:=IF(HLv=-1,Mov(H,HPeriod,S),Mov(L,LPeriod,S));
Pds:=Periods+1;
FastSC:=2/(periods2+1);
SlowSC:=2/(periods3+1);
{Kaufman Adaptive Moving Average}
Direction:=Abs(C-Ref(C,-periods));
Volatility:=Sum(Abs(C-REF(C,-1)),periods);
ER:=Direction/Volatility;
SSC:=ER*(FastSC-SlowSC)+SlowSC;
Constant:= POWER(SSC,2);
KAMA:=If(Cum(1) = Pds,Ref(C,-1)+Constant*(C-Ref(C,-1)),PREV+Constant*(C-PREV));
cross(KAMA,HiLo)
sat
hilo:HPeriod:=opt1;
LPeriod:=opt2;
periods:=opt3;
periods2:=opt4;
periods3:=opt5;
HLd:=If(C>Ref(Mov(H,HPeriod,S),-1),1,If(C<Ref(Mov(L,LPeriod,S),-1),-1,0));
HLv:=ValueWhen(1.,HLd<>0,HLd);
HiLo:=IF(HLv=-1,Mov(H,HPeriod,S),Mov(L,LPeriod,S));
Pds:=Periods+1;
FastSC:=2/(periods2+1);
SlowSC:=2/(periods3+1);
{Kaufman Adaptive Moving Average}
Direction:=Abs(C-Ref(C,-periods));
Volatility:=Sum(Abs(C-REF(C,-1)),periods);
ER:=Direction/Volatility;
SSC:=ER*(FastSC-SlowSC)+SlowSC;
Constant:= POWER(SSC,2);
KAMA:=If(Cum(1) = Pds,Ref(C,-1)+Constant*(C-Ref(C,-1)),PREV+Constant*(C-PREV));
cross(HiLo,KAMA)
şeklinde yazılabilir
bilgilerinize