以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  跳空未交叉  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=81179)

--  作者:COMBOY
--  发布时间:2015/7/15 22:10:28
--  跳空未交叉
K线直接跳空越过设定
的移动平均线,没有触发cross(ma60,c),遗漏报卖单,有什么语句办法可以弥补漏洞么?
图片点击可在新窗口打开查看此主题相关图片如下:tcakgf7t4i@6dz@g8buvn@5.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2015/7/15 22:12:07编辑过]

--  作者:COMBOY
--  发布时间:2015/7/15 22:57:10
--  

if cross(ma60,c) and time>091500 and time<151000 then begin
if holding>0 then sell(1,1,limitr,ma60) ;
if holding=0   then buyshort(1,1,limitr,ma60);
end


if cross(c,ma60) and time>091500 and time<151000 then begin

if holding<0 then sellshort(1,1,limitr,ma60) ;
if holding=0  then buy(1,1,LIMITR,ma60);
end

 

 

版主能否帮我修改下上面代码,使得即使发生k线跳空,没有cross也执行买多或买空 

[此贴子已经被作者于2015/7/15 22:57:17编辑过]

--  作者:jinzhe
--  发布时间:2015/7/16 8:50:59
--  

if cross(ma60,c) and time>091500 and time<151000 then begin
if holding>0 then sell(1,1,limitr,ma60),IGNORECHECKPRICE ;
if holding=0   then buyshort(1,1,limitr,ma60),IGNORECHECKPRICE;
end


if cross(c,ma60) and time>091500 and time<151000 then begin

if holding<0 then sellshort(1,1,limitr,ma60) ,IGNORECHECKPRICE;
if holding=0  then buy(1,1,LIMITR,ma60),IGNORECHECKPRICE;
end


--  作者:COMBOY
--  发布时间:2015/7/16 9:22:11
--  

多谢大佬