以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  代码问题 好奇怪,为什么信号会延后?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=141434)

--  作者:zengxing
--  发布时间:2016/10/20 15:37:58
--  代码问题 好奇怪,为什么信号会延后?
应该在 (diff>=0.03 or (hhv(h,10)-LLV(l,10))>=0.15) 满足条件后,macd指标出现金叉后,应该马上第二个K线就做交易,但为什么会经常延后2,3根?是为什么?
就是说,相交是需要2个K线判别的,第三根应该马上做交易的,但经常延后2,3根开仓,是为什么?

multipler:=10;

macd:=stkindi(\'\',\'macd.macd1\',0,datatype);
diff:=stkindi(\'\',\'macd.diff\',0,datatype);
atr:=stkindi(\'\',\'atr.atr\',0,datatype);


if cross(macd,0) and  (diff>=0.03 or (hhv(h,10)-LLV(l,10))>=0.15) then begin
   sellshort(1,0,market);
   buy(holding=0,1,market);
end
 
if cross(0,macd) and  (diff>=0.03  or  (hhv(h,10)-LLV(l,10))>=0.15) then begin
   sell(1,0,market);
   buyshort(holding=0,1,market);
end

if openprofit/multipler>1.5*atr then begin
   sell(1,0,marketr);
   sellshort(1,0,market);
end
 
if openprofit<0 and abs(openprofit)/multipler>1.5*atr then begin
   sell(1,0,marketr);
   sellshort(1,0,market);
end
--  作者:jinzhe
--  发布时间:2016/10/20 15:44:08
--  
是k线图上信号延后了,还是开仓时比k线图上信号慢了几根k线?
--  作者:zengxing
--  发布时间:2016/10/20 15:50:54
--  
k线图上信号延后了,实际开仓还没有测。
现在只是看K线图上的信号。不是每次都延后,有的时候延后,有的时候不延后。。不会插入截图。。。

--  作者:jinzhe
--  发布时间:2016/10/20 15:55:15
--  

http://www.weistock.com/bbs/dispbbs.asp?boardid=2&Id=31614&page=3

论坛贴图方式


--  作者:zengxing
--  发布时间:2016/10/20 16:17:16
--  
您好,您看一下,一共4次穿越,1,4次就是有延后的,2,3次是正常的
已经上传图了,您能看见吗?

[此贴子已经被作者于2016-10-20 16:18:36编辑过]

--  作者:jinzhe
--  发布时间:2016/10/20 16:29:44
--  
没有图,用户再传一下,用上面链接里面的办法
--  作者:zengxing
--  发布时间:2016/10/20 16:32:39
--  
真的已经搞了,没有您帖子“步骤1”的那个“上传”选项,做了2,3步,已经做了,都提示“今天还可上传97个”了
实在不行,给我个邮箱吧

--  作者:jinzhe
--  发布时间:2016/10/20 16:39:58
--  
换IE浏览器,你重新截图上传
--  作者:jinzhe
--  发布时间:2016/10/20 16:40:58
--  

一般是不会慢2,3根k线的,你再仔细看看


--  作者:zengxing
--  发布时间:2016/10/20 16:47:32
--  
真的。。。是慢呀。。IE打不来。。。有邮箱吗?