通达信股票短趋势主图指标公式

DRAWKLINE(H,O,L,C);
UR:=250;{自行调节参数为长中短}
LR:=250;{自行调节参数为长中短}
TC1:=IF(H=HHV(H,1*UR),H,DRAWNULL);
TC2:=CONST(BArslAST(TC1=H))+1;
UPPER:=CONST(IF(TC2=1,H,REF(H,TC2-1)));
BC1:=IF(L=LLV(L,1*LR),L,DRAWNULL);
BC2:=CONST(BARSLAST(BC1=L))+1;
LOWER:=CONST(IF(BC2=1,L,REF(L,BC2-1)));
LP:=CURRBARSCOUNT<=BC2 AND L=LOWER;{低点定位}
HP:=CURRBARSCOUNT<=TC2 AND H=UPPER;{高点定位}
STICKLINE(IF(BC2>TC2,HP,LP),LOWER,UPPER,0,0),COLOR628962;
STICKLINE(IF(BC2>TC2,LP,HP),LOWER,UPPER,0,0),COLOR628962;
NOD:=(IF(TC2>BC2,TC2,BC2)-IF(TC2>BC2,BC2,TC2));{用时}
LR1:=MA(C,NOD+1);
NP:IF(CURRBARSCOUNT<=MAX(BC2,TC2),CONST(IF(MIN(TC2,BC2)=1,LR1,REF(LR1,MIN(TC2,BC2)-1))),DRAWNULL),POINTDOT,COLOR93BDA8;{近点}
LR2:=SLOPE(C,NOD+1);
LR3:=CONST(IF(MIN(TC2,BC2)=1,LR2,REF(LR2,MIN(TC2,BC2)-1)));
FP:=NP-LR3*(NOD),POINTDOT,COLOR93BDA8;{远点}
EQU:(NP+FP)/2,POINTDOT,COLOR93BDA8;{中点}
A:(NP+EQU)/2,COLORGRAY;
B:(NP+A)/2,COLORGRAY;
D:(EQU+A)/2,COLORGRAY;
AD:=Abs(NP-FP);{高差};
DBL:=BARSLAST(BC1!=DRAWNULL)+1;
DBH:=BARSLAST(TC1!=DRAWNULL)+1;
BSP:=IF(BC2>TC2,DBL,DBH)-1;
LRL:=IF(NP>FP,FP+AD/NOD*BSP,FP-AD/NOD*BSP);
AT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND H>LRL,H,LRL);
AT2:=HHV(AT1-LRL,MAX(BC2,TC2));
AT3:=CONST(BARSLAST(AT1-LRL=AT2));
AT4:=CONST(IF(AT3=0,H,REF(H,AT3)));
AT5:=CONST(IF(AT3=0,AT1-LRL,REF(AT1-LRL,AT3)));
ATL:=LRL+AT5;
UT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND L<LRL,L,LRL);
UT2:=HHV(LRL-UT1,MAX(BC2,TC2));
UT3:=CONST(BARSLAST(LRL-UT1=UT2));
UT4:=CONST(IF(UT3=0,H,REF(H,UT3)));
UT5:=CONST(IF(UT3=0,LRL-UT1,REF(LRL-UT1,UT3)));
UTL:=LRL-UT5;
RH:=IF(CURRBARSCOUNT>=MAX(BC2,TC2)-5,ATL,CONST(REF(ATL,MIN(BC2,TC2)-5)));{限制高}
RL:=IF(CURRBARSCOUNT>=MAX(BC2,TC2)+5,UTL,CONST(REF(UTL,MIN(BC2,TC2)+5)));{限制低}
上:IF(NP>FP,IF(ATL<=RH,ATL,DRAWNULL),IF(ATL>=RL,ATL,DRAWNULL)),COLORLIRED;
下:IF(NP>FP,IF(UTL<=RH,UTL,DRAWNULL),IF(UTL>=RL,UTL,DRAWNULL)),COLORLIBLUE;
中轨:IF(C>0,(上+下)/2,DRAWNULL),COLORYELLOW;
上轨:=IF(上>REF(上,1),上,DRAWNULL),COLORLIRED;
下轨:=IF(下<REF(下,1),下,DRAWNULL),COLORGREEN;
(上轨+中轨)/2,COLORLIRED,DOTLINE;
(下轨+中轨)/2,COLORGREEN,DOTLINE;
中轨-(上轨-(上轨+中轨)/2),COLORLIRED,DOTLINE;
中轨+((下轨+中轨)/2-下轨),COLORGREEN,DOTLINE;
{以下是股票之友自创思路和划线}
辅助下:=IF(NP>FP,IF(UTL<=RH,UTL,DRAWNULL),IF(UTL<=RL,UTL,DRAWNULL)),COLORLIBLUE;
辅助下轨:=IF(辅助下<REF(辅助下,1),辅助下,DRAWNULL),COLORGREEN;
辅助中轨:=IF(C>0,(上+辅助下)/2,DRAWNULL),COLORYELLOW;
HHV(辅助中轨,0),COLORYELLOW;
IF(上>REF(上,1) AND HHV(上,0)=REF(HHV(上,0),1),HHV(上,0),DRAWNULL),COLORLIMAGENTA,DOTLINE,LINETHICK3;
IF(上>REF(上,1) AND HHV(上,0)=REF(HHV(上,0),1),HHV((上轨+中轨)/2,0),DRAWNULL),COLORLIMAGENTA,DOTLINE,LINETHICK3;
IF(上>REF(上,1) AND HHV(上,0)=REF(HHV(上,0),1),HHV(中轨-(上轨-(上轨+中轨)/2),0),DRAWNULL),COLORLIMAGENTA,DOTLINE,LINETHICK3;
IF(辅助下<REF(辅助下,1) AND HHV(辅助下,0)=REF(HHV(辅助下,0),1),HHV(辅助下,0),DRAWNULL),COLORBLUE,DOTLINE,LINETHICK3;
IF(辅助下<REF(辅助下,1) AND HHV(辅助下,0)=REF(HHV(辅助下,0),1),HHV((辅助下轨+辅助中轨)/2,0),DRAWNULL),COLORBLUE,DOTLINE,LINETHICK3;
IF(辅助下<REF(辅助下,1) AND HHV(辅助下,0)=REF(HHV(辅助下,0),1),HHV((辅助中轨+((辅助下轨+辅助中轨)/2-辅助下轨)),0),DRAWNULL),COLORBLUE,DOTLINE,LINETHICK3;
IF(上>REF(上,1),上,DRAWNULL),COLORLIRED;
IF(下<REF(下,1),下,DRAWNULL),COLORGREEN;
(上轨+中轨)/2,COLORLIRED,DOTLINE;
(下轨+中轨)/2,COLORGREEN,DOTLINE;
中轨-(上轨-(上轨+中轨)/2),COLORLIRED,DOTLINE;
中轨+((下轨+中轨)/2-下轨),COLORGREEN,DOTLINE;




来函数检测结果如下:
该公式没有未来函数

解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  股票指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股票指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股票指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图