以文本方式查看主题

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

--  作者:tomato
--  发布时间:2014/3/19 15:08:27
--  请挑错
初学金字塔,请各位老师挑错,日内,五分钟线,市价高于两个不同周期(5,10)的开盘价即买入,否则卖出,并添加止损条件。
input:t(10,1,100,5),d(5);
一倍周期开盘价:=ref(open,t),noaxis,nodraw;
两倍周期开盘价:=ref(open,2*t),noaxis,nodraw;
//交易条件
开多条件:=close>ref(open,t) and close>ref(open,2*t) and time<185500;
平多条件:=time=185500 or l<enterprice-d*mindiff;
开空条件:=close<ref(open,t) and close<ref(open,2*t)and time<185500;
平空条件:=time=185500 or h>enterprice+d*mindiff;;
//交易系统
sellshort(平空条件 and holding<0,holding,market);
buy(开多条件 and holding=0,1,market);
sell(平多条件 and holding>0,holding,market);
buyshort(开空条件 and holding=0,1,market);
恳请各位好心人帮忙看看,不胜感激,其中把止损离场和收盘前离场放在一起都用market,是不是可以?

--  作者:tomato
--  发布时间:2014/3/19 15:12:21
--  
感觉信号看着不太对呢,有同一根K线出现俩信号的时候,
图片点击可在新窗口打开查看此主题相关图片如下:6.jpg
图片点击可在新窗口打开查看

--  作者:jinzhe
--  发布时间:2014/3/19 15:13:17
--  
开多条件:=close>ref(open,t) and close>ref(open,2*t) and time<185500;
平多条件:=time=185500 or l<enterprice-d*mindiff;
开空条件:=close<ref(open,t) and close<ref(open,2*t)and time<185500;
平空条件:=time=185500 or h>enterprice+d*mindiff;
 
这里close> 都改成h>
close< 都改成l<
 
其他的可以用

--  作者:tomato
--  发布时间:2014/3/19 15:18:55
--  
谢谢您,我是想三线追杀,当前价格与之前两个不同周期的开盘价进行比较,所以用的close,不可以么?
--  作者:tomato
--  发布时间:2014/3/19 15:37:27
--  
谢谢您,我是想三线追杀,当前价格与之前两个不同周期的开盘价进行比较,所以用的close,不可以么?

--  作者:jinzhe
--  发布时间:2014/3/19 15:40:29
--  
用IE发帖,其他浏览器会看不到发帖