if barpos = 0 then
stopprice := l - stopnum;
if aspect = 0 then begin
//多頭處理
if l <= stopprice then begin
sell(holding>0,holding,0);
aspect:= 1;
stopprice := h+stopnum;
end
//處理移動的底部
if l - stopnum > stopprice then
stopprice := l-stopnum;
end
if aspect = 1 then begin
//空頭處理
if h >= stopprice then begin
sellshort(holding<0,holding,0);
aspect:= 0;
stopprice := l-stopnum;
end
//處理移動的底部
if h + stopnum < stopprice then
stopprice := h+stopnum;
end
dt:=Buy(開倉時間 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0) ,lots,LIMITR,Max(Open,UpperBand)+1*MINDIFF),orderqueue;
kt:=BuyShort(開倉時間 and NOT(TYPE(3)=1) and l<=LowerBand and (HOLDING=0) ,lots,LIMITR,Min(Open,LowerBand)-1*MINDIFF),orderqueue;
if dt then begin
buy(dt and NOT(TYPE(1)=1),10%,0);
end;
if kt then begin
buyshort(kt and NOT(TYPE(1)=3),10%,0);
end;
variable:n=0;
variable:m=0;
if barpos = 0 then
stopprice := l - stopnum;
if aspect = 0 then begin
//多頭處理
if l <= stopprice then begin
sell(holding>0,holding,0);
aspect:= 1;
stopprice := h+stopnum;
n:=1;
m:=0;
end
//處理移動的底部
if l - stopnum > stopprice then
stopprice := l-stopnum;
end
if aspect = 1 then begin
//空頭處理
if h >= stopprice then begin
sellshort(holding<0,holding,0);
aspect:= 0;
stopprice := l-stopnum;
m:=1;
n:=0;
end
//處理移動的底部
if h + stopnum < stopprice then
stopprice := h+stopnum;
end;
dt:=開倉時間 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0);
kt:=開倉時間 and NOT(TYPE(3)=1) and l<=LowerBand and (HOLDING=0);
if dt and m=1 then begin
buy(1,10%,0);
end;
if kt and n=1 then begin
buyshort(1,10%,0);
end;
這兩句用來是干什么的?
dt:=Buy(開倉時間 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0) ,lots,LIMITR,Max(Open,UpperBand)+1*MINDIFF),orderqueue;
kt:=BuyShort(開倉時間 and NOT(TYPE(3)=1) and l<=LowerBand and (HOLDING=0) ,lots,LIMITR,Min(Open,LowerBand)-1*MINDIFF),orderqueue;
這樣的胡亂賦值有什么意義?
l <= stopprice 上面代碼里面哪里有根據(jù)這個判斷條件開倉的?不都是l<=LowerBand 才開倉的?