等级: 免费版
- 注册:
- 2021-10-19
- 曾用名:
|
//开多单
if 短多 AND HOLDING=0 AND kcj=0 then
begin
多开:buy(1 and holding=0,SS,market);
kcj:= ENTERPRICE;
end
//平多单
if H>=kcj+N*MINDIFF AND HOLDING=SS then
begin
目标平多:sell(1,SS,LIMITR,kcj+N*MINDIFF);
kcj:=0;
end
//开多单2
if 短多 AND HOLDING=SS AND ENTERBARS>1 then
begin
多开2:buy(1,SS,market);
kcj2:= ENTERPRICE;
end
//平多单2
if H>=kcj2+5*MINDIFF AND HOLDING=SS*2 then
begin
目标平多2:sell(1,SS,LIMITR,kcj2+N*MINDIFF);
kcj2:= 0;
end
//开空单
if 短空 AND HOLDING=0 AND KKJ=0 then
begin
空开:BUYSHORT(1 and holding=0,SS,market);
KKJ:= ENTERPRICE;
end
//平空单
if L<=KKJ-N*MINDIFF AND HOLDING = -SS then
begin
平空:SELLSHORT(1,SS,LIMITR,KKJ-N*MINDIFF);
KKJ:=0;
end
//开空单2
if 短空 AND HOLDING=-SS AND ENTERBARS>1 then
begin
空开2:BUYSHORT(1,SS,market);
KKJ2:= ENTERPRICE;
end
//平空单2
if L<=KKJ2-5*MINDIFF AND HOLDING=(-SS)*2 then
begin
平空2:SELLSHORT(1,SS,LIMITR,KKJ2-N*MINDIFF);
KKJ2:= 0;
end
补充内容 (2023-12-8 15:58):
其中variable:kcj=0,kcj2=0;variable:KKJ=0,KKJ2=0;是全局变量
//开多单
if 短多 AND TBUYHOLDINGEX('','',2)=0 AND kcj=0 then
begin
多开:Tbuy(1 ,SS,MKT);
kcj:=TENTERPRICE; ...
补充内容 (2023-12-8 16:00):
我以上这样改对吗?为何无法得到正常回测数据? |
|