老师,我想让我的出场点不受加仓的影响,该怎么设置,不然加仓之后,出场点都变了。
if DEA>0 and macd>0 and macd>ref(macd,1) and (ref(c,1)-ref(c,2))/ref(c,2)<0 and isup and (c-ref(c,1))/ref(c,1)<0.005 and abb then buy(holding=0,ss,marketr);
if DEA>0 and (c-ref(c,1))/ref(c,1)<0 and macd>0 and abb and holding=ss and openprofit>0 and enterbars>=3 then buy(holding=ss,m,marketr);
if c<enterprice-15 and abb or macd<ref(macd,1) and abb and holding>0 then sell(1,0,marketr);
nn:=barslast(cross(holding<>0,0.5));
if (c<ref(enterprice,nn+1) and abb) or (macd<ref(macd,1) and abb) and holding>0 then sell(1,0,marketr);
看不太懂,麻烦老师直接帮我加到下面的平仓条件中吧,谢谢啦
多头平仓条件if majj<ref(majj,1) and abb or c<enterprice-5 and abb and holding>0 then sell(1,0,marketr);
空头平仓条件if majj>ref(majj,1) and abb or c>enterprice+5 and abb and holding<0 then sellshort(1,0,marketr);
nn:=barslast(cross(holding<>0,0.5));
if ((majj<ref(majj,1) and abb) or (c<ref(enterprice,nn+1)-5 and abb )) and holding>0 then sell(1,0,marketr);
if ((majj>ref(majj,1) and abb) or (c>ref(enterprice,nn+1)+5 and abb )) and holding<0 then sellshort(1,0,marketr);