现在由于四大交易所各个开盘收盘时间不一样,导致一些程序没有适应性,
现在求一个日内的写法,为各个适应性强
这是上海螺的一分钟的K线的日内的时间表
T1:=time>010100 and time <045900;
T2:=time>130100 and time<185900;
T3:=time>=045900 and time<050000;
T4:=time>=185900 and time<190000;
开仓时间:=T1 or T2;
平仓时间:=T3 or T4;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,P1,1);
D:=SMA(K,P2,1);
就这样一个系统,
金买死卖
看你的写法是只分早晚,中午的那段休息不单独列出来,是吧?
是的,夜盘一个节奏,白盘一个节奏
没有夜盘则只是白盘
MM:=marketlabel;
if strcmp(mm,'ZJ')=0 then begin
kc:=time>091500 and time<151400;
pc:=time>=151400 and time<=151500;
end
if strcmp(mm,'SQ')=0 then begin
kc:=(time>010000 and time<062900) or (time>130000 and time<185900);
pc:=(time>=062900 and time<=063000) or (time>=185900 and time<=190000);
end
if strcmp(mm,'ZQ')=0 then begin
kc:=(time>010000 and time<032900) or (time>130000 and time<185900);
pc:=(time>=032900 and time<=033000) or (time>=185900 and time<=190000);
end
if strcmp(mm,'DQ')=0 then begin
kc:=(time>010000 and time<062900) or (time>130000 and time<185900);
pc:=(time>=062900 and time<=063000) or (time>=185900 and time<=190000);
end
kc就是开仓时间
pc就是平仓时间
原来你针对的是不同的合约啊?那么你强调市场干什么,
为的是程序更好的适应各个品种
MM:=strleft(stklabel,2);
drawtext(islastbar,close,mm);
if strcmp(mm,'RB')=0 then begin
kc:=(time>010000 and time<045900) or (time>130000 and time<185900);
pc:=(time>=045900 and time<=050000) or (time>=185900 and time<=190000);
end
if strcmp(mm,'AG')=0 then begin
kc:=(time>010000 and time<062900) or (time>130000 and time<185900);
pc:=(time>=062900 and time<=063000) or (time>=185900 and time<=190000);
end
类似这样的枚举法,
注意1:通用的可以把全部满足符合的都写上。比如说第二个,在IF strcmp(mm,'AG')=0后面还可以加上or strcmp(mm,'AU')=0
注意2:有的合约只有英文缩写只有一个,那么mm就不能通用了,需要特别的定义。比如说豆粕,需要写成strcmp(strleft(stklabel,1),'M')=0,参数改为1,取一个字母
这样运行速度就会慢,对于轮询不适当的,
是否可以
t1:TIMETOT0(closetime(4))-120;
t2:TIMETOT0(closetime(1))-120;
t4:TIME0;
T3:TIME0>t1 or (TIME0 > t2 and time<=closetime(1));
平仓时间:T3;