variable:n=0;
if 开仓条件 and 持仓判断 then begin
下单语句;
N:=n+1;
end//开多开空都要这样写,这里只写一个作为范例
ee:valuewhen(n=1,enterprice);//这就是所求的第一次开仓价
if time=closetime(0) then n:=0;//这句话写在代码最后
2.什么意思?
variable:n=0; if (TIME>=085600 AND TIME<=90000) then begin tbuy(1,100,lmt,DYNAINFO(54),0); tbuyshort(1,100,lmt,DYNAINFO(55),0); if THOLDING2=0 and (currenttime>=94000 and currenttime>=144000) then begin tbuy(val2>0,100,lmt,O,0); tbuyshort(val2>0,100,lmt,O,0); N:=n+1; End End ee:=valuewhen(n=1,enterprice);//这就是所求的第一次开仓价 If h-ENTERPRICE>=2 then begin tsellShort(1,10,lmt,ee+2,0); End If h-ENTERPRICE>=4 then begin tsell(1,10,lmt,ee+4,0); End 后台交易应该如何改? |
后台是差不多的用法
if extgbdata('biaoji')=0 and 开仓条件 then begin
下单语句;
extgbdataset('biaoji',1);
extgbdataset('kaicangjia',tenterprice);
end
if time=closetime(0) then BEGIN
extgbdataset('biaoji',0);
extgbdataset('kaicangjia',drawnull);
end
读取kaicangjia这个全局变量就行了,并且是在不等于0的情况下
你的那个把h-enterprice>4改成 (h-tenterprice)>4