: | : | :期货程序化 | :期货程序化研究 | :期货量化学习 | :期货量化 |
返回列表 发帖

[MC源码] 金肯特纳交易策略&改 (已编辑)

[MC源码] 金肯特纳交易策略&改 (已编辑)

金肯特纳交易策略&改

  • 前言
  最近有一些用户私信我:老师,我之前用XX软件做交易,现在想转到MC,策略不知道怎么写,能请给我一个范例好让我知道要怎么把自己的逻辑转换过来吗?我想了一下,这个需求有一定普遍性,所以有了今天这篇文章。
  • 原始策略逻辑

系统构成:
基于最高价、最低价、收盘价三者平均值计算而来的三价均线 基于三价均线加减真实波幅计算而来的通道上下轨
入场条件:
三价均线向上,并且价格上破通道上轨,开多单 三价均线向下,并且价格下破通道下轨,开空单
出场条件:持有多单时,价格下破三价均线,平多单 持有空单时,价格上破三价均线,平空单


回测设置:HKEX.MHI HOT 5分钟,2016.10.25~至今,初始资金3w,固定一手
  • 绩效
  一共交易3328次,已实现净利11.7w,账户资金收益比518%,初始资金收益比392%,最大潜在亏损31.4%,年化收益195%。  这种通道突破类型的策略,我们去检查信号就会发现,在盘整期有太多不必要的进场。

因此,尝试结合上一次和大家分享的RSRS指标判断,看能否过滤一些不必要的进场。

论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
 
期货论坛 - 版权/免责声明   1.本站发布源码(包括函数、指标、策略等)均属开放源码,用意在于让使用者学习程序化语法撰写,使用者可以任意修改语法內容并调整参数。仅限用于个人学习使用,请勿转载、滥用,严禁私自连接实盘账户交易
  2.本站发布资讯(包括文章、视频、历史记录、教材、评论、资讯、交易方案等)均系转载自网络主流媒体,内容仅为作者当日个人观点,本网转载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。本网不对该类信息或数据做任何保证。不对您构成任何投资建议,不能依靠信息而取代自身独立判断,不对因使用本篇文章所诉信息或观点等导致的损失承担任何责任。
  3.本站发布资源(包括书籍、杂志、文档、软件等)均从互联网搜索而来,仅供个人免费交流学习,不可用作商业用途,本站不对显示的内容承担任何责任。请在下载后24小时内删除。如果喜欢,请购买正版,谢谢合作!
  4.龙听期货论坛原创文章属本网版权作品,转载须注明来源“龙听期货论坛”,违者本网将保留追究其相关法律责任的权力。本论坛除发布原创文章外,亦致力于优秀财经文章的交流分享,部分文章推送时若未能及时与原作者取得联系并涉及版权问题时,请及时联系删除。联系方式:http://www.qhlt.cn/thread-262-1-1.html
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

学习学习

TOP

谢谢分享

TOP

感謝分享

TOP

谢谢!

TOP

谢谢分享!

TOP

Input:price1(close of data1),price2(close of data2);

var:mp(0),timecondition(False),timecondition1(False),timecondition2(False),filtercondition1(False),filtercondition2(False),buycondition(False),sellcondition(False),hltime1(False),hltime2(False),hltime(False);{global var}
var:ma1(0),ma2(0);{filter var}
var:VAR1(0),VAR2(0),beginbar(0),std(0),ma(0);{strategy var}

mp = marketposition;

//trading session model

timecondition1 = time>0930 and time< 1455;
timecondition2 = time>2130 and Time< 2255;
timecondition = timecondition1 or timecondition2;
hltime1 = time > 0905 and Time < 0915;{2high2sell or 2low2buy time}
hltime2 = time > 2105 and time < 2115;
hltime = hltime1 or hltime2;

//filter net model

ma1 = Average(close,5) of data2;
ma2 = Average(close,10)of data2;

filtercondition1 = ma1 > ma2 and Close > minlist(ma1,ma2); //bulltrend
filtercondition2 = ma1 < ma2 and Close < maxlist(ma1,ma2); //beartrend


//strategy model-{Aberration}
{first enter}
ma = Average(price1,35);
std = StandardDev(price1,35,1);
var1 = ma + 2*std;
var2 = ma - 2*std;

buycondition = price1 > var1;
sellcondition = price1 < var2;
{second entry}
condition1 = close[1] < var2[1] and Close > var2;
condition2 = Close[1] > var1[1] and Close < var1;

{buy/sell model}
if mp=0 then begin

if filtercondition1 and buycondition and timecondition then begin
buy("breakout-buy") 1 shares next bar at market;
end;
if filtercondition1 and condition1 and hltime then begin
buy("2low-buy") 1 shares next bar at market;
end;

if filtercondition2 and sellcondition and timecondition then begin
sellshort("breakdown-sell") 1 shares next bar at market;
end;

if filtercondition2 and condition2 and hltime then begin
sellshort("2high-sell") 1 shares next bar at market;
end;

end;

//strategy-exit

if mp=1 and Close < ma and Close-entryprice >= 5 then sell("long-exit") 1 shares next bar at market;
if mp=-1 and Close > ma and entryprice - Close>= 5 then buytocover("short-exit") 1 shares next bar at market;

//time-exit model

if mp<>0 then begin

if Time>1455 and time <1500 then begin
if mp=-1 then buytocover("short-exit at 14:55")1 shares next bar at market;
if mp= 1 then sell("long-exit at 14:55")1 shares next bar at market;
end;

if Time>2255 and time <2300  then begin
if mp=-1 then buytocover("short-exit at 22:55") 1 shares next bar at market;
if mp= 1 then sell("long-exit at 22:55") 1 shares next bar at market;
end;
end;

//set-stop model

if mp<>0 then begin

SetStopContract;

SetProfitTarget(150);

SetPercentTrailing(140,50);
end;
//check model {if strategy has problem,use print check}
{print(ma1);}

TOP

感谢

TOP

感谢版主分享

TOP

感谢版主分享!

TOP

谢谢分享

TOP

老师发个改进的文华版源码出来吧,谢谢

TOP

谢谢

TOP

看看

TOP

谢谢!好好学习。

TOP

谢谢
为交易而生

TOP


卓越

TOP

感谢

TOP

谢谢分享

TOP

谢谢!

TOP

返回列表