模型策略源码:input:P(26,20,100,8);
input:S(12,5,40,4);
input:B1(26,5,300,30);
input:B2(2,0.1,10,1);
input:N2(10,1,120,12);
input:N3(20,1,200,20);
input:N4(60,1,200,20);
ma2:=ma(c,n2);
ma3:=ma(c,n3);
ma4:=ma(c,n4);
MID := MA(CLOSE,B1);
UPPER:= MID + B2*STD(CLOSE,B1);
LOWER:= MID - B2*STD(CLOSE,B1),colorred;
diff := EMA(CLOSE,S) - EMA(CLOSE,P);
variable:vmin = 091500;
//用于隔夜高开或低开时间差
if (abs(o-ref(c,1))>=20*MINDIFF AND time>090000 and timeupper and diff>0 and c>o and c>ma4 AND HOLDING=0 AND time>vmin AND time0,HHV(HIGH,TYPEBAR(1,1))-110*mindiff,l-110*mindiff);
//多单移动止损线
PARTLINE( holding>0, bline, colorrgb(255,0,0));
BLIQCON:= (holding>0 and cross(ma3,ma2)) or (holding>0 and bline>c);
//开空仓条件:
SOPCON1:=cvmin AND time151000 and holding>0,holding,market);
sellshort(time>151000 and holding<0,holding,market);
可用现金:CASH(0),LINETHICK0;
持仓:HOLDING,LINETHICK0;
资产:ASSET,LINETHICK0;