趋势主图,HX源码分享(通达信公式 主图 源码 测试图)

[复制链接]
查看22 | 回复0 | 2022-6-27 18:37:23 | 显示全部楼层 |阅读模式
{公式名称: 趋势主图
参数数量: 1
参数1: N, 最小: 1, 最大: 200, 缺省: 5
画线方法: 主图叠加}
 
VAR1:=REF(HIGH,N)=HHV(HIGH,2*N+1);
VAR2:=FILTER(VAR1,N);
VAR3:=BACKSET(VAR2,N+1);
VAR4:=FILTER(VAR3,N);
VAR5:=REF(LOW,N)=LLV(LOW,2*N+1);
VAR6:=FILTER(VAR5,N);
VAR7:=BACKSET(VAR6,N+1);
VAR8:=FILTER(VAR7,N);
VAR9:=(REF(LLV(LOW,2*N),1)+REF(HHV(HIGH,2*N),1))/2;
VAR10:=(HIGH+LOW)/2;
VAR11:=VAR4 AND NOT(VAR8 AND VAR9>=VAR10) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
VAR12:=VAR8 AND NOT(VAR4 AND VAR9<VAR10);
VAR13:=VAR4 AND NOT(VAR8 AND VAR9>=VAR10);
VAR14:=REF(BARSLAST(VAR11),1)+1;
VAR15:=BACKSET(VAR11 AND COUNT(VAR12,VAR14)>0,LLVBARS(IF(VAR12,LOW,10000),VAR14));
VAR16:=VAR15>REF(VAR15,1);
VAR17:=BACKSET(VAR16,2);
VAR18:=VAR17>REF(VAR17,1);
VAR19:=VAR18 OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
VAR20:=REF(BARSLAST(VAR19),1)+1;
VAR21:=BACKSET(VAR19 AND COUNT(VAR13,VAR20)>0,HHVBARS(IF(VAR13,HIGH,0),VAR20));
VAR22:=VAR21>REF(VAR21,1);
VAR23:=BACKSET(VAR22,2);
VAR24:=VAR23>REF(VAR23,1);
VAR25:=BACKSET(ISLASTBAR,BARSLAST(VAR24)+1);
VAR26:=VAR25>REF(VAR25,1);
VAR27:=BACKSET(ISLASTBAR,BARSLAST(VAR18)+1);
VAR28:=VAR27>REF(VAR27,1);
VAR29:=BACKSET(VAR26,REF(BARSLAST(VAR24),1)+2);
VAR30:=VAR29>REF(VAR29,1);
VAR31:=BACKSET(VAR28,REF(BARSLAST(VAR18),1)+2);
VAR32:=VAR31>REF(VAR31,1);
撑1:DRAWLINE(VAR30,HIGH,VAR26,HIGH,1),COLORFF8000;
撑2:DRAWLINE(VAR32,LOW,VAR28,LOW,1),COLORFF8000;
VAR33:=MA(CLOSE,1);
VAR34:=SMA(SMA(SMA(VAR33,2,1),2,1),2,1);
VAR35:=MA(VAR34,5);
VAR36:=REF(CLOSE,1);
VAR37:=DRAWBAND(VAR6,RGB(180,0,180),VAR35,RGB(256,100,100));
VAR38:=HHV(VOL,20);
STICKLINE(VAR38,OPEN,CLOSE,2,0),COLORFF0080;
VAR39:=IF((CLOSE-VAR36)*100/VAR36>=10-0.01*100/VAR36,1,0);
VAR40:=(VOL+REF(VOL,1)+REF(VOL,2)+REF(VOL,3)+REF(VOL,4))/5;
VAR41:=VAR40<REF(LLV(VAR40,60),1) AND (LOW>LLV(LOW,5) OR LLV(LOW,5)>LLV(LOW,10) OR LLV(LOW,5)>LLV(LOW,20)) AND COUNT(VAR39,7)=0;
STICKLINE(FILTERX(VAR41,40) AND VAR41 AND CURRBARSCOUNT<=40,LOW,LOW*0.98,40,0),COLORBROWN;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
VAR42:=FINANCE(7)/100000000*CLOSE;
VAR43:=IF(VAR42<30000000,VOL*10000/FINANCE(7),VOL*10000/FINANCE(7)*10);
STICKLINE(VAR39,OPEN,CLOSE,2,0),COLORRED;
VAR44:=IF((VAR7-CLOSE)*100/VAR7>=10-0.01*100/VAR7,1,0);
STICKLINE(VAR44,OPEN,CLOSE,2,0),COLORGREEN;
STICKLINE(VAR44,HIGH,LOW,0,1),COLORGREEN;
VAR45:=VOL<REF(VOL,1)*0.9 AND VAR43>0.5 AND CLOSE<OPEN AND CLOSE<REF(CLOSE,1) AND REF(CLOSE,2)<REF(CLOSE,1);
STICKLINE(VAR45,CLOSE,OPEN,2,0),COLORBLUE;
VAR46:=CLOSE<=OPEN AND (CLOSE>=REF(CLOSE,1) OR (OPEN>MAX(REF(CLOSE,1),REF(OPEN,1))*1.01 AND CLOSE>=REF(CLOSE,1)*0.995));
STICKLINE(VAR46 AND HIGH<REF(HIGH,1) AND REF(OPEN,1)>REF(CLOSE,1),LOW,HIGH,0.5,0),COLORRED;
STICKLINE(VAR46,OPEN,CLOSE,3,(-1)),COLORCYAN;
VAR47:=REF(CLOSE,1)>REF(OPEN,1) AND CLOSE<OPEN AND CLOSE<REF(CLOSE,1) AND (VOL>REF(VOL,1)*1.005 OR (VOL>REF(VOL,1) AND CLOSE>REF(OPEN,1))) AND (CLOSE>1000 OR (CLOSE<1000 AND REF(CLOSE,1)>REF(CLOSE,2)*1.03) OR (CLOSE<1000 AND CLOSE<REF(CLOSE,1)*0.975));
STICKLINE(VAR47,CLOSE,OPEN,(-1),0),COLOR004000;
VAR48:=ABS(CLOSE-OPEN)/IF(HIGH-LOW=0,100,HIGH-LOW);
VAR49:=ABS(CLOSE-OPEN)/OPEN;
WEI21:IF(CODELIKE(21),(HIGH-LOW)*0.5+LOW,IF(CLOSE>OPEN,(CLOSE-OPEN)*0.5+OPEN,(OPEN-CLOSE)*0.5+CLOSE)),NODRAW;
STICKLINE(VAR49>=0.03 AND VAR48>=0.03 OR CLOSE>1000,WEI21,WEI21,(-1),0),COLORMAGENTA;
VAR50:=1.9;
VAR51:=REF(CLOSE,1);
VAR52:=CLOSE<0.96*OPEN OR CLOSE<=VAR51*0.96 OR CLOSE>1000 AND CLOSE<=VAR51*0.98;
VAR53:=BARSLAST(FILTER(VAR52,3));
大阴实顶:REF(OPEN,VAR53),POINTDOT,COLORLIGREEN;
大阴二一:REF((LOW+HIGH)/2,VAR53),NODRAW;
VAR54:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
VAR55:=NAMELIKE(22) OR NAMELIKE(23) OR NAMELIKE(24) AND VAR54>=4.945;
VAR56:=NAMELIKE(22) OR NAMELIKE(23) OR NAMELIKE(24) AND VAR54<=(-4.945);
VAR57:=IF(VAR55,REF(CLOSE,1)*1.05,REF(CLOSE,1)*1.1);
VAR58:=IF(VAR56,REF(CLOSE,1)*0.95,REF(CLOSE,1)*0.9);
VAR59:=1.3;
VAR60:=1;
VAR61:=0;
VAR62:=MA(CLOSE,5);
VAR63:=MA(CLOSE,10);
VAR64:=MA(CLOSE,20);
VAR65:=VAR62>REF(VAR62,1) AND VAR63<REF(VAR63,1) AND VAR64<REF(VAR64,1);
VAR66:=REF(VOL,1);
VAR67:=REF(VOL,2);
VAR68:=REF(VOL,3);
VAR69:=REF(CLOSE,2);
VAR70:=REF(CLOSE,3);
VAR71:=REF(CLOSE,4);
VAR72:=REF(OPEN,1);
VAR73:=REF(OPEN,2);
VAR74:=REF(OPEN,3);
VAR75:=REF(OPEN,4);
VAR76:=CLOSE>=VAR70 AND VAR51>=VAR70 AND VAR69>=VAR70;
VAR77:=LOW>VAR74 AND REF(LOW,1)>VAR74 AND REF(LOW,2)>VAR74;
VAR78:=AMOUNT/VOL/100;
VAR79:=REF(VAR78,1);
VAR80:=REF(VAR78,2);
VAR81:=CLOSE>=OPEN OR (CLOSE<OPEN AND VAR78>VAR51);
VAR82:=COUNT(VAR81,3)>=2;
VAR83:=VAR70>VAR74;
VAR84:=VAR78>=VAR79 OR CLOSE>VAR51 AND (VAR79>=VAR80 OR VAR51>=VAR69);
VAR85:=(CLOSE+VAR51+VAR69)/3>VAR70;
VAR86:=VOL>VAR66 AND VAR66>VAR67;
VAR87:=VOL<=VAR66 AND VAR66<=VAR67;
VAR88:=(VOL+VAR66+VAR67)/3<=VAR68 AND NOT(VAR86);
VAR89:=CLOSE/VOL;
VAR90:=VAR89>=REF(VAR89,1) AND REF(VAR89,1)>=REF(VAR89,2);
VAR91:=(CLOSE+VAR51+VAR69)/3/VAR70;
VAR92:=(VOL+VAR66+VAR67)/3/VAR68;
VAR93:=VAR59*VAR91/VAR92>1;
VAR94:=VAR74>VAR71 AND VAR71>VAR75;
VAR95:=VAR83 AND VAR84 AND VAR87 AND VAR76 AND VAR77 AND VAR94;
VAR96:=BACKSET(VAR95,5);
VAR97:=FILTER(VAR96,4);
VAR98:=VAR83 AND VAR84 AND VAR87 AND VAR76 AND VAR77;
VAR99:=BACKSET(VAR98,4);
VAR100:=FILTER(VAR99,3);
VAR101:=VAR98 AND REF(VAR98,1);
VAR102:=BACKSET(VAR101,4);
VAR103:=FILTER(VAR102,3);
VAR104:=VAR98 AND REF(VAR98,2);
VAR105:=BACKSET(VAR104,4);
VAR106:=FILTER(VAR105,3);
VAR107:=VAR98 AND REF(VAR98,3);
VAR108:=BACKSET(VAR107,4);
VAR109:=FILTER(VAR108,3);
VAR110:=VAR83 AND VAR84 AND VAR88 AND NOT(VAR86) AND VAR76 AND VAR77 AND VAR94 AND NOT(VAR98) AND NOT(VAR95);
VAR111:=BACKSET(VAR110,5);
VAR112:=FILTER(VAR111,4);
VAR113:=VAR83 AND VAR84 AND VAR88 AND NOT(VAR86) AND VAR76 AND VAR77 AND NOT(VAR98) AND NOT(VAR95);
VAR114:=BACKSET(VAR113,4);
VAR115:=FILTER(VAR114,3);
VAR116:=VAR113 AND REF(VAR113,1);
VAR117:=BACKSET(VAR116,4);
VAR118:=FILTER(VAR117,3);
VAR119:=VAR113 AND REF(VAR113,2);
VAR120:=BACKSET(VAR119,4);
VAR121:=FILTER(VAR120,3);
VAR122:=VAR113 AND REF(VAR113,3);
VAR123:=BACKSET(VAR122,4);
VAR124:=FILTER(VAR123,3);
VAR125:=VAR83 AND VAR85 AND VAR87 AND VAR76 AND VAR77 AND VAR94 AND NOT(VAR98) AND NOT(VAR113) AN

p20206141965398321.jpg

p20206141965398321.jpg

20206141964898884.rar

11.23 KB, 下载次数: 0

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

20206141964898884.rar

回复

使用道具 举报

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

本版积分规则