Reply To: Stop_Trail% ทำเขียวแดงยังไงครับ

#47795
dreamscat
Keymaster

Expert Advisor – Highlight – Green

perc:=14;
loss:=C*perc/100;
trail:=
If(C>PREV AND Ref(C,-1)>PREV,
Max(PREV,C-loss),
If(C<PREV AND Ref(C,-1)<PREV,
Min(PREV,C+loss),
If(C>PREV,C-loss,C+loss)));

Buy:=Cross(C,Trail);
Sell:=Cross(Trail,C);
Green:=BarsSince(Buy)<BarsSince(Sell);
Red:=BarsSince(Sell)<BarsSince(Buy);

Green;

 

Expert Advisor – Highlight – Red

perc:=14;
loss:=C*perc/100;
trail:=
If(C>PREV AND Ref(C,-1)>PREV,
Max(PREV,C-loss),
If(C<PREV AND Ref(C,-1)<PREV,
Min(PREV,C+loss),
If(C>PREV,C-loss,C+loss)));

Buy:=Cross(C,Trail);
Sell:=Cross(Trail,C);
Green:=BarsSince(Buy)<BarsSince(Sell);
Red:=BarsSince(Sell)<BarsSince(Buy);

Red

 

 

  • This reply was modified 2 years, 5 months ago by dreamscat.