merhaba,
diğer dillere hakim olmadığımızdan bu tür formül isteklerine olumlu dönüş yapamıyoruz,
ancak bizlerde bulunan trailstop dan türettiğimiz istenilen periyodlarda yapılan aşağıdaki formülleri deneyebilirsiniz,
bilgilerinize
period:=10;
coeff:=3;
AP:=C;
period1:=5;
coeff1:=0.5;
AP1:=C;
OFFSET:=coeff*ATRe(period);
STR:=AP+OFFSET;
STS:=AP-OFFSET;
FUB:=IF(STR<PREV OR REF(C,-1)>PREV,STR,PREV);
FLB:=IF(STS>PREV OR REF(C,-1)<PREV,STS,PREV);
OFFSET1:=coeff1*ATRe(period);
STR1:=AP1+OFFSET1;
STS1:=AP1-OFFSET1;
FUB1:=IF(STR1<PREV OR REF(C,-1)>PREV,STR1,PREV);
FLB1:=IF(STS1>PREV OR REF(C,-1)<PREV,STS1,PREV);
ATRStop:=IF(PREV=REF(FUB,-1) AND C<FUB,FUB,IF(PREV=REF(FUB,-1) AND C>FUB,FLB,IF(PREV=REF(FLB,-1) AND C>FLB,FLB,IF(PREV=REF(FLB,-1) AND C<FLB,FUB,fub))));
ATRStop1:=IF(PREV=REF(FUB1,-1) AND C<FUB1,FUB1,IF(PREV=REF(FUB1,-1) AND C>FUB1,FLB1,IF(PREV=REF(FLB1,-1) AND C>FLB1,FLB1,IF(PREV=REF(FLB1,-1) AND C<FLB1,FUB1,fub1))));
cross(ATRStop1,ATRStop)
sat
period:=10;
coeff:=3;
AP:=C;
period1:=5;
coeff1:=0.5;
AP1:=C;
OFFSET:=coeff*ATRe(period);
STR:=AP+OFFSET;
STS:=AP-OFFSET;
FUB:=IF(STR<PREV OR REF(C,-1)>PREV,STR,PREV);
FLB:=IF(STS>PREV OR REF(C,-1)<PREV,STS,PREV);
OFFSET1:=coeff1*ATRe(period);
STR1:=AP1+OFFSET1;
STS1:=AP1-OFFSET1;
FUB1:=IF(STR1<PREV OR REF(C,-1)>PREV,STR1,PREV);
FLB1:=IF(STS1>PREV OR REF(C,-1)<PREV,STS1,PREV);
ATRStop:=IF(PREV=REF(FUB,-1) AND C<FUB,FUB,IF(PREV=REF(FUB,-1) AND C>FUB,FLB,IF(PREV=REF(FLB,-1) AND C>FLB,FLB,IF(PREV=REF(FLB,-1) AND C<FLB,FUB,fub))));
ATRStop1:=IF(PREV=REF(FUB1,-1) AND C<FUB1,FUB1,IF(PREV=REF(FUB1,-1) AND C>FUB1,FLB1,IF(PREV=REF(FLB1,-1) AND C>FLB1,FLB1,IF(PREV=REF(FLB1,-1) AND C<FLB1,FUB1,fub1))));
cross(ATRStop,ATRStop1)