股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信高低点预测主图指标公式源码


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2024-6-3 14:09:03

显示开关:=1;
顶价:=REF(H,BARSLAST(H>REF(H,1)));
底价:=REF(L,BARSLAST(L<REF(L,1)));
分型顶0:=H>REF(顶价,1) AND L>REF(底价,1);
分型底0:=L<REF(底价,1) AND H<REF(顶价,1);
分型顶1:=分型顶0 AND H=HHV(H,BARSLAST(分型底0));
分型底1:=分型底0 AND L=LLV(L,BARSLAST(分型顶0));
分型顶:=FILTERX(分型顶1,BARSLAST(分型底1));
分型底:=FILTERX(分型底1,BARSLAST(分型顶1));
UP1:=BARSLAST(分型底);
顶力度1:=HHV(L,UP1+1)>LLV(H,UP1+1);
顶包含1:=COUNT(L>REF(L,1),UP1)>2 AND COUNT(H>REF(H,1),UP1)>2;
DN1:=BARSLAST(分型顶);
底力度1:=HHV(L,DN1+1)>LLV(H,DN1+1);
底包含1:=COUNT(H<REF(H,1),DN1)>2 AND COUNT(L<REF(L,1),DN1)>2;
牛股顶10:=分型顶 AND UP1>3 AND 顶力度1 AND 顶包含1;
牛股底10:=分型底 AND DN1>3 AND 底力度1 AND 底包含1;
牛股顶11:=牛股顶10 AND H=HHV(H,BARSLAST(牛股底10));
牛股底11:=牛股底10 AND L=LLV(L,BARSLAST(牛股顶10));
牛股顶12:=牛股顶11 AND H=HHV(H,BARSLAST(牛股底11));
牛股底12:=牛股底11 AND L=LLV(L,BARSLAST(牛股顶11));
牛股顶1:=FILTERX(牛股顶12,BARSLAST(牛股底12));
牛股底1:=FILTERX(牛股底12,BARSLAST(牛股顶12));
UP2:=BARSLAST(牛股底1);
顶力度2:=HHV(L,UP2+1)>LLV(H,UP2+1);
顶包含2:=COUNT(L>REF(L,1),UP2)>2 AND COUNT(H>REF(H,1),UP2)>2;
DN2:=BARSLAST(牛股顶1);
底力度2:=HHV(L,DN2+1)>LLV(H,DN2+1);
底包含2:=COUNT(H<REF(H,1),DN2)>2 AND COUNT(L<REF(L,1),DN2)>2;
牛股顶20:=分型顶 AND UP2>3 AND 顶力度2 AND 顶包含2;
牛股底20:=分型底 AND DN2>3 AND 底力度2 AND 底包含2;
牛股顶21:=牛股顶20 AND H=HHV(H,BARSLAST(牛股底20));
牛股底21:=牛股底20 AND L=LLV(L,BARSLAST(牛股顶20));
牛股顶2:=FILTERX(牛股顶21,BARSLAST(牛股底21));
牛股底2:=FILTERX(牛股底21,BARSLAST(牛股顶21));
牛股顶3:=牛股顶1 OR 牛股顶2;
牛股底3:=牛股底1 OR 牛股底2;
牛股顶41:=FILTERX(牛股顶3 AND H=HHV(H,BARSLAST(牛股底3)),BARSLAST(牛股底3));
牛股底41:=FILTERX(牛股底3 AND L=LLV(L,BARSLAST(牛股顶3)),BARSLAST(牛股顶3));
牛股顶42:=FILTERX(牛股顶41 AND H=HHV(H,BARSLAST(牛股底41)),BARSLAST(牛股底41));
牛股底42:=FILTERX(牛股底41 AND L=LLV(L,BARSLAST(牛股顶41)),BARSLAST(牛股顶41));
牛股顶431:=牛股顶42 AND (BARSLAST(牛股底42)>1 OR BARSLAST(牛股底42)=DRAWNULL);
牛股底431:=牛股底42 AND (BARSLAST(牛股顶42)>1 OR BARSLAST(牛股顶42)=DRAWNULL);
牛股顶432:=牛股顶431 AND (H=HHV(H,BARSLAST(牛股底431)) OR BARSLAST(牛股底431)=DRAWNULL);
牛股底432:=牛股底431 AND (L=LLV(L,BARSLAST(牛股顶431)) OR BARSLAST(牛股顶431)=DRAWNULL);
牛股顶43:=FILTERX(牛股顶432,BARSLAST(牛股底431));
牛股底43:=FILTERX(牛股底432,BARSLAST(牛股顶431));
牛股顶441:=牛股顶43 AND (BARSLAST(牛股底43)>2 OR BARSLAST(牛股底43)=DRAWNULL);
牛股底441:=牛股底43 AND (BARSLAST(牛股顶43)>2 OR BARSLAST(牛股顶43)=DRAWNULL);
牛股顶442:=牛股顶441 AND (H=HHV(H,BARSLAST(牛股底441)) OR BARSLAST(牛股底441)=DRAWNULL);
牛股底442:=牛股底441 AND (L=LLV(L,BARSLAST(牛股顶441)) OR BARSLAST(牛股顶441)=DRAWNULL);
牛股顶44:=FILTERX(牛股顶442,BARSLAST(牛股底441));
牛股底44:=FILTERX(牛股底442,BARSLAST(牛股顶441));
牛股顶451:=牛股顶44 AND (BARSLAST(牛股底44)>3 OR BARSLAST(牛股底44)=DRAWNULL);
牛股底451:=牛股底44 AND (BARSLAST(牛股顶44)>3 OR BARSLAST(牛股顶44)=DRAWNULL);
牛股顶452:=牛股顶451 AND (H=HHV(H,BARSLAST(牛股底451)) OR BARSLAST(牛股底451)=DRAWNULL);
牛股底452:=牛股底451 AND (L=LLV(L,BARSLAST(牛股顶451)) OR BARSLAST(牛股顶451)=DRAWNULL);
牛股顶45:=FILTERX(牛股顶452,BARSLAST(牛股底452));
牛股底45:=FILTERX(牛股底452,BARSLAST(牛股顶452));
DN511:=BARSLAST(牛股顶45);
底力度511:=HHV(L,DN511+1)>LLV(H,DN511+1);
底包含511:=COUNT(H<REF(H,1),DN511)>2 AND COUNT(L<REF(L,1),DN511)>2;
牛股底511:=牛股底43 AND (牛股底45<>1) AND DN511>3 AND 底力度511 AND 底包含511 AND (L=LLV(L,BARSLAST(牛股顶45)));
牛股底51:=FILTERX(牛股底511,BARSLAST(牛股顶45));
UP512:=BARSLAST(牛股底45);
顶力度512:=HHV(L,UP512+1)>LLV(H,UP512+1);
顶包含512:=COUNT(L>REF(L,1),UP512)>2 AND COUNT(H>REF(H,1),UP512)>2;
牛股顶512:=牛股顶43 AND (牛股顶45<>1) AND UP512>3 AND 顶力度512 AND 顶包含512 AND (H=HHV(H,BARSLAST(牛股底45)));
牛股顶51:=FILTERX(牛股顶512,BARSLAST(牛股底45));
牛股顶521:=牛股顶45 OR 牛股顶51;
牛股底521:=牛股底45 OR 牛股底51;
牛股顶52:=FILTERX(牛股顶521 AND H=HHV(H,BARSLAST(牛股底521)),BARSLAST(牛股底521));
牛股底52:=FILTERX(牛股底521 AND L=LLV(L,BARSLAST(牛股顶521)),BARSLAST(牛股顶521));
UP53:=BARSLAST(牛股底52);
顶力度53:=HHV(L,UP53+1)>LLV(H,UP53+1);
顶包含53:=COUNT(L>REF(L,1),UP53)>2 AND COUNT(H>REF(H,1),UP53)>2;
DN53:=BARSLAST(牛股顶52);
底力度53:=HHV(L,DN53+1)>LLV(H,DN53+1);
底包含53:=COUNT(H<REF(H,1),DN53)>2 AND COUNT(L<REF(L,1),DN53)>2;
牛股顶53:=牛股顶52 AND UP53>3 AND 顶力度53 AND 顶包含53 AND (H=HHV(H,BARSLAST(牛股底52)));
牛股底53:=牛股底52 AND DN53>3 AND 底力度53 AND 底包含53 AND (L=LLV(L,BARSLAST(牛股顶52)));
牛股顶54:=FILTERX(牛股顶53 AND H=HHV(H,BARSLAST(牛股底53)),BARSLAST(牛股底53));
牛股底54:=FILTERX(牛股底53 AND L=LLV(L,BARSLAST(牛股顶53)),BARSLAST(牛股顶53));
牛股顶55:={分型顶 AND}H=HHV(H,BARSLAST(牛股底54)) AND L>LLV(L,BARSLAST(牛股底54)) AND BARSLAST(牛股顶54)<BARSLAST(牛股底54) AND (BARSNEXT(牛股底54)<BARSNEXT(牛股顶54) OR BARSNEXT(牛股顶54)=DRAWNULL);
牛股底55:={分型底 AND}L=LLV(L,BARSLAST(牛股顶54)) AND H<HHV(H,BARSLAST(牛股顶54)) AND BARSLAST(牛股底54)<BARSLAST(牛股顶54) AND (BARSNEXT(牛股顶54)<BARSNEXT(牛股底54) OR BARSNEXT(牛股底54)=DRAWNULL);
牛股顶56:=牛股顶54 OR 牛股顶55;
牛股底56:=牛股底54 OR 牛股底55;
牛股顶6:=FILTERX(牛股顶56 AND H=HHV(H,BARSLAST(牛股底56)),BARSLAST(牛股底56));
牛股底6:=FILTERX(牛股底56 AND L=LLV(L,BARSLAST(牛股顶56)),BARSLAST(牛股顶56));
牛股顶7:=牛股顶6 AND BARSLAST(牛股底6)>3;
牛股底7:=牛股底6 AND BARSLAST(牛股顶6)>3;
牛股顶:=BARSLAST(牛股顶6),NODRAW;
牛股底:=BARSLAST(牛股底6),NODRAW;
NOTEXT_上牛股:DRAWLINE(牛股底=0,L,牛股顶=0,H,0),COLORGREEN,LINETHICK2;
NOTEXT_下牛股:DRAWLINE(牛股顶=0,H,牛股底=0,L,0),COLOR0000FF,LINETHICK2;
L低:=REF(L,牛股底);
H高:=REF(H,牛股顶);
L低A:=IF(牛股顶<牛股底 AND 显示开关=1 OR 显示开关=2,L低,DRAWNULL);
H高A:=IF(牛股顶<牛股底 AND 显示开关=1 OR 显示开关=2,H高,DRAWNULL);
PB1A:=POW(L低A,0.382)*POW(H高A,0.618);
PB2A:=SQRT(L低A*H高A);
PB3A:=POW(L低A,0.618)*POW(H高,0.382);
PB4A:=POW(L低A,0.875)*POW(H高A,0.125);
PB5A:=H高A-(H高A-L低A)*1.236,NODRAW;
PB6A:=H高A-(H高A-L低A)*1.618,NODRAW;
DRAWTEXT(牛股顶,(PB1A),VARCAT('PB1=',VAR2STR(PB1A,2))),COLORYELLOW;
DRAWTEXT(牛股顶,(PB2A),VARCAT('PB2=',VAR2STR(PB2A,2))),COLORYELLOW;
DRAWTEXT(牛股顶,(PB3A),VARCAT('PB3=',VAR2STR(PB3A,2))),COLORYELLOW;
DRAWTEXT(牛股顶,(PB4A),VARCAT('PB4=',VAR2STR(PB4A,2))),COLORYELLOW;
DRAWTEXT(牛股顶,(PB5A),VARCAT('PB5=',VAR2STR(PB5A,2))),COLORYELLOW;
DRAWTEXT(牛股顶,(PB6A),VARCAT('PB6=',VAR2STR(PB6A,2))),COLORYELLOW;
STICKLINE(牛股顶<牛股底,PB1A,PB1A,3,1),COLORFF8800;
STICKLINE(牛股顶<牛股底,PB2A,PB2A,3,1),COLORFF8800;
STICKLINE(牛股顶<牛股底,PB3A,PB3A,3,1),COLORFF8800;
STICKLINE(牛股顶<牛股底,PB4A,PB4A,3,1),COLORFF8800;
STICKLINE(牛股顶<牛股底,PB5A,PB5A,3,1),COLORFF8800;
STICKLINE(牛股顶<牛股底,PB6A,PB6A,3,1),COLORFF8800;
STICKLINE(牛股顶=0,H,PB6A,0,0),COLORFF8800;
L低B:=IF(牛股顶>牛股底 AND 显示开关=1 OR 显示开关=3,L低,DRAWNULL);
H高B:=IF(牛股顶>牛股底 AND 显示开关=1 OR 显示开关=3,H高,DRAWNULL);
PS1B:=POW(H高B,0.382)*POW(L低B,0.618);
PS2B:=SQRT(H高B*L低B);
PS3B:=POW(H高B,0.618)*POW(L低B,0.382);
PS4B:=POW(H高B,0.875)*POW(L低B,0.125);
PS5B:=L低B+(H高B-L低B)*1.236,NODRAW;
PS6B:=L低B+(H高B-L低B)*1.618,NODRAW;
DRAWTEXT(牛股底,(PS1B),VARCAT('PS1=',VAR2STR(PS1B,2))),COLORWHITE;
DRAWTEXT(牛股底,(PS2B),VARCAT('PS2=',VAR2STR(PS2B,2))),COLORWHITE;
DRAWTEXT(牛股底,(PS3B),VARCAT('PS3=',VAR2STR(PS3B,2))),COLORWHITE;
DRAWTEXT(牛股底,(PS4B),VARCAT('PS4=',VAR2STR(PS4B,2))),COLORWHITE;
DRAWTEXT(牛股底,(PS5B),VARCAT('PS5=',VAR2STR(PS5B,2))),COLORWHITE;
DRAWTEXT(牛股底,(PS6B),VARCAT('PS6=',VAR2STR(PS6B,2))),COLORWHITE;
STICKLINE(牛股顶>牛股底,PS1B,PS1B,3,1),COLORMAGENTA;
STICKLINE(牛股顶>牛股底,PS2B,PS2B,3,1),COLORMAGENTA;
STICKLINE(牛股顶>牛股底,PS3B,PS3B,3,1),COLORMAGENTA;
STICKLINE(牛股顶>牛股底,PS4B,PS4B,3,1),COLORMAGENTA;
STICKLINE(牛股顶>牛股底,PS5B,PS5B,3,1),COLORMAGENTA;
STICKLINE(牛股顶>牛股底,PS6B,PS6B,3,1),COLORMAGENTA;
STICKLINE(牛股底=0,L,PS6B,0,0),COLORMAGENTA;
DRAWTEXT(牛股底=0,L,VARCAT('【低点】',VAR2STR(底价,2))),COLORGREEN;
DRAWTEXT(牛股顶=0,H,VARCAT('【高点】',VAR2STR(顶价,2))),COLORRED;
DRAWICON(牛股顶=0,H,2);
DRAWICON(牛股底=0,L,1);





回复

举报

QQ|

GMT+8, 2024-11-16 22:02

快速回复 返回顶部 返回列表