趋势决策主,结合了压力支撑和多空背景(通达信公式 主图 源码 测试图)

[复制链接]
查看98 | 回复0 | 2022-6-27 14:47:38 | 显示全部楼层 |阅读模式

 趋势决策主,结合了压力支撑和多空背景

X_1:=EMA(CLOSE,2);
X_2:=EMA(SLOPE(CLOSE,21)*20+CLOSE,42);
STICKLINE(X_1>=X_2,REFDATE(HHV(HIGH,0),DATE),REFDATE(LLV(LOW,0),DATE),6,0),COLOR001050;
STICKLINE(X_1<X_2,REFDATE(HHV(HIGH,0),DATE),REFDATE(LLV(LOW,0),DATE),6,0),COLOR404050;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
X_3:=EMA((EMA(CLOSE,4)+EMA(CLOSE,6)+EMA(CLOSE,12)+EMA(CLOSE,24))/4,2);
X_4:=MA(CLOSE,27);
B买:IF(CROSS(X_3,X_4) OR CROSS(X_1,X_2),CLOSE,DRAWNULL),NODRAW,COLORMAGENTA;
持仓:IF(X_1>=X_2,CLOSE,DRAWNULL),NODRAW,COLORRED;
S卖:IF(CROSS(X_4,X_3) OR CROSS(X_2,X_1),CLOSE,DRAWNULL),NODRAW,COLORLIGRAY;
空仓:IF(X_1<X_2,CLOSE,DRAWNULL),NODRAW,COLORGREEN;
DRAWICON(CROSS(X_1,X_2),LOW-LOW*0.02,7);
DRAWICON(CROSS(X_2,X_1),HIGH+HIGH*0.02,8);
STICKLINE(X_1>=X_2,LOW,HIGH,0,1),COLORRED;
STICKLINE(X_1>=X_2,CLOSE,OPEN,3,1),COLORRED;
STICKLINE(X_1<X_2,LOW,HIGH,0,1),COLORCYAN;
STICKLINE(X_1<X_2,CLOSE,OPEN,3,1),COLORCYAN;
看趋势:HHV(CLOSE,55)*0.9,COLORYELLOW,LINETHICK2;
X_5:=HHVBARS(CLOSE,60);
X_6:=REF(X_5,1)>30 AND CROSS(CLOSE,REF(HHV(HIGH,60),1));
X_7:=VOL/REF(VOL,1)>=2;
STICKLINE(X_6,CLOSE,OPEN,1,0),COLORYELLOW;
DRAWTEXT(X_6 AND X_7,OPEN,599),COLORYELLOW;
决策线:MA(CLOSE,5),COLORWHITE,LINETHICK3;
IF(决策线>REF(决策线,1),决策线,DRAWNULL),COLORRED,LINETHICK3;
IF(决策线<REF(决策线,1),决策线,DRAWNULL),COLORGREEN,LINETHICK3;
X_8:=0.01;
X_9:=0;
X_10:=0.03;
DRAWTEXT_FIX(ISLASTBAR,X_8,X_9,0,STRCAT(STRSPACE(DYBLOCK),HYBLOCK)),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,X_8,X_9+X_10*2,0,GNBLOCK),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,X_8,X_9+X_10*4,0,FGBLOCK),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,X_8,X_9+X_10*6,0,ZDBLOCK),COLORMAGENTA;
STICKLINE(CLOSE>1.095*REF(CLOSE,1),CLOSE,OPEN,2.5,0),COLORYELLOW;
STICKLINE(CLOSE<0.905*REF(CLOSE,1),CLOSE,OPEN,2.5,0),COLORGREEN;
X_11:=CLOSE-LOW;
X_12:=HIGH-LOW;
X_13:=CLOSE-HIGH;
X_14:=IF(HIGH>LOW,(X_11/X_12+X_13/X_12)*VOL,0);
X_15:=SUM(X_14,10)/10000;
X_16:=EMA(CLOSE,12)-EMA(CLOSE,26);
X_17:=EMA(12,9);
X_18:=(12-26)*2;
X_19:=UPNDAY(X_18,1);
X_20:=REF(HIGH,5)=HHV(HIGH,11);
X_21:=REF(LOW,5)=LLV(LOW,11);
X_22:=BACKSET(X_20,6)>BACKSET(X_20,5);
X_23:=BACKSET(X_21,6)>BACKSET(X_21,5);
X_24:=IF(BARSLAST(X_22)=BARSLAST(X_23) AND MA(CLOSE,5)>MA(CLOSE,10),X_22,IF(BARSLAST(X_23)>BARSLAST(X_22),X_22,0));
X_25:=IF(BARSLAST(X_22)=BARSLAST(X_23) AND MA(CLOSE,10)>MA(CLOSE,5),X_23,IF(BARSLAST(X_22)>BARSLAST(X_23),X_23,0));
X_26:=X_24 AND HIGH=HHV(HIGH,BARSLAST(X_25));
X_27:=X_25 AND LOW=LLV(LOW,BARSLAST(X_24));
X_28:=LOW>REF(HIGH,1) AND DAY=REF(DAY,1);
X_29:=HIGH<REF(LOW,1) AND DAY=REF(DAY,1);
X_30:=REF(HIGH,BARSLAST(X_26));
X_31:=REF(LOW,BARSLAST(X_26));
X_32:=REF(HIGH,BARSLAST(X_26)+1);
X_33:=REF(LOW,BARSLAST(X_26)+1);
X_34:=REF(LOW,BARSLAST(X_26)+2);
X_35:=REF(HIGH,BARSLAST(X_27)+2);
X_36:=REF(HIGH,BARSLAST(X_27));
X_37:=REF(LOW,BARSLAST(X_27));
X_38:=REF(HIGH,BARSLAST(X_27)+1);
X_39:=REF(LOW,BARSLAST(X_27)+1);
X_40:=IF(X_32<X_31,X_31,IF(X_31<=X_33,X_34,X_33));
X_41:=IF(X_39>X_36,X_36,IF(X_36>=X_38,X_35,X_38));
X_42:=X_30>X_41 AND X_26;
X_43:=X_37<X_40 AND X_27;
X_44:=X_42 AND X_30>X_36 AND X_31>X_37 AND X_33>X_37;
X_45:=X_43 AND X_37<X_31 AND X_36<X_30 AND X_38<X_30;
X_46:=HIGH<=REF(HIGH,1) AND LOW>=REF(LOW,1) OR (HIGH>=REF(HIGH,1) AND LOW<=REF(LOW,1));
X_47:=COUNT(X_46,BARSLAST(X_27));
X_48:=COUNT(X_46,BARSLAST(X_26));
X_49:=COUNT(X_28,BARSLAST(X_27));
X_50:=COUNT(X_29,BARSLAST(X_26));
X_51:=IF(X_47>0,X_47+2,IF(X_48,X_48+2,3));
X_52:=IF(X_49,X_51-X_49,IF(X_50,X_51-X_50,X_51));
X_53:=X_44 AND BARSLAST(X_45)>X_52;
X_54:=X_45 AND BARSLAST(X_44)>X_52;
X_55:=X_26 AND REF(HIGH,BARSLAST(X_26))>=REF(HIGH,BARSLAST(X_53)) AND BARSLAST(X_54)>BARSLAST(X_53) OR (X_42 AND COUNT(X_28,BARSLAST(X_43))>0 AND REF(HIGH,BARSLAST(X_42))>REF(HIGH,BARSLAST(X_53)));
X_56:=X_27 AND REF(LOW,BARSLAST(X_27))<=REF(LOW,BARSLAST(X_54)) AND BARSLAST(X_53)>BARSLAST(X_54) OR (X_43 AND COUNT(X_29,BARSLAST(X_42))>0 AND REF(LOW,BARSLAST(X_43))<REF(HIGH,BARSLAST(X_54)));
X_57:=IF(BARSLAST(X_56)>BARSLAST(X_55),REF(HIGH,BARSLAST(X_55)),REF(HIGH,BARSLAST(X_56)));
X_58:=IF(BARSLAST(X_55)>BARSLAST(X_56),REF(LOW,BARSLAST(X_56)),REF(LOW,BARSLAST(X_55)));
X_59:=X_55 AND HIGH=HHV(X_57,BARSLAST(X_56)+1) AND HIGH>REF(HIGH,1) AND BARSLAST(X_56)>BARSLAST(X_55);
X_60:=X_56 AND LOW=LLV(X_58,BARSLAST(X_55)+1) AND LOW<REF(LOW,1) AND BARSLAST(X_55)>BARSLAST(X_56);
X_61:=X_59 OR (X_26 AND REF(HIGH,BARSLAST(X_26))>REF(HIGH,BARSLAST(X_59)) AND BARSLAST(X_60)>BARSLAST(X_59));
X_62:=X_60 OR (X_27 AND REF(LOW,BARSLAST(X_27))<REF(LOW,BARSLAST(X_60)) AND BARSLAST(X_59)>BARSLAST(X_60));
向上:DRAWLINE(X_62,LOW,X_61,HIGH,0),DOTLINE,COLORYELLOW;
向下:DRAWLINE(X_61,HIGH,X_62,LOW,0),DOTLINE,COLORWHITE;
X_63:=DRAWLINE(X_61,HIGH,REF(X_61,1),REF(HIGH,1),1);
找底:DRAWLINE(X_62,LOW,REF(X_62,1),REF(LOW,1),1),COLORRED;
DRAWNUMBER(X_62,LOW*0.995,LOW);
DRAWNUMBER(X_61,HIGH*1.01,HIGH);
X_64:=CROSS(CLOSE,X_63) AND X_63>0 AND X_15 AND X_19;
X_65:=9;
X_66:=IF(HIGH>PEAK(1,X_65,1),HHV(HIGH,X_65),PEAK(1,X_65,1));
X_67:=IF(LOW<TROUGH(2,X_65,1),LLV(LOW,X_65),TROUGH(2,X_65,1));
X_68:=TROUGHBARS(2,X_65,1);
X_69:=PEAKBARS(1,X_65,1);
X_70:=IF(X_69<X_68,BACKSET(ISLASTBAR,X_69),IF(X_68<X_69,BACKSET(ISLASTBAR,X_68),0));
X_71:=SQRT(HIGH*找底);
STICKLINE(UPNDAY(HIGH,1) AND HIGH=向上,HIGH,找底,0,0),COLORMAGENTA;
STICKLINE(HIGH>REF(HIGH,DAYSTOTODAY<5),HIGH,找底,0,0),COLORRED;
STICKLINE(X_61,X_71,X_71,1,0),COLORMAGENTA;
STICKLINE(HIGH>REF(HIGH,DAYSTOTODAY<5),X_71,X_71,1,0),COLORRED;
考虑买:DRAWLINE(X_61,X_71,REF(HIGH,BARSLAST(X_61))>HHV(HIGH,BARSLAST(X_61)),REF(X_71,BARSLAST(X_61)),1),COLORMAGENTA;
X_72:=20;
X_73:=7;
X_74:=79;
X_75:=(CLOSE+HIGH+LOW)/3;
X_76:=EMA(X_75,10);
X_77:=REF(X_76,1);
DRAWICON(REF(X_76<X_77,1) AND X_76>X_77,LOW-0.05,1);
DRAWTEXT(REF(X_76<X_77,1) AND X_76>X_77,LOW,748),COLORYELLOW;
X_78:=(REF(HIGH,1)+REF(LOW,1))/2;
X_79:=MA(CLOSE,X_72)+2*STD(CLOSE,X_72);
DRAWICON(CROSS(X_78,X_79),HIGH+0.1,2);
DRAWTEXT(CROSS(X_78,X_79),HIGH*1.02,749),COLORGREEN;
X_80:=REF(CLOSE,1);
X_81:=SMA(MAX(CLOSE-X_80,0),X_73,1)/SMA(ABS(CLOSE-X_80),X_73,1)*100;
X_82:=CROSS(X_74,X_81);
X_83:=FILTER(X_82,4);
DRAWICON(X_83,HIGH+0.1,2);
DRAWTEXT(X_83,HIGH*1.02,749),COLORGREEN;
 

20226713353619932.png

20226713353619932.png
 

20226713354449550.png

20226713354449550.png

20226713351878411.rar

6.76 KB, 下载次数: 0

售价: 3 金钱  [记录]  [购买]

20226713351878411.rar

回复

使用道具 举报

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

本版积分规则