以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- [求助]时间问题 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=80554) |
-- 作者:渴望知识 -- 发布时间:2015/7/8 10:47:14 -- [求助]时间问题 金折,下面的代码是我曾经询问过的,但是正好今天有跌停,我验证了有下,输出不对啊: if rmmr<>dynainfo(28) and tholding<>0 then begin rmmr:=dynainfo(28);//当前买入价 rmmrtime:=timetot0(dynainfo(207));//当前买入价起始时间 end if rmmc<>dynainfo(34) and tholding<>0 then begin rmmc:=dynainfo(34);//当前卖出价 rmmctime:=timetot0(dynainfo(207));//当前卖出价起始时间 end rmmrcxsj:=timetot0(dynainfo(207))-rmmrtime;//当前买入价持续时间 rmmccxsj:=timetot0(dynainfo(207))-rmmctime;//当前卖出价持续时间 DEBUGFILE(\'D:\\金子塔调试文件保存\\TEST.TXT\',\'买入持续时间为 %.0f\',RMMRCXSJ); DEBUGFILE(\'D:\\金子塔调试文件保存\\TEST.TXT\',\'卖出持续时间为 %.0f\',RMMCcxsj); [此贴子已经被作者于2015/7/8 10:48:11编辑过]
|
-- 作者:渴望知识 -- 发布时间:2015/7/8 10:50:00 -- 这个输出的咋都是0或-1呢? |
-- 作者:jinzhe -- 发布时间:2015/7/8 10:51:52 -- 把我原来回答问题的链接,再发一下 |
-- 作者:渴望知识 -- 发布时间:2015/7/8 10:54:46 -- http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=79973&authorid=0&page=0&star=1 |
-- 作者:jinzhe -- 发布时间:2015/7/8 10:56:15 -- 用extgbdataset试试 [此贴子已经被作者于2015/7/8 10:56:42编辑过]
|
-- 作者:渴望知识 -- 发布时间:2015/7/8 10:57:10 -- 我现在代码中,起始定义RMMR和RMMC为1,也就是: GLOBALVARIABLE:rmmr=1,rmmc=1;
|
-- 作者:渴望知识 -- 发布时间:2015/7/8 11:10:01 -- 啊,必须要用EXTGBDATASETAMT吗?我就是想避免这个东西的,因为其他的策略里也用用到这个代码的。 我不想改的太多了,不然就乱了。
|
-- 作者:jinzhe -- 发布时间:2015/7/8 11:10:32 -- 你先试对了 |
-- 作者:渴望知识 -- 发布时间:2015/7/8 11:32:30 -- 还是输出不对啊。拿螺纹钢来试的,总是输出-1 。 //价位持续一定时间后的处理 if extgbdata(\'rmmr\')=0 then extgbdataset(\'rmmr\',1); if extgbdata(\'rmmc\')=0 then extgbdataset(\'rmmc\',1); if extgbdata(\'rmmrtime\')=0 then extgbdataset(\'rmmr\',1); if extgbdata(\'rmmctime\')=0 then extgbdataset(\'rmmc\',1); if extgbdata(\'rmmr\')<>dynainfo(28) and tholding<>0 then begin extgbdataset(\'rmmr\',dynainfo(28));//当前买入价 rmmrtime:=extgbdataset(\'rmmrtime\',timetot0(dynainfo(207)));//当前买入价起始时间 end if extgbdata(\'rmmc\')<>dynainfo(34) and tholding<>0 then begin extgbdataset(\'rmmc\',dynainfo(34));//当前卖出价 rmmctime:=extgbdataset(\'rmmctime\',timetot0(dynainfo(207)));//当前卖出价起始时间 end rmmrcxsj:=timetot0(dynainfo(207))-rmmrtime;//当前买入价持续时间 rmmccxsj:=timetot0(dynainfo(207))-rmmctime;//当前卖出价持续时间 DEBUGFILE(\'D:\\金子塔调试文件保存\\TEST.TXT\',\'买入持续时间为 %.0f\',RMMRCXSJ); DEBUGFILE(\'D:\\金子塔调试文件保存\\TEST.TXT\',\'卖出持续时间为 %.0f\',RMMCcxsj); |
-- 作者:jinzhe -- 发布时间:2015/7/8 13:22:10 -- if extgbdata(\'rmmr\')=0 then extgbdataset(\'rmmr\',1);
dd:timetot0(dynainfo(207)); |