 
等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
请教:测股票日线,从2022-7-1 到现在中间为啥没平仓?
warning_disable:1;
warning_disable:4;
warning_disable:9;
variable:signzsd=0,signzsk=0;
/////////////////////////////////////////////////////////////////////////
//期货帐号:='11150002';//下单账户
//下单品种:='rb00';
//tq:if(timetot0(closetime(1))=time0,4,if(timetot0(closetime(2))=time0,4,if(timetot0(closetime(3))=time0,4,if(timetot0(closetime(4))=time0,4,3)))),nodraw;
//abb:=(abs((time0 - timetot0(if(islastbar,dynainfo(207),time)))) < tq);
/////////////////////////////////////////////////////////////////////////
{}
input: x(1,0.05,2,0.05),a1(5,1,34,1),a2(34,3,100,1);
input: tperiod(8,0,8,1);
{}
//ss:=1;//ss:=1000000/c;//
ss:=ASSET/c*x;
/////////////////////macd////////////////////
{}
DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);
DEA := EMA(DIFF,9);
MACD880 := 2*(DIFF-DEA), COLORSTICK;
macd881:=stkindi('000300','macd.macd1',0,tperiod,-1);//板块 macd状态
macd882:=stkindi('399901','macd.macd1',0,tperiod,-1);//板块 macd状态
{
rsi1:=stkindi('','rsi.rsi1(12,39)',0,tperiod,-1);
rsi2:=stkindi('','rsi.rsi2(12,39)',0,tperiod,-1);
{}
//////////////////////////////////涨跌停///////////////////////////////////////
日线昨收:callstock(stklabel(),vtclose,6,-1),nodraw;
日涨停:rounds(日线昨收*(1+0.1-0.003),2),nodraw;
日跌停:rounds(日线昨收*(1-0.1+0.003),2),nodra;
pd:= MACD880<0 and macd880<ref (macd880,1);// and MACD881<0 and macd881<ref (macd881,1) and MACD882<0 and macd882<ref (macd882,1) ;
if pd then begin
signzsd:=0;
if holding>0 then begin
// tsell(abb,holding and close>日跌停,lmt,jgs-jc*mindiff,0,期货帐号,下单品种);
平多:sell(holding>0 ,abs(holding),marketr),colorgreen;// and close>日跌停;
end
end
{}
kd:=signzsd=0 and((( macd880<0 and macd880>ref (macd880,1))) or macd880>0) and( ((( macd881<0 and macd881>ref(macd881,1))) or macd881>0));//and (( macd881<0 and macd881>ref (macd881,1))) and (( macd882<0 and macd882>ref (macd882,1)));//
//kd:=signzsd=0 and( (( macd880<0 and macd880>ref (macd880,1))) or macd880>0) and rsi1>rsi2 and rsi2>50;//and (( macd881<0 and macd881>ref (macd881,1))) and (( macd882<0 and macd882>ref (macd882,1)));//
if kd and signzsd=0 then begin
//tbuy(holding=0 and close<日涨停 and abb,ss,lmt,jgx+jc*mindiff,0,期货帐号,下单品种);
// 开多:buy(holding=0 and close<日涨停,ss,NEXTOPEN),colorred;
开多:buy(holding=0 ,ss,NEXTOPEN),colorred;
//开多:buy(holding=0 ,ss,NEXTOPEN),colorred;
end
|
|