追踪止损公式怎么写
//追踪止损{stps:ref(if(holding<0,if(enterprice-llv(l,openbar)>=mindiff*step,enterprice+d*mindiff-ceiling((enterprice-llv(l,openbar))/mindiff/step)*step*mindiff,enterprice+d*mindiff),draw**),1);stpl:ref(if(holding>0,if(hhv(h,openbar)-enterprice>=mindiff*step,floor(((hhv(h,openbar)-enterprice)/mindiff/step))*step*mindiff+enterprice-d*mindiff,enterprice-d*mindiff),draw**),1);if h>=stps and holding<0 then begin//d---d个价位止损;step---步长;stps----空单止损位;sellshort(holding<0,holding,stopr,stps);//止空end;if l<=stpl then begin//d---d个价位止损;step---步长;stpl----多单止损位;sell(holding>0,holding,stopr,stpl);//止多end; 20210311