以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  交易时间没结束,K线不再产生怎么写?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=141909)

--  作者:JDS
--  发布时间:2016/10/27 20:29:46
--  交易时间没结束,K线不再产生怎么写?
交易所交易时间没有结束,分钟K图中最新一根棒的todaybar不再増加,
并且time<=closetime(0)并且time不再增加。
请问客服老师怎么写?

--  作者:jinzhe
--  发布时间:2016/10/28 9:25:51
--  
timetot0(currenttime)<=timetot0(closetime(0)) and timetot0(currenttime)>time0-60 and date=currentdate
--  作者:JDS
--  发布时间:2016/10/28 13:53:29
--  
以下是引用jinzhe在2016-10-28 9:25:51的发言:
timetot0(currenttime)<=timetot0(closetime(0)) and timetot0(currenttime)>time0-60 and date=currentdate
老师,上面减60是对应的1分钟K线吧,我希望能分钟K通用之公式,请修改下。谢谢


--  作者:jinzhe
--  发布时间:2016/10/28 14:11:47
--  
没有通用的方法,各种分钟线要自行修改一下
--  作者:JDS
--  发布时间:2016/10/28 14:23:55
--  
通过DATATYPE的读取,然后转化成对应分钟数或秒数。
这样的思路可否把上面公式写成通用之公式呢。


--  作者:jinzhe
--  发布时间:2016/10/28 14:27:26
--  

那也是要枚举的

 

if datatype=1 then n:=60;

if datatype=2 then n:=60*5;

if datatype=3 then n:=60*15;

.....而且还不能判断多分钟周期

 

timetot0(currenttime)<=timetot0(closetime(0)) and timetot0(currenttime)>time0-n and date=currentdate


--  作者:JDS
--  发布时间:2016/10/28 15:18:15
--  
谢谢