[PEL] 复制代码 input:n(4,1,100,10),p1(3,2,40,4),p2(2,2,40,4);//参数设置
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,P1,1);
D:SMA(K,P2,1);
J:3*K-2*D,NODRAW;
kdjjc:cross(k,d),NODRAW;//kdj金叉
kdjsc:cross(d,k),NODRAW;
GLOBALVARIABLE:t:=0,currentC:=0;
timecd:CURRENTTIME>=093000 and CURRENTTIME<=095500;//时间条件
Dc:CALLSTOCK(''vtCLOSE,6,-1);//昨日收盘价
if (CURRENTTIME-t>=10) then //每10秒更新一次记录
begin
t:=CURRENTTIME;
currentC:=c;
end
SS1:=Intpart(20000/(c*100))*100;//开仓手数,按照2w算的。
if currentC<Dc*0.09 and (DYNAINFO(7)-Dc)/Dc>=0.09 and kdjjc and timecd and CURRENTTIME-t<10 and TBUYHOLDINGEX('','',2)=0
then
begin
tbuy(1,SS1,mkt);
end
|