Reply To: รบกวนขอสูตรทั้งหมดสำหรับ Amibroker ครับ

#24361
dreamscat
Keymaster

PnT 1.1

Pct=Param(“Pct”,1,0.1,2,0.1);
Pk=Peak(C,Pct,1); Tr=Trough(C,Pct,1);
Upper=Ref(ValueWhen(Pk!=Ref(Pk,-1),C,1),-1);
Lower=Ref(ValueWhen(Tr!=Ref(Tr,-1),C,1),-1);
Grn=BarsSince(Cross(C,Upper))<BarsSince(Cross(Lower,C));
Red=BarsSince(Cross(C,Upper))>BarsSince(Cross(Lower,C));
BarColor=Iif(Grn,colorGreen,colorRed);
Plot(C,_DEFAULT_NAME(),BarColor,styleCandle);
Plot(Upper,”Upper”,colorGreen,styleDashed);
Plot(Lower,”Lower”,colorRed,styleDashed);