以下是通达信红绿金盾线A简单买和卖公式主图源码(无源码的请下载附件导入)
{INPUT:N(1,250,120);}
NH:=120;
KK:=BARSLAST(CURRBARSCOUNT=NH);
GD:=CONST(IF(ISLASTBAR=1,HHV(H,KK),0));
DD:=CONST(IF(ISLASTBAR=1,LLV(L,KK),0));
KJ:=GD-DD;
GD4:=IF(CURRBARSCOUNT<=NH/2,GD,DRAWNULL);
DRAWBAND(GD4,RGB(80,80,30),DD+KJ/2,RGB(0,0,0));{该行设置背景色}
突破:REF(EMA(C,14),1)COLORRED,LINETHICK2;
A1X:=(EMA(C,14)-突破)/突破*100,NODRAW;
多方:IF(A1X>=0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1),DRAWNULL)COLORRED,LINETHICK2;
IF(A1X>=0,突破,DRAWNULL),COLORRED,LINETHICK2;
空方:IF(A1X<0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1),DRAWNULL)COLORGREEN,LINETHICK2;
IF(A1X<0 ,突破,DRAWNULL),COLORGREEN,LINETHICK2;
DRAWTEXT_FIX(1,0.00,0.00,0,' 作者:微信--阿鹏哥 QQ:421582688'),COLORRED;
STICKLINE(CROSS(A1X,0),C,O,2,0)COLORRED;
STICKLINE(CROSS(A1X,0),H,L,0,1)COLORRED;
STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN;
STICKLINE(CROSS(0,A1X),H,L,0,1)COLORGREEN;
STICKLINE(突破>0,O,C,2,0), COLORRED;
STICKLINE(突破>0,H,L,0,0), COLORRED;
STICKLINE(A1X<0,O,C,2,0), COLORGREEN;
STICKLINE(A1X<0,H,L,0,0), COLORGREEN;
STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN;
STICKLINE(CROSS(0,A1X),H,L,0,1)COLORGREEN;
STICKLINE(CROSS(A1X,0),C,O,2,0)COLORYELLOW;
STICKLINE(CROSS(A1X,0),H,L,0,1)COLORYELLOW;
STICKLINE(A1X>=0,多方,突破,0,-1)COLORRED;
STICKLINE(A1X<0,空方,突破,0,-1)COLORGREEN;
平衡:IF(CURRBARSCOUNT<=NH,DD+KJ/2,DRAWNULL),COLOR0055FF;
压力:IF(CURRBARSCOUNT<=NH,GD-KJ*0.191,DRAWNULL),COLOR00FF00;
支撑:IF(CURRBARSCOUNT<=NH,DD+KJ*0.191,DRAWNULL),COLOR00FFFF;
顶点:IF(CURRBARSCOUNT<=NH/2, CONST(IF(ISLASTBAR=1,HHV(H, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORLIRED,POINTDOT,LINETHICK3;
低点:IF(CURRBARSCOUNT<=NH/2, CONST(IF(ISLASTBAR=1,LLV(L, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORMAGENTA,POINTDOT,LINETHICK3;
STICKLINE(CCI>=200 AND H>=顶点,O,C,2,0),COLORLIRED;
STICKLINE(CCI<=100 AND L<=低点,O,C,2,0),COLORMAGENTA;
阿鹏哥:=TOPRANGE(H);你真好:=LOWRANGE(L);
上内:=LLVBARS(H,阿鹏哥);上外:=LLVBARS(L,阿鹏哥);
下内:=HHVBARS(L,你真好);下外:=HHVBARS(H,你真好);
上力度:=HHV(L,上内+1)>LLV(H,上内+1);
下力度:=HHV(L,下内+1)>LLV(H,下内+1);
上包含:=COUNT(L>=REF(L,1),上外)>2 AND COUNT(H>=REF(H,1),上内)>2;
下包含:=COUNT(H<=REF(H,1),下外)>2 AND COUNT(L<=REF(L,1),下内)>2;
顶0:=阿鹏哥 AND 上力度 AND 上包含 AND 上外>3;
底0:=你真好 AND 下力度 AND 下包含 AND 下外>3;
顶分天数:=BARSLAST(顶0);
底分天数:=BARSLAST(底0);
含中间K线:=IF(顶分天数=0,底分天数,顶分天数)>=3;
顶:=顶0 AND 含中间K线 AND H=HHV(H,BARSLAST(底0));
底:=底0 AND 含中间K线 AND L=LLV(L,BARSLAST(顶0));
NOTEXT上笔划线:=DRAWLINE(底,L,顶,H,0);
NOTEXT下笔划线:=DRAWLINE(顶,H,底,L,0);
分界点:=NOTEXT上笔划线 AND NOTEXT下笔划线;
位置调整:=
IF(PERIOD=11,0.02,{年}
IF(PERIOD=10,0.02,{季}
IF(PERIOD=9,0.02, {多日}
IF(PERIOD=8,0.001,{多分钟}
IF(PERIOD=7,0.02, {月}
IF(PERIOD=6,0.01, {周}
IF(PERIOD=5,0.005, {日}
IF(PERIOD=4,0.002,{60F}
IF(PERIOD=3,0.001,{30F}
IF(PERIOD=2,0.001,{15F}
IF(PERIOD=1,0.0003,{5F}
IF(PERIOD=0,0.0002,{1F}0))))))))))));
DRAWNUMBER(分界点 AND 顶,H+H*位置调整,H),COLORCYAN;
DRAWNUMBER(分界点 AND 底,L,L),COLORLIMAGENTA;
HIGHN:=10;
LOWN:=10;
HIGHDISPLAY:=0;
LOWDISPLAY:=0;
ZGDISPLAY:=0;
MADISPLAY:=0;
AAP:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AAP,HIGHN+1);
CC2:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
DRAWICON(CC2,H*1.01,2);
AAAA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AAAA1,LOWN+1);
CC1P:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
DRAWICON(CC1P,L*0.99,1);
157311041.png
|