金字塔软件下 5分钟通道策略

[复制链接]
查看1029 | 回复0 | 2025-3-10 12:48:20 | 显示全部楼层 |阅读模式
金字塔软件下 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);

已有 0 人打赏作者

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

股鸣通是国内专业的股票公式指标资源在线共享平台,提供股票操盘软件用的各种指标公式,如:通达信指标公式、大智慧指标公式、同花顺指标公式等。
客服QQ:2728153965
欢迎入驻!本站将竭诚为您服务!
联系我们
  • 访问移动手机版
  • 官方微信客服

©2020-2025股鸣通 版权所有

|免责声明|手机版|小黑屋|股鸣通 ( 琼ICP备2025050731号|琼ICP备2025050731号-1 )

快速回复 返回顶部 返回列表