以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  我加载在1秒图上应用  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=71851)

--  作者:wuch515
--  发布时间:2014/11/10 16:34:46
--  我加载在1秒图上应用
 

我加载在1秒图上应用,
突破半小时内最低价超过3点平多开空
突破半小时内最高价超过3点平空开多

(当前时间之前的半小时内)

 

开仓后有大于10点的利润并且利润回撤30%则平仓

 

循环执行,未平仓不允许开仓
--  作者:jinzhe
--  发布时间:2014/11/10 16:41:19
--  

if l<ref(llv(l,30*60),1)-3 then begin

    sell(1,0,market);

    buyshort(holding=0,1,market);

end

 

if h>ref(hhv(h,30*60),1)+3 then begin

     sellshort(1,0,market);

     buy(holding=0,1,market);

end

 

if holding>0 and h-enterprice>10 and (hhv(openprofit,enterbars+1)-openprofit)/hhv(openprofit,enterbars+1)>0.3 then sell(1,0,market);

 

if holding<0 and enterprice-l>10 and (hhv(openprofit,enterbars+1)-openprofit)/hhv(openprofit,enterbars+1)>0.3 then sellshort(1,0,market);


--  作者:wuch515
--  发布时间:2014/11/11 8:41:55
--  

测试的时候无数据??


--  作者:jinzhe
--  发布时间:2014/11/11 9:04:03
--  
你切换到1秒中k线上,看看有没有足够多的数据