通达信龙趋势主图成龙必须突破 源码分享
X_36:=COST(1);
X_37:=COST(10);
X_38:=COST(20);
X_39:=COST(30);
X_40:=COST(40);
X_41:=COST(50);
X_42:=COST(60);
X_43:=COST(70);
X_44:=COST(80);
X_45:=COST(90);
X_46:=COST(99);
X_47:=COST(5);
X_48:=COST(15);
X_49:=COST(25);
X_50:=COST(35);
X_51:=COST(45);
X_52:=COST(55);
X_53:=COST(65);
X_54:=COST(75);
X_55:=COST(85);
X_56:=COST(95);
X_57:=X_47-X_36;
X_58:=X_37-X_47;
X_59:=X_48-X_37;
X_60:=X_38-X_48;
X_61:=X_49-X_38;
X_62:=X_39-X_49;
X_63:=X_50-X_39;
X_64:=X_40-X_50;
X_65:=X_51-X_40;
X_66:=X_41-X_51;
X_67:=X_52-X_41;
X_68:=X_42-X_52;
X_69:=X_53-X_42;
X_70:=X_43-X_53;
X_71:=X_54-X_43;
X_72:=X_44-X_54;
X_73:=X_55-X_44;
X_74:=X_45-X_55;
X_75:=X_56-X_45;
X_76:=X_46-X_56;
X_77:=MIN(X_57,MIN(X_58,MIN(X_59,MIN(X_60,MIN(X_61,MIN(X_62,MIN(X_63,MIN(X_64,MIN(X_65,
MIN(X_66,MIN(X_67,MIN(X_68,MIN(X_69,MIN(X_70,MIN(X_71,MIN(X_72,MIN(X_73,MIN(X_74,
MIN(X_75,X_76)))))))))))))))))));
X_78:=IF(X_57=X_77,(X_47+X_36)/2,IF(X_58=X_77,(X_47+X_37)/2,IF(X_59=X_77,(X_48+X_37)
/2,IF(X_60=X_77,(X_48+X_38)/2,IF(X_61=X_77,(X_49+X_38)/2,IF(X_62=X_77,(X_49+X_39)
/2,IF(X_63=X_77,(X_50+X_39)/2,IF(X_64=X_77,(X_50+X_40)/2,IF(X_65=X_77,(X_51+X_40)
/2,IF(X_66=X_77,(X_51+X_41)/2,IF(X_67=X_77,(X_52+X_41)/2,IF(X_68=X_77,(X_52+X_42)
/2,IF(X_69=X_77,(X_53+X_42)/2,IF(X_70=X_77,(X_53+X_43)/2,IF(X_71=X_77,(X_54+X_43)
/2,IF(X_72=X_77,(X_54+X_44)/2,IF(X_73=X_77,(X_55+X_44)/2,IF(X_74=X_77,(X_55+X_45)
/2,IF(X_75=X_77,(X_56+X_45)/2,(X_56+X_46)/2)))))))))))))))))));
筹码峰线:X_78,NODRAW,COLOR00EEEE;
STICKLINE(ISLASTBAR,筹码峰线,筹码峰线*1.001,20,0),COLORYELLOW,LINETHICK3;
{Z字庄家成本线}
P1:=10;
N:=10;
M:=3;
NP:=10;
MP:=2.5;
TR1:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
UP:=(H+L)/2+MA(TR1,NP)*MP;
DN:=(H+L)/2-MA(TR1,NP)*MP;
L1:=REF(UP,BARSLAST(UP<=REF(UP,1)));
L2:=LLV(UP,N*1.5);
LL:=IF(L2<>REF(L2,1) AND L1<REF(L1,1),L1,IF(L1=L2,L1,L2));
S1:=BARSLAST(CROSS(0.5,UP=LL))+1;
S2:=CROSS(COUNT((CROSS(C,LL) OR CROSS(C,REF(LL,2))) AND UP>LL,S1),0.5);
A6:=BARSLAST(S2);
B6:=BARSLAST(CROSS(HHV(DN,A6+1),C));
BY:=CROSS(B6,A6);
SL:=CROSS(A6,B6);
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
SUPERTREN:IF(B6>A6,HHV(DN,BARSLAST(BY)+1),LLV(UP,BARSLAST(SL)+1)),COLORGREEN,LINETHICK6;
庄家成本线:IF(B6>A6,SUPERTREN,DRAWNULL),COLOR0000C8,LINETHICK6;
DRAWICON(CROSS(B6,A6),SUPERTREN*0.99,1);
DRAWICON(CROSS(A6,B6),SUPERTREN*1.015,2);
买进:CROSS(B6,A6)*100,NODRAW,COLORRED;
卖出:CROSS(A6,B6)*100,NODRAW;
未来函数检测结果如下:
该公式包含未来函数:COST
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
X_36赋值:获利盘为1%的成本分布
X_37赋值:获利盘为10%的成本分布
X_38赋值:获利盘为20%的成本分布
X_39赋值:获利盘为30%的成本分布
X_40赋值:获利盘为40%的成本分布
X_41赋值:获利盘为50%的成本分布
X_42赋值:获利盘为60%的成本分布
X_43赋值:获利盘为70%的成本分布
X_44赋值:获利盘为80%的成本分布
X_45赋值:获利盘为90%的成本分布
X_46赋值:获利盘为99%的成本分布
X_47赋值:获利盘为5%的成本分布
X_48赋值:获利盘为15%的成本分布
X_49赋值:获利盘为25%的成本分布
X_50赋值:获利盘为35%的成本分布
X_51赋值:获利盘为45%的成本分布
X_52赋值:获利盘为55%的成本分布
X_53赋值:获利盘为65%的成本分布
X_54赋值:获利盘为75%的成本分布
X_55赋值:获利盘为85%的成本分布
X_56赋值:获利盘为95%的成本分布
X_57赋值:X_47-X_36
X_58赋值:X_37-X_47
X_59赋值:X_48-X_37
X_60赋值:X_38-X_48
X_61赋值:X_49-X_38
X_62赋值:X_39-X_49
X_63赋值:X_50-X_39
X_64赋值:X_40-X_50
X_65赋值:X_51-X_40
X_66赋值:X_41-X_51
X_67赋值:X_52-X_41
X_68赋值:X_42-X_52
X_69赋值:X_53-X_42
X_70赋值:X_43-X_53
X_71赋值:X_54-X_43
X_72赋值:X_44-X_54
X_73赋值:X_55-X_44
X_74赋值:X_45-X_55
X_75赋值:X_56-X_45
X_76赋值:X_46-X_56
X_77赋值:MIN(X_57,MIN(X_58,MIN(X_59,MIN(X_60,MIN(X_61,MIN(X_62,MIN(X_63,MIN(X_64,MIN(X_65,MIN(X_66,MIN(X_67,MIN(X_68,MIN(X_69,MIN(X_70,MIN(X_71,MIN(X_72,MIN(X_73,MIN(X_74,MIN(X_75,X_76)))))))))))))))))))
X_78赋值:IF(X_57=X_77,(X_47+X_36)/2,IF(X_58=X_77,(X_47+X_37)/2,IF(X_59=X_77,(X_48+X_37)/2,IF(X_60=X_77,(X_48+X_38)/2,IF(X_61=X_77,(X_49+X_38)/2,IF(X_62=X_77,(X_49+X_39)/2,IF(X_63=X_77,(X_50+X_39)/2,IF(X_64=X_77,(X_50+X_40)/2,IF(X_65=X_77,(X_51+X_40)/2,IF(X_66=X_77,(X_51+X_41)/2,IF(X_67=X_77,(X_52+X_41)/2,IF(X_68=X_77,(X_52+X_42)/2,IF(X_69=X_77,(X_53+X_42)/2,IF(X_70=X_77,(X_53+X_43)/2,IF(X_71=X_77,(X_54+X_43)/2,IF(X_72=X_77,(X_54+X_44)/2,IF(X_73=X_77,(X_55+X_44)/2,IF(X_74=X_77,(X_55+X_45)/2,IF(X_75=X_77,(X_56+X_45)/2,(X_56+X_46)/2)))))))))))))))))))
输出筹码峰线:X_78,NODRAW,COLOR00EEEE
当满足条件ISLASTBAR时,在筹码峰线和筹码峰线*1.001之间画柱状线
{Z字庄家成本线}P1赋值:10
N赋值:10
M赋值:3
NP:=10
MP:=2.5
TR1赋值:MAX(MAX((最高价-最低价),1日前的收盘价-最高价的绝对值),ABS(1日前的收盘价-最低价))
UP赋值:(H+L)/2+TR1的NP日简单移动平均*MP
DN赋值:(H+L)/2-TR1的NP日简单移动平均*MP
L1赋值:REF(UP,上次UP<=REF(UP,1距今天数))
L2赋值:N*1.5日内UP最低值
LL赋值:IF(L2<>1日前的L2 AND L1<1日前的L1,L1,IF(L1=L2,L1,L2))
S1赋值:上次0.5上穿UP=LL距今天数+1
S2赋值:CROSS(COUNT((CROSS(C,LL) OR CROSS(C,2日前的LL)) AND UP>LL,S1),0.5)
A6赋值:上次S2距今天数
B6赋值:上次CROSS(A6+1日内DN最高值,C距今天数)
BY赋值:B6上穿A6
SL赋值:A6上穿B6
DRAWKLINE(最高价,OPEN,最低价,收盘价)
SUPERTRE输出N:IF(B6>A6,HHV(DN,上次BY距今天数+1),LLV(UP,BARSLAST(SL)+1)),COLORGREEN,LINETHICK6
如果B6>A6返回SUPERTREN否则返回DRAWNULL
DRAWICON(B6上穿A6,SUPERTREN*0.99,1)
DRAWICON(A6上穿B6,SUPERTREN*1.015,2)
输出买进:B6上穿A6*100,NODRAW,画红色
输出卖出:A6上穿B6*100,NODRAW