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
![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E)
-
This reply was modified 2 years, 1 month ago by
dreamscat.