等级: 专业版
- 注册:
- 2022-1-11
- 曾用名:
|
楼主 |
发表于 2022-1-13 11:09
|
显示全部楼层
老师,这是我的代码。
BIGUPHF:=MACDHF>0 AND DIFFHF>0 AND DIFF_UPHF>0 AND MACD_UPHF>0;
BIGUP1:=MACD1>0 AND DIFF1>0 AND DIFF_UP1>0 AND MACD_UP1>0;
BIGUP2:=MACD2>0 AND DIFF_UP2>0 AND MACD_UP2>0 AND DIFF2>0;
BIGUP3:=MACD3>0 AND MACD_UP3>0 AND DIFF_UP3>0 AND DIFF3>0;
BIGUP4:=MACD4>0 AND MACD_UP4>0 AND DIFF_UP4>0;
BIGUP5:=MACD_UP5>0 AND DIFF_UP5>0;
BIGUP6:=MACD_UP6>0 AND DIFF_UP6>0;
BIGDNHF:=MACDHF<0 AND DIFFHF<0 AND DIFF_DOWNHF>0 AND MACD_DOWNHF>0;
BIGDN1:=MACD1<0 AND DIFF1<0 AND DIFF_DOWN1>0 AND MACD_DOWN1>0;
BIGDN2:=MACD2<0 AND DIFF_DOWN2>0 AND MACD_DOWN2>0 AND DIFF2<0;
BIGDN3:=MACD3<0 AND MACD_DOWN3>0 AND DIFF_DOWN3>0 AND DIFF3<0;
BIGDN4:=MACD4<0 AND MACD_DOWN4>0 AND DIFF_DOWN4>0;
BIGDN5:=MACD_DOWN5>0 AND DIFF_DOWN5>0;
BIGDN6:=MACD_DOWN6>0 AND DIFF_DOWN6>0;
BIGUPTT:=BIGUPHF+BIGUP1+BIGUP2+BIGUP3+BIGUP4+BIGUP5+BIGUP6;
BIGDNTT:=BIGDNHF+BIGDN1+BIGDN2+BIGDN3+BIGDN4+BIGDN5+BIGDN6;
{DRAWICON(BIGUPTT >=7 AND DIFFHF>1 AND DIFF1>2 AND DIFF2>3 AND DIFF3>5,LOW*0.9972, 40);
DRAWICON(BIGDNTT>=7 AND DIFFHF<-1 AND DIFF1<-2 AND DIFF2<-3 AND DIFF3<-5, HIGH*1.0022 , 41);}
DRAWICON(BIGUPTT >=7 AND BARSLAST(CROSS(DIFFHF,DEAHF))>=1 AND BARSLAST(MACD_UPHF<0)>=0 AND DIFFHF>1 AND DIFF1>2,LOW*0.9972, 38);
DRAWICON(BIGDNTT>=7 AND BARSLAST(CROSS(DEAHF,DIFFHF))>=1 AND DIFFHF<-1 AND DIFF1<-2, HIGH*1.0022 , 39);
主要是增加了刚说的BARSLAST函数,金死叉的效果已经达到。
现在想增加一个对MACDHF上升的判断,过滤掉一定的风险点,结果看,风险点可以过滤掉,但有效的开仓点也过滤掉了,但是过滤掉的开仓点跟我的语句条件时不匹配的,请老师指导一下。
主要是下面的语句:
BARSLAST(MACD_UPHF<0)>=0
同时附上该语句添加前后图形的变化。
图片一是添加后的;
图片二是添加前的。
图片二左边是想要过滤的开仓点,右边是想要保留的开仓点(红色三角形符号)。 |
-
-
|