精忠报国 — 牛散同盟会通达信公式 主图 源码附图
CC:=IF(CURRBARSCOUNT<18,CONST(REF(C,1)),DRAWNULL);
止赢:1.05*CC,COLOR8000FF;
止损:0.97*CC,COLORLIBLUE;
V1:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);
V2:=(1-7/100)*(DMA(CLOSE,V1));
V3:=(1+7/100)*(DMA(CLOSE,V1));
V5:=MA((LOW+HIGH+CLOSE)/3,5);
支撑:REFDATE(V2,DATE),DOTLINE,LINETHICK1,COLORLIRED;
阻力:REFDATE(V3,DATE),DOTLINE,LINETHICK1,COLORGREEN;
DRAWTEXT(ISLASTBAR,阻力,'阻力'),COLORGREEN;
DRAWTEXT(ISLASTBAR,支撑,'支撑'),COLORLIRED;
AAA:=CONST(HHV(H*0.5,90));
AA:=(REF(CLOSE,1)+REF(CLOSE,2)+OPEN)/3;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.86,0.01,1,'今日保护价'),LINETHICK2,COLOR00FFFF;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.90,0.01,1,AA);
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.92,0.01,1,'元');
PT:=REF(H,1)-REF(L,1);
CDP:=(REF(H,1)+REF(L,1)+REF(C,1)*2)/4;
AH:=CDP+PT;
AL:=CDP-PT;
NH:=CDP*2-REF(L,1);
NL:=CDP*2-REF(H,1);
强:=IF(AH>REF(C,1)*1.1,REF(C,1)*1.1,AH);
阻:=IF(NH>强,(强-CDP)*0.618+CDP,NH);
M:=IF(AL<REF(C,1)/1.1,REF(C,1)/1.1,AL);
撑:=IF(NL<M,CDP-(CDP-M)*0.618,NL);
底:=IF(AL<REF(C,1)/1.1,REF(C,1)/1.1,AL);
今日保护价:=(REF(C,2)+REF(C,1)+O)/3 ;
顶点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,HHV(H, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORYELLOW,DOTLINE;
低点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORMAGENTA,DOTLINE;
DRAWTEXT(ISLASTBAR,顶点,'顶点'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,低点,'底点'),COLORMAGENTA;
BS:=1;
MA7:=MA(CLOSE,BS);
转强:=(6*H+5*REF(H,1)+4*REF(H,2)+3*REF(H,3)+2*REF(H,4)+1*REF(H,5))/(6+5+4+3+2+1);
转弱:=(6*L+5*REF(L,1)+4*REF(L,2)+3*REF(L,3)+2*REF(L,4)+1*REF(L,5))/(6+5+4+3+2+1);
BB2:=IF(C>REF(转强,1),1,IF(C<REF(转弱,1),-1,0));
DD2:=BARSLAST(NOT(BB2=0));
B:=IF(BB2=0,REF(BB2,DD2),BB2);
中短:=IF(B=-2,MA(HIGH,6),MA(LOW,6));
STICKLINE(MA7<中短,LOW,HIGH,0,1),COLORCYAN;
STICKLINE(MA7>中短,LOW,HIGH,0,1),COLORRED;
STICKLINE(((OPEN>CLOSE)AND(MA7<中短)),(CLOSE-0.003),OPEN,3.1,0),COLORCYAN;
STICKLINE(((OPEN<CLOSE)AND(MA7<中短)),CLOSE,OPEN,3.1,1),COLORCYAN;
STICKLINE(((OPEN>CLOSE)AND(MA7>中短)),OPEN,(CLOSE-0.003),3.1,0),COLORRED;
STICKLINE(((OPEN<CLOSE)AND(MA7>中短)),OPEN,CLOSE,3.1,1),COLORRED;
B点:=CROSS(MA7,中短);
持股:=MA7>中短;
DRAWICON(CROSS(MA7,中短),L*0.98,7);
DRAWICON(CROSS(中短,MA7),H*1.02,8);
{财务}
DRAWTEXT_FIX(1,0.01,0.05,0,'市盈率:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.06,0.05,0,CONST(DYNAINFO(39))),COLORYELLOW;
DRAWTEXT_FIX(1,0.12,0.05,0,'市净率:'),COLOR0080FF;
DRAWNUMBER_FIX(1,0.17,0.05,0,CONST(C/FINANCE(34))),COLOR0080FF;
DRAWTEXT_FIX(1,0.22,0.05,0,'每股收益(元):'),COLORFF00FF;
DRAWNUMBER_FIX(1,0.31,0.05,0,CONST(FINANCE(33))),COLORFF00FF;
{地区板块行业}
Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0.01,0.01,0,STRCAT(Z3,GNBLOCK)),COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
该公式包含未来函数:FINANCE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
CC赋值:IF(CURRBARSCOUNT<18,CONST(1日前的C),DRAWNULL)
输出止赢:1.05*CC,COLOR8000FF
输出止损:0.97*CC,COLORLIBLUE
V1赋值:(2*收盘价+最高价+最低价的绝对值/4-收盘价的20日简单移动平均)/收盘价的20日简单移动平均
V2赋值:(1-7/100)*(D收盘价的V1日简单移动平均)
V3赋值:(1+7/100)*(D收盘价的V1日简单移动平均)
V5赋值:MA((最低价+最高价+收盘价)/3,5)
输出支撑:REFDATE(V2,DATE),DOTLINE,LINETHICK1,COLORLIRED
输出阻力:REFDATE(V3,DATE),DOTLINE,LINETHICK1,画绿色
当满足条件ISLASTBAR时,在阻力和'阻力'位置书写文字
当满足条件ISLASTBAR时,在支撑和'支撑'位置书写文字
AAA赋值:CONST(90日内H*0.5最高值)
AA赋值:(1日前的收盘价+2日前的收盘价+开盘价)/3
当满足条件CURRBARSCOUNT=1时,在横轴0.86纵轴0.01位置书写文字
当满足条件CURRBARSCOUNT=1时,在横轴0.90纵轴0.01位置书写数字
当满足条件CURRBARSCOUNT=1时,在横轴0.92纵轴0.01位置书写文字
PT赋值:1日前的H-1日前的L
CDP赋值:(1日前的H+1日前的L+1日前的C*2)/4
AH赋值:CDP+PT
AL赋值:CDP-PT
NH赋值:CDP*2-1日前的L
NL赋值:CDP*2-1日前的H
强赋值:IF(AH>1日前的C*1.1,1日前的C*1.1,AH)
阻赋值:IF(NH>强,(强-CDP)*0.618+CDP,NH)
M赋值:IF(AL<1日前的C/1.1,1日前的C/1.1,AL)
撑赋值:IF(NL
底赋值:IF(AL<1日前的C/1.1,1日前的C/1.1,AL)
今日保护价赋值:(2日前的C+1日前的C+O)/3
输出顶点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,HHV(H, 上次CURRBARSCOUNT=60距今天数),1)),DRAWNULL),画黄色,DOTLINE
输出低点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L, 上次CURRBARSCOUNT=60距今天数),1)),DRAWNULL),COLORMAGENTA,DOTLINE
当满足条件ISLASTBAR时,在顶点和'顶点'位置书写文字
当满足条件ISLASTBAR时,在低点和'底点'位置书写文字
BS赋值:1
MA7:=收盘价的BS日简单移动平均
转强赋值:(6*H+5*1日前的H+4*2日前的H+3*3日前的H+2*4日前的H+1*5日前的H)/(6+5+4+3+2+1)
转弱赋值:(6*L+5*1日前的L+4*2日前的L+3*3日前的L+2*4日前的L+1*5日前的L)/(6+5+4+3+2+1)
BB2赋值:IF(C>1日前的转强,1,IF(C<1日前的转弱,-1,0))
DD2赋值:上次NOT(BB2=0距今天数)
B赋值:IF(BB2=0,DD2日前的BB2,BB2)
中短赋值:IF(B=-2,最高价的6日简单移动平均,最低价的6日简单移动平均)
当满足条件MA7<中短时,在最低价和最高价之间画柱状线
当满足条件MA7>中短时,在最低价和最高价之间画柱状线
STICKLINE(((开盘价>收盘价)AND(MA7<中短)),(收盘价-0.003),开盘价,3.1,0),画青色
STICKLINE(((开盘价<收盘价)AND(MA7<中短)),收盘价,开盘价,3.1,1),画青色
STICKLINE(((开盘价>收盘价)AND(MA7>中短)),开盘价,(收盘价-0.003),3.1,0),画红色
STICKLINE(((开盘价<收盘价)AND(MA7>中短)),开盘价,收盘价,3.1,1),画红色
B点:=MA7上穿中短
持股赋值:MA7>中短
DRAWICON(MA7上穿中短,L*0.98,7)
DRAWICON(中短上穿MA7,H*1.02,8)
当满足条件1时,在横轴0.01纵轴0.05位置书写文字
DRAWNUMBER_FIX(1,0.06,0.05,0,CONST(DYNAINFO(39))),画黄色
当满足条件1时,在横轴0.12纵轴0.05位置书写文字
DRAWNUMBER_FIX(1,0.17,0.05,0,CONST(C/FINANCE(34))),COLOR0080FF
输出DRAWTEXT_FIX(1,0.22,0.05,0,'每股收益(元):'),COLORFF00FF
DRAWNUMBER_FIX(1,0.31,0.05,0,CONST(FINANCE(33))),COLORFF00FF
{地区板块行业}
Z1赋值:STRCAT(HYBLOCK,' ')
Z2赋值:STRCAT(Z1,DYBLOCK)
Z3赋值:STRCAT(Z2,' ')
DRAWTEXT_FIX(ISLASTBAR,0.01,0.01,0,STRCAT(Z3,GNBLOCK)),画黄色