Merhaba,
Kırmıcıdan Yeşil-Maviye geçmesi,
period:=20;
coeff:=1;
AP:=5;
thisCCI := CCI(period);
lastCCI := Ref(thisCCI,-1);
upT:=L-ATR(AP)*coeff;
downT:=H+ATR(AP)*coeff;
MagicTrend:=If(thisCCI>=0,If(upT<PREV,PREV,upT),If(downT>PREV,PREV,downT));
MagicTrend>=REF(MagicTrend,-1) AND REF(MagicTrend,-1)<=REF(MagicTrend,-2)
Yeşil-Mavi Kırmızıya geçmesi
period:=20;
coeff:=1;
AP:=5;
thisCCI := CCI(period);
lastCCI := Ref(thisCCI,-1);
upT:=L-ATR(AP)*coeff;
downT:=H+ATR(AP)*coeff;
MagicTrend:=If(thisCCI>=0,If(upT<PREV,PREV,upT),If(downT>PREV,PREV,downT));
MagicTrend<=REF(MagicTrend,-1) AND REF(MagicTrend,-1)>=REF(MagicTrend,-2)