AAAASVE_TRENDS_TrailAAAASVE_TRENDS_TrailAAAAPeriodèÛIšAAAAAAatrfact âèšAAAAKEAAAAHAAqAAAAL«AAÀAAAAHAAìAAAAL«AAAAAAMOVAAAAPricetïvšAAAAAALengthp¾ešAAAAAAMethodp¾ešAAAALAAAAHAAxAAAAL«AAÇAAAAHAAóAAAAL«AA%AAAAMOVAAAAPricetïvšAAAAAALengthp¾ešAAAAAAMethodp¾ešAAAAAAAAAIFFAAAA Condition= Ref(L, -1), Ref(C, -1) - L, (Ref(C, -1) - L) - (Ref(L, -1) - H) / 2); diff1:=Max(HiLo, Href); diff2:=Max(diff1, Lref); atrmod:=EMA(diff2,period); loss:=atrfact*atrmod; support := iff(L >= Ref(L, -2) and Ref(L, -1) >= Ref(L, -2) and Ref(L, -3) >= Ref(L, -2) and Ref(L, -4) >= Ref(L, -2), Ref(L, -2), iff(L >Ref(H, -1) * 1.0013, Ref(H, -1) * 0.9945, iff(L > this\1\ * 1.1, this\1\ * 1.05, this\1\))); if HISTORYSIZE <= period then result := C; else begin if C > this\1\ AND C\1\ > this\1\ then result := Max(this\1\,support); else begin if C < this\1\ then result := Min(this\1\,C+loss); else begin if C > this\1\ then result := support; else result := C+loss; end; end; end; return result;AA