请选择 进入手机版 | 继续访问电脑版

0805MACD带盈67-9(加开平仓时间)测试报告

[复制链接]
查看91 | 回复4 | Brad | 2020-8-5 17:50:55 | 显示全部楼层 |阅读模式
用MACD带盈67-9(加开平仓时间)策略,先在2H、1H、30M、15M的频率下,组合测试了50个商品,分别选出四个时间频率下收益率为正的商品。再测试这些上商品的具体表现,将胜率盈亏>0.15或者盈利率>50%的商品挑选出来:
2h挑选出的商品:
MACD带盈67-9加开平仓时间2h单品结果1.png

MACD带盈67-9加开平仓时间2h单品结果2.png



1h挑选出的商品:
MACD带盈67-9加开平仓时间1h单品结果.png


回复

使用道具 举报

Brad | 2020-8-5 18:00:04 | 显示全部楼层
【MACD带-盈67-9加开平仓 - 15M代码】

//N=2

FUND:=10000000; //资金
TC:=INTPART(FUND*0.4/(C*MARGIN*UNIT+FEE));//计算开仓手数
TR : MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));//求最高价减去最低价,一个周期前的收盘价减去最高价的绝对值,一个周期前的收盘价减去最低价的绝对值,这三个值中的最大值
ATR : MA(TR,26);//求N个周期内的TR的简单移动平均

DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);//短周期与长周期的收盘价的指数平滑移动平均值做差。
DEA: EMA(DIFF,9);//DIFF的M个周期指数平滑移动平均
MACD:2*(DIFF-DEA),COLORSTICK;//DIFF减DEA的2倍画柱状线

MACDV:=MACD>REF(MACD,1) AND REF(MACD,2)>REF(MACD,1);
MACDA:=MACD<REF(MACD,1) AND REF(MACD,2)<REF(MACD,1);

//15M    开仓时段
KTIME := BETWEEN(TIME, 0900, 1430) OR BETWEEN(TIME, 2100, 2230);

//////////////////////////////////////////////

LEN:CONDBARS(CROSSUP(DIFF,DEA),CROSSDOWN(DIFF,DEA));//最近一次满足DIFF上穿DEA与DIFF下穿DEA之间的周期数

//描述MACD之鱼【带鱼都是盈利的,短鱼都是亏损的】
//1、带鱼
DDAI:=C>REF(C,LEN) AND CROSSDOWN(DIFF,DEA); //当前死叉,前一次金叉,多带鱼
KDAI:=C<REF(C,LEN) AND CROSSUP(DIFF,DEA); //当前金叉,前一次死叉,空带鱼

//2、短鱼
DDUAN:=C<REF(C,LEN) AND CROSSDOWN(DIFF,DEA); //当前死叉,前一次金叉,多短鱼
KDUAN:=C>REF(C,LEN) AND CROSSUP(DIFF,DEA); //当前金叉,前一次死叉,空短鱼

DRAWTEXT(DDAI ,H ,'多带'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(DDUAN ,H ,'多短'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(KDAI ,L,'空带'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(KDUAN ,L ,'空短'),VALIGN2,FONTSIZE18,COLORWHITE;

//记录带鱼的次数
DDAICS:=-1*COUNT(DDAI,0);//多带鱼次数

//带鱼的方向
DDK : IF(BARSLAST(DDAI )<BARSLAST(KDAI), 1, -1);

LEN11:BARSLAST(CROSSUP(DIFF,DEA) OR CROSSDOWN(DIFF,DEA));
VCS:=COUNT(MACDV,LEN11);
ACS:=COUNT(MACDA,LEN11);

///////////////////////////////////////////////////////////////
CROSS(DIFF,DEA) AND ( DDK=1) AND BKVOL=0 AND KTIME, BPK(TC);//
CROSSDOWN(DIFF,DEA) AND (DDK=-1) AND SKVOL=0 AND KTIME, SPK(TC);//

CROSS(DIFF,DEA) AND (DDK=-1), BP(SKVOL);//
CROSSDOWN(DIFF,DEA) AND (DDK=1), SP(BKVOL);//

MACDV AND BKVOL=0 AND DDK=-1 AND DIFF>DEA AND KTIME, BPK(TC);//
MACDA AND SKVOL=0 AND DDK=1 AND DIFF<DEA AND KTIME, SPK(TC);//

//MACDA AND DDK=-1 AND DIFF>DEA AND ACS<=N, SPK(BKVOL);
//MACDV AND DDK=1 AND DIFF<DEA AND VCS>=N, BPK(SKVOL);

MACDA AND DDK=-1 AND DIFF>DEA AND ACS>N, SP(BKVOL);//
MACDV AND DDK=1 AND DIFF<DEA AND VCS>N, BP(SKVOL);//

//////////////////////////////////////////////////////////////////

ISLASTKLINE, CLOSEOUT;


回复

使用道具 举报

Brad | 2020-8-5 18:01:23 | 显示全部楼层
【MACD带-盈67-9加开平仓 - 30M代码】

//N=2

FUND:=10000000; //资金
TC:=INTPART(FUND*0.4/(C*MARGIN*UNIT+FEE));//计算开仓手数
TR : MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));//求最高价减去最低价,一个周期前的收盘价减去最高价的绝对值,一个周期前的收盘价减去最低价的绝对值,这三个值中的最大值
ATR : MA(TR,26);//求N个周期内的TR的简单移动平均

DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);//短周期与长周期的收盘价的指数平滑移动平均值做差。
DEA: EMA(DIFF,9);//DIFF的M个周期指数平滑移动平均
MACD:2*(DIFF-DEA),COLORSTICK;//DIFF减DEA的2倍画柱状线

MACDV:=MACD>REF(MACD,1) AND REF(MACD,2)>REF(MACD,1);
MACDA:=MACD<REF(MACD,1) AND REF(MACD,2)<REF(MACD,1);

//30M      开仓时段
KTIME := BETWEEN(TIME, 0900, 1400) OR BETWEEN(TIME, 2100, 2200);

//////////////////////////////////////////////

LEN:CONDBARS(CROSSUP(DIFF,DEA),CROSSDOWN(DIFF,DEA));//最近一次满足DIFF上穿DEA与DIFF下穿DEA之间的周期数

//描述MACD之鱼【带鱼都是盈利的,短鱼都是亏损的】
//1、带鱼
DDAI:=C>REF(C,LEN) AND CROSSDOWN(DIFF,DEA); //当前死叉,前一次金叉,多带鱼
KDAI:=C<REF(C,LEN) AND CROSSUP(DIFF,DEA); //当前金叉,前一次死叉,空带鱼

//2、短鱼
DDUAN:=C<REF(C,LEN) AND CROSSDOWN(DIFF,DEA); //当前死叉,前一次金叉,多短鱼
KDUAN:=C>REF(C,LEN) AND CROSSUP(DIFF,DEA); //当前金叉,前一次死叉,空短鱼

DRAWTEXT(DDAI ,H ,'多带'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(DDUAN ,H ,'多短'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(KDAI ,L,'空带'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(KDUAN ,L ,'空短'),VALIGN2,FONTSIZE18,COLORWHITE;

//记录带鱼的次数
DDAICS:=-1*COUNT(DDAI,0);//多带鱼次数

//带鱼的方向
DDK : IF(BARSLAST(DDAI )<BARSLAST(KDAI), 1, -1);

LEN11:BARSLAST(CROSSUP(DIFF,DEA) OR CROSSDOWN(DIFF,DEA));
VCS:=COUNT(MACDV,LEN11);
ACS:=COUNT(MACDA,LEN11);

///////////////////////////////////////////////////////////////
CROSS(DIFF,DEA) AND ( DDK=1) AND BKVOL=0 AND KTIME, BPK(TC);//
CROSSDOWN(DIFF,DEA) AND (DDK=-1) AND SKVOL=0 AND KTIME, SPK(TC);//

CROSS(DIFF,DEA) AND (DDK=-1), BP(SKVOL);//
CROSSDOWN(DIFF,DEA) AND (DDK=1), SP(BKVOL);//

MACDV AND BKVOL=0 AND DDK=-1 AND DIFF>DEA AND KTIME, BPK(TC);//
MACDA AND SKVOL=0 AND DDK=1 AND DIFF<DEA AND KTIME, SPK(TC);//

//MACDA AND DDK=-1 AND DIFF>DEA AND ACS<=N, SPK(BKVOL);
//MACDV AND DDK=1 AND DIFF<DEA AND VCS>=N, BPK(SKVOL);

MACDA AND DDK=-1 AND DIFF>DEA AND ACS>N, SP(BKVOL);//
MACDV AND DDK=1 AND DIFF<DEA AND VCS>N, BP(SKVOL);//

//////////////////////////////////////////////////////////////////

ISLASTKLINE, CLOSEOUT;

回复

使用道具 举报

Brad | 2020-8-5 18:02:16 | 显示全部楼层
【MACD带-盈67-9加开平仓 - 1H代码】

//N=2

FUND:=10000000; //资金
TC:=INTPART(FUND*0.4/(C*MARGIN*UNIT+FEE));//计算开仓手数
TR : MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));//求最高价减去最低价,一个周期前的收盘价减去最高价的绝对值,一个周期前的收盘价减去最低价的绝对值,这三个值中的最大值
ATR : MA(TR,26);//求N个周期内的TR的简单移动平均

DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);//短周期与长周期的收盘价的指数平滑移动平均值做差。
DEA: EMA(DIFF,9);//DIFF的M个周期指数平滑移动平均
MACD:2*(DIFF-DEA),COLORSTICK;//DIFF减DEA的2倍画柱状线

MACDV:=MACD>REF(MACD,1) AND REF(MACD,2)>REF(MACD,1);
MACDA:=MACD<REF(MACD,1) AND REF(MACD,2)<REF(MACD,1);

//1H    开仓时段
KTIME := BETWEEN(TIME, 0900, 1300) OR TIME=2100;

//////////////////////////////////////////////

LEN:CONDBARS(CROSSUP(DIFF,DEA),CROSSDOWN(DIFF,DEA));//最近一次满足DIFF上穿DEA与DIFF下穿DEA之间的周期数

//描述MACD之鱼【带鱼都是盈利的,短鱼都是亏损的】
//1、带鱼
DDAI:=C>REF(C,LEN) AND CROSSDOWN(DIFF,DEA); //当前死叉,前一次金叉,多带鱼
KDAI:=C<REF(C,LEN) AND CROSSUP(DIFF,DEA); //当前金叉,前一次死叉,空带鱼

//2、短鱼
DDUAN:=C<REF(C,LEN) AND CROSSDOWN(DIFF,DEA); //当前死叉,前一次金叉,多短鱼
KDUAN:=C>REF(C,LEN) AND CROSSUP(DIFF,DEA); //当前金叉,前一次死叉,空短鱼

DRAWTEXT(DDAI ,H ,'多带'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(DDUAN ,H ,'多短'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(KDAI ,L,'空带'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(KDUAN ,L ,'空短'),VALIGN2,FONTSIZE18,COLORWHITE;

//记录带鱼的次数
DDAICS:=-1*COUNT(DDAI,0);//多带鱼次数

//带鱼的方向
DDK : IF(BARSLAST(DDAI )<BARSLAST(KDAI), 1, -1);

LEN11:BARSLAST(CROSSUP(DIFF,DEA) OR CROSSDOWN(DIFF,DEA));
VCS:=COUNT(MACDV,LEN11);
ACS:=COUNT(MACDA,LEN11);

///////////////////////////////////////////////////////////////
CROSS(DIFF,DEA) AND ( DDK=1) AND BKVOL=0 AND KTIME, BPK(TC);//
CROSSDOWN(DIFF,DEA) AND (DDK=-1) AND SKVOL=0 AND KTIME, SPK(TC);//

CROSS(DIFF,DEA) AND (DDK=-1), BP(SKVOL);//
CROSSDOWN(DIFF,DEA) AND (DDK=1), SP(BKVOL);//

MACDV AND BKVOL=0 AND DDK=-1 AND DIFF>DEA AND KTIME, BPK(TC);//
MACDA AND SKVOL=0 AND DDK=1 AND DIFF<DEA AND KTIME, SPK(TC);//

//MACDA AND DDK=-1 AND DIFF>DEA AND ACS<=N, SPK(BKVOL);
//MACDV AND DDK=1 AND DIFF<DEA AND VCS>=N, BPK(SKVOL);

MACDA AND DDK=-1 AND DIFF>DEA AND ACS>N, SP(BKVOL);//
MACDV AND DDK=1 AND DIFF<DEA AND VCS>N, BP(SKVOL);//

//////////////////////////////////////////////////////////////////

ISLASTKLINE, CLOSEOUT;
回复

使用道具 举报

Brad | 2020-8-5 18:03:01 | 显示全部楼层
【MACD带-盈67-9加开平仓 - 2H代码】

//N=2

FUND:=10000000; //资金
TC:=INTPART(FUND*0.4/(C*MARGIN*UNIT+FEE));//计算开仓手数
TR : MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));//求最高价减去最低价,一个周期前的收盘价减去最高价的绝对值,一个周期前的收盘价减去最低价的绝对值,这三个值中的最大值
ATR : MA(TR,26);//求N个周期内的TR的简单移动平均

DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);//短周期与长周期的收盘价的指数平滑移动平均值做差。
DEA: EMA(DIFF,9);//DIFF的M个周期指数平滑移动平均
MACD:2*(DIFF-DEA),COLORSTICK;//DIFF减DEA的2倍画柱状线

MACDV:=MACD>REF(MACD,1) AND REF(MACD,2)>REF(MACD,1);
MACDA:=MACD<REF(MACD,1) AND REF(MACD,2)<REF(MACD,1);

//2H    开仓时段
KTIME := BETWEEN(TIME, 0900, 1100) OR TIME=2100;

//////////////////////////////////////////////

LEN:CONDBARS(CROSSUP(DIFF,DEA),CROSSDOWN(DIFF,DEA));//最近一次满足DIFF上穿DEA与DIFF下穿DEA之间的周期数

//描述MACD之鱼【带鱼都是盈利的,短鱼都是亏损的】
//1、带鱼
DDAI:=C>REF(C,LEN) AND CROSSDOWN(DIFF,DEA); //当前死叉,前一次金叉,多带鱼
KDAI:=C<REF(C,LEN) AND CROSSUP(DIFF,DEA); //当前金叉,前一次死叉,空带鱼

//2、短鱼
DDUAN:=C<REF(C,LEN) AND CROSSDOWN(DIFF,DEA); //当前死叉,前一次金叉,多短鱼
KDUAN:=C>REF(C,LEN) AND CROSSUP(DIFF,DEA); //当前金叉,前一次死叉,空短鱼

DRAWTEXT(DDAI ,H ,'多带'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(DDUAN ,H ,'多短'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(KDAI ,L,'空带'),VALIGN2,FONTSIZE18,COLORWHITE;
DRAWTEXT(KDUAN ,L ,'空短'),VALIGN2,FONTSIZE18,COLORWHITE;

//记录带鱼的次数
DDAICS:=-1*COUNT(DDAI,0);//多带鱼次数

//带鱼的方向
DDK : IF(BARSLAST(DDAI )<BARSLAST(KDAI), 1, -1);

LEN11:BARSLAST(CROSSUP(DIFF,DEA) OR CROSSDOWN(DIFF,DEA));
VCS:=COUNT(MACDV,LEN11);
ACS:=COUNT(MACDA,LEN11);

///////////////////////////////////////////////////////////////
CROSS(DIFF,DEA) AND ( DDK=1) AND BKVOL=0 AND KTIME, BPK(TC);//
CROSSDOWN(DIFF,DEA) AND (DDK=-1) AND SKVOL=0 AND KTIME, SPK(TC);//

CROSS(DIFF,DEA) AND (DDK=-1), BP(SKVOL);//
CROSSDOWN(DIFF,DEA) AND (DDK=1), SP(BKVOL);//

MACDV AND BKVOL=0 AND DDK=-1 AND DIFF>DEA AND KTIME, BPK(TC);//
MACDA AND SKVOL=0 AND DDK=1 AND DIFF<DEA AND KTIME, SPK(TC);//

//MACDA AND DDK=-1 AND DIFF>DEA AND ACS<=N, SPK(BKVOL);
//MACDV AND DDK=1 AND DIFF<DEA AND VCS>=N, BPK(SKVOL);

MACDA AND DDK=-1 AND DIFF>DEA AND ACS>N, SP(BKVOL);//
MACDV AND DDK=1 AND DIFF<DEA AND VCS>N, BP(SKVOL);//

//////////////////////////////////////////////////////////////////

ISLASTKLINE, CLOSEOUT;

回复

使用道具 举报

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

本版积分规则

相关课程推荐
桥博士《MACD指标详解》
为什么我们只用MACD金叉死叉来进行操作效果并不好,学习课程就能在研究MACD指标上少走很多弯路
桥博士《K线形态组合解析》
从理论到实战,让您全面掌握各种K线形态及各种组合,帮您分析梳理大量K线知识让您的投资更游刃有余
桥博士《股票入门基础知识》
从理论到实战,课程包括如何买卖股票、开户流程、交易软件、k线图知识、技术指标、价值投资等新手必备知识

68

主题

255

帖子

738

积分

高级会员

Rank: 4

积分
738
  • 官方论坛

    提供最新 Discuz! 产品新闻、软件下载与技术交流