打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
一个实用的交易策略:3分钟四线趋势交易系统和源码

下面公布一个交易策略------3分钟四线趋势交易系统。
本策略的特点:
本策略只有一个k线形态,和一个止损点数。没有参数优化问题。
本策略的设计原理:
一旦市场出现趋势性走势时,会出现连续的单方向k线。本策略就是捕捉市场的这种规律。

 

源码如下:
//股指期货自动交易程序(3分钟四线趋势交易系统)
//编制:qq:2313936161
//日期:2011年6月17日
{
//加密及期限
有效期:1121230,linethick0;
账号:11111,linethick0;
qq1:=strtonum(taccount( 1));
if qq1<>账号 or date>=有效期 or datatype<>17 then exit;
}
if datatype<>17 then exit;
 
//交易控制变量
variable:a1=0;
variable:a2=0;
 
//交易手数:
tn:=1;
 
//持续下单次数
cx:=1;
 
//提前下单量(秒)
xd:=3;
 
//交易时间区间
p1:=time>091500 and time<=144500;
p2:=if(islastbar,dynainfo(207),time);
p3:time0-timetot0(p2)linethick0;{用p3可以测试你的交易环境,p3匀速变化说明你的交易环境是好的,否则就是你的网速不好,或者你的计算机运行的东西太多,影响了运行速度}
//
r1:=barslast(date<>ref(date,1));
r2:ref(o,r1);
 
//3分钟四线趋势
sqsxd:=count(c>ref(c,1),3)=3 and count(c>=o,4)=4,linethick0;
sqsxk:=count(c

if  sqsxd and p1 and p3<=xd then
 begin
 sellshort(holding<0,tn,thisclose);//p3<=xd 表是一根k线走完前xd秒开始下单
 buy(holding=0,tn,thisclose);
 end
if sqsxk and p1 and p3<=xd then
 begin
 sell(holding>0,tn,thisclose);
 buyshort(holding=0,tn,thisclose);
 end
 
//远距离止损
r20:=enterbars+1;
r21:=ref(hhv(c,r20),1);
r22:=ref(llv(c,r20),1);
r23:=33;
if holding>0 and r21-l>r23 and r20>1 then
 begin
 sell(1,tn,limitr,r21-r23);
 end
if holding<0 and h-r22>r23 and r20>1 then
 begin
 sellshort(1,tn,limitr,r22+r23);
 end
 
//收盘前清仓
r50:=abs(holding);
if p2>=150700 then
 begin
 sellshort(holding<0,r50,thisclose);
 sell(holding>0,r50,thisclose);
 end
 
持仓:holding,colorwhite,linethick0;
交易总数:totaltrade,colorwhite,linethick0;
盈亏:asset-1000000,noaxis,colorred,linethick1;
日盈亏:asset-ref(asset,r1),noaxis,colorred,linethick0;
 
这个策略的收益不是很理想,回撤也不是很好,但是他比较贴合市场,人为的痕迹不多,还是有一定实用价值的。

 

 

 

 

标签: 策略投资 程序化 举报

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
横盘突破--程序化交易策略
麻烦老师修改下唐奇安通道,在日内15分周期可实盘下单
【中长期策略】金肯特纳系统
自动交易系统(问题讨论)
超出轨道定买卖(源码) - 通达信公式指标
强势股今日新增 BOLL附带 RPS逐渐增强
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服