我想表达距离开仓后最高价4个报价单位设置止赢线,并且该最高价大于开仓价+4个报价单位,应该怎么表达呢?
a:=报价单位
hg:=hhv(h,ENTERBARS);
sell((holding>0 and hg-enterprice>4*a and c<=hg-4*a) ,1,limit,c);
这样写,好像不对,一开仓,马上就平仓,请教老师,谢谢~~~
variable:hh=0;
if h>hh then hh:=h;
if c<h-4*mindiff then sell(holding>0,1,limitr,enterprice+4*mindiff);