以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  交易策略发布专区  (http://weistock.com/bbs/list.asp?boardid=10)
----  【短线交易】5分钟通道策略  (http://weistock.com/bbs/dispbbs.asp?boardid=10&id=85792)

--  作者:王锋
--  发布时间:2015/9/30 18:25:13
--  【短线交易】5分钟通道策略


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20150930154905.jpg
图片点击可在新窗口打开查看

{
               5分钟通道策略

5分钟通道策略旨在捕捉趋势行情中在上升或者下降通道内的震荡,

即捕捉市场中有意义的回撤,通过短线持有以获得小额收益的积累。

应用周期:5分钟
}

//定义参数

Input:N(12,1,100,1);//均线和标准差参数
Num:=1;//开仓手数

//中间变量
Ma10:Ma(c,N);//10日均线
Std1:=Std(c,N);//一个标准差
Upper:=Ma10+Std1;//通道上轨
Bottom:=Ma10-Std1;//通道下轨

BuyCond:=h>ref(h,1) and l>ref(l,1) and l<=Bottom;//上涨趋势中价格触及下轨
SellCond:=h<ref(l,1) and l<ref(l,1) and h>=Upper;//下跌趋势中价格初级上轨开仓

//下单语句
if BuyCond then begin
 Sellshort(holding<0,0,market);//市价平空
 Buy(holding=0,Num,market);//市价开多
end

if SellCond then begin
 Sell(holding>0,0,market);//市价平多
 BuyShort(holding=0,Num,market);//市价开空
end

//止盈止损
Win_Buy:=h-enterprice>=2;//多头盈利2点
Win_Sell:=enterprice-l>=2;//空头盈利2点
Lose_Buy:=enterprice-l>=1.25;//多头亏损1.25点
Lose_Sell:=h-enterprice>=1.25;//空头亏损1.25点

//市价止盈止损
if Win_Buy and holding>0 then 多止盈:Sell(enterbars>0,0,market);
if Win_Sell and holding<0 then 空止盈:Sellshort(enterbars>0,0,market);
if Lose_Buy and holding>0 then 多止损:Sell(enterbars>0,0,market);
if Lose_Sell and holding<0 then 空止损:Sellshort(enterbars>0,0,market);


--  作者:liyuanhao
--  发布时间:2015/9/30 21:13:44
--  
谢谢分享!
--  作者:uheart
--  发布时间:2015/10/6 1:17:12
--  
多谢分享!
--  作者:斯多儿
--  发布时间:2015/10/13 11:40:57
--  适合那种期货啊
王老师好,这个策略这么没有正收益啊?适合那种期货啊?

我可以调整那个参数,使之成为正收益的模型?谢谢。

--  作者:王锋
--  发布时间:2015/10/13 12:09:45
--  
调整参数,使用优化功能找一下喽
--  作者:yangangzhang
--  发布时间:2015/10/30 11:23:38
--  
感谢


--  作者:尖锋时刻woo
--  发布时间:2015/10/30 14:34:54
--  
感谢分享了图片点击可在新窗口打开查看
--  作者:c100010300
--  发布时间:2015/11/29 17:28:00
--  
没用
--  作者:qiang2046
--  发布时间:2015/12/7 9:47:16
--  
SellCond:=h<ref(l,1) and l<ref(l,1) and h>=Upper;//下跌趋势中价格初级上轨开仓

这句有问题 

SellCond:=L<ref(l,1) and l<ref(l,1) and h>=Upper;//下跌趋势中价格初级上轨开仓

改成 L才行吧

--  作者:风度翩翩
--  发布时间:2015/12/13 20:58:59
--  
谢谢 王大师啊!!!