Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共5 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:求写关于5个周期内最高最低突破的简单策略

1楼
zdhtc_aidi 发表于:2012/7/5 9:42:48

这里以3分钟图表为例

 

开仓条件

 

开盘5个周期后,价格突破前5个周期的最高价,并且5个周期内价格的最高减最低超过10个点,并且5日均线向上,则做多

 

开盘5个周期后,价格突破前5个周期的最低价,并且5个周期内价格的最高减最低超过10个点,并且5日均线向下,则做空

 

平仓条件

 

价格突破前5个周期的最高价,则平掉空单

价格突破前5个周期的最低价,则平掉多单

开盘最后第二个周期全部平仓,并且不再开单

 

要求能在免费版情况下使用

 

请问怎么解决,我是菜鸟,求指教,感激不尽

2楼
jinzhe 发表于:2012/7/5 9:51:59
如何定义均线向上
3楼
zdhtc_aidi 发表于:2012/7/5 9:54:00

当前K线的均线值比上一周期的均线值大,就是向上,反之向下

4楼
jinzhe 发表于:2012/7/5 10:30:19

ma5:ma(c,5);
n1:=barslast(date<>ref(date,1))+1;
timet:= time>090300 and time<145700;
cond1:=c>ref(hhv(h,5),1) ;

cond2:=c<ref(llv(l,5),1);
cond3:=c>ref(hhv(h,5),1) and ref(hhv(h,5),1)-ref(llv(l,5),1)>=10*mindiff and ma5>ref(ma5,1);
cond4:=c<ref(llv(l,5),1) and ref(hhv(h,5),1)-ref(llv(l,5),1)>=10*mindiff and ma5<ref(ma5,1);
if n1>=5 and timet then begin
 if cond1 then sellshort(holding<0,0,market);
 if cond2 then sell(holding>0,0,market);
 if cond3  then buy(holding=0,1,market);
 if cond4  then buyshort(holding=0,1,market);
end
if time>=145700 and time<=150000 then begin
sell(1,0,market);
sellshort(1,0,market);
end

 

5楼
zdhtc_aidi 发表于:2012/7/5 15:15:43
多谢高手指点,早上有事出去了,我马上测下
共5 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01563 s, 3 queries.