如附件中,。
为什么在3771到3765区间 一下才做空??
上方就不做空?
我根本没有审定这个区间参数啊。
[此贴子已经被作者于2012-10-21 20:39:30编辑过]
代码是这样的
short:=close[DATACOUNT-1]>MA1 and close<=MA1-10*MINDIFF and MACD<0 and MACD5>0 and holding =0;
if short then
begin
flag :=1;
stloss :=maxlow;
stprice := close - (maxlow -close );
buyshort(holding=0,lots,THISCLOSE);
end;
if (close <stprice and flag=1 and holding <0) then
begin
sellshort(holding<0,lots/2,THISCLOSE);
flag :=0;
stloss := close + (maxlow - close)/2.0;
end;
if ((MA1+MINDIFF*STOPLINE <close or close> stloss )and holding<0 ) THEN
begin
sellshort(holding<0,-holding,THISCLOSE);
flag:=0;
end;