等级: 免费版
- 注册:
- 2022-4-14
- 曾用名:
|
下面策略提示未定义开空和开多,老师帮忙修改一下。
input:ss(1,1,10000,1);
if holding=0 then begin
if 开多条件 then
buy(1,ss,limitr,open);
end
if holding=0 then begin
if 开空条件 then
buyshort(1,ss,limitr,open);
end
//统计出场和止损的次数
variable:n1=0,n2=0,entry=0;
//止损2个atr
if holding>0 and low<enterprice-2*entry and holding>0 then
begin
sell(1,holding,marketr);
n1:=n1+1;
end
if holding<0 and high>enterprice+2*entry and holding<0 then
begin
sellshort(1,holding,marketr);
n1:=n1+1;
end
//破短期高低位,平仓出场
INPUT:Y(10,1,100,5);
Y周期高点:=REF(HHV(H,20),1);
Y周期低点:=REF(LLV(L,20),1);
if low<Y周期低点 and holding>0 then
begin
止损:=sell(1,holding,marketr);
n2:=n2;
end
if high>Y周期高点 and holding<0 then
begin
止损:=sellshort(1,holding,marketr);
n2:=n2;
end
//止损条件止损
if holding>0 then begin
if time>=closetime(0) or 平多条件 then
sell(1,holding,limitr,close);
end
if holding<0 then begin
if time>=closetime(0) or 平空条件 then
sellshort(1,holding,limitr,close);
end
盈亏:asset,noaxis,coloryellow,linethick1;
|
|