没有开平仓函数,取不了avgenterprice
举个简单的例子,用全局变量来记录最大最小值
variable:aa=0,bb=10000;
if cross(ma(c,5),ma(c,60)) then begin
sellshort(holding<0,0,thisclose);
buy(holding=0,1,thisclose);
aa:=0;
bb:=10000;
end
if cross(ma(c,60),ma(c,5)) then begin
sell(holding>0,0,thisclose);
buyshort(holding=0,1,thisclose);
aa:=0;
bb:=10000;
end
if h>aa then aa:=h;
if l<bb then bb:=l;
aa1:aa;
bb1:bb;
用我的那一段直接改改不就成了