Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共20 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:求高手编一个时间开盘收盘的问题

1楼
haizxj 发表于:2015/3/3 10:16:43

现在由于四大交易所各个开盘收盘时间不一样,导致一些程序没有适应性,

现在求一个日内的写法,为各个适应性强

这是上海螺的一分钟的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);

就这样一个系统,

金买死卖

 

 

[此贴子已经被作者于2015/3/3 10:16:55编辑过]
2楼
jinzhe 发表于:2015/3/3 10:21:09
也就是希望一个 公式能够对应全部的交易所的交易时间,是吧?
[此贴子已经被作者于2015/3/3 10:21:18编辑过]
3楼
jinzhe 发表于:2015/3/3 10:25:40

看你的写法是只分早晚,中午的那段休息不单独列出来,是吧?

4楼
haizxj 发表于:2015/3/3 10:28:45

是的,夜盘一个节奏,白盘一个节奏

 

没有夜盘则只是白盘

[此贴子已经被作者于2015/3/3 10:29:15编辑过]
5楼
jinzhe 发表于:2015/3/3 10:34:19


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就是平仓时间

6楼
haizxj 发表于:2015/3/3 10:35:19
问题是上期夜盘的螺和金银收盘时间不同,不对的
[此贴子已经被作者于2015/3/3 10:36:03编辑过]
7楼
jinzhe 发表于:2015/3/3 10:36:25

原来你针对的是不同的合约啊?那么你强调市场干什么,

8楼
haizxj 发表于:2015/3/3 10:43:14

为的是程序更好的适应各个品种

 

9楼
jinzhe 发表于:2015/3/3 10:47:22

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,取一个字母

10楼
haizxj 发表于:2015/3/3 11:03:22

这样运行速度就会慢,对于轮询不适当的,

是否可以

 

t1:TIMETOT0(closetime(4))-120;
t2:TIMETOT0(closetime(1))-120;
t4:TIME0;
T3:TIME0>t1     or  (TIME0 > t2  and time<=closetime(1));        
平仓时间:T3;

共20 条记录, 每页显示 10 条, 页签: [1] [2]


Powered By Dvbbs Version 8.3.0
Processed in 0.01953 s, 3 queries.