以下是变色均线主图源码
MA3:MA(CLOSE,3);
MA7:MA(CLOSE,7);
MA13:MA(CLOSE,13);
MA21:MA(CLOSE,21);
MA60:MA(CLOSE,60);
partline(MA3,MA3>=ref(MA3,1),rgb(255,0,0),MA3<ref(MA3,1),rgb(0,250,0)),linethick2;
partline(MA7,MA7>=ref(MA7,1),rgb(255,0,0),MA7<ref(MA7,1),rgb(0,250,0)),linethick1;
partline(MA13,MA13>=ref(MA13,1),rgb(255,0,0),MA13<ref(MA13,1),rgb(0,250,0)),linethick1;
partline(MA21,MA21>=ref(MA21,1),rgb(255,0,0),MA21<ref(MA21,1),rgb(0,250,0)),linethick1;
partline(MA60,MA60>=ref(MA60,1),rgb(255,0,0),MA60<ref(MA60,1),rgb(0,250,0)),linethick2;
{单阳不破}
阳涨幅:=4.6;
阳倍量:=1.88;
单阳:=C>O*(1+阳涨幅/100) AND VOL>REF(VOL,1)*阳倍量;
DRAWTEXT(单阳,L*0.98,’阳’),COLORyellow;
高不破价:=REF(C,BARSLAST(单阳));
中不破价:=REF((C+L)/2,BARSLAST(单阳));
低不破价:=REF(L,BARSLAST(单阳));
单阳不破:=BARSLAST(单阳)<11 AND (LLV(L,BARSLAST(单阳))>低不破价 OR LLV(L,BARSLAST(单阳))=低不破价);
STICKLINE(单阳不破,低不破价-低不破价*0.003,低不破价,11,0),COLORyellow;
DRAWTEXT(BARSLAST(单阳)=1 AND 单阳不破,低不破价*0.98,’1′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=2 AND 单阳不破,低不破价*0.98,’2′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=3 AND 单阳不破,低不破价*0.98,’3′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=4 AND 单阳不破,低不破价*0.98,’4′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=5 AND 单阳不破,低不破价*0.98,’5′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=6 AND 单阳不破,低不破价*0.98,’6′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=7 AND 单阳不破,低不破价*0.98,’7′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=8 AND 单阳不破,低不破价*0.98,’8′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=9 AND 单阳不破,低不破价*0.98,’9′),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=10 AND 单阳不破,低不破价*0.98,’10’),COLORGREEN;
{两天:=LLV(L,BARSLAST(单阳))>低不破价 OR LLV(L,BARSLAST(单阳))=低不破价;
一般:=LLV(L,BARSLAST(单阳)-2)>低不破价 OR LLV(L,BARSLAST(单阳)-2)=低不破价;
一般选股:STICKLINE(BARSLAST(单阳)<9 AND 两天 AND 一般,低不破价,低不破价,4,0),COLOR88FF00;
较强:=LLV(L,BARSLAST(单阳)-2)>中不破价 OR LLV(L,BARSLAST(单阳)-2)=中不破价;
较强选股:STICKLINE(BARSLAST(单阳)<9 AND 两天 AND 较强,中不破价,中不破价,4,0),COLOR0088FF;
最强:=LLV(L,BARSLAST(单阳)-3)>高不破价 OR LLV(L,BARSLAST(单阳)-2)=高不破价;
最强选股:STICKLINE(BARSLAST(单阳)<9 AND 两天 AND 最强,高不破价,高不破价,4,0),COLOR00FFFF;}
{向下跳空缺口}
I1:=0;
flag1:=0;
while I1<BARSLAST(DISPSTATUS=1)-BARSLAST(DISPSTATUS=2)
DO
IF REF(H,I1)<REF(L,I1+1) AND REF(L,I1+1)>HHV(H,I1+1)
THEN BEGIN FLAG1:=1;
S1:=I1;
I1:=BARSLAST(DISPSTATUS=1);
END
ELSE I1:=I1+1;
STICKLINE(FLAG1,REF(L,S1+1),HHV(H,S1+1),(s1+1)*20,0),Culorgreen,ALIGN1,LAYER7;
DRAWTEXT(flag1,REF(L,s1+1),NUMTOSTRN(ref(h,s1+1),2)+’-‘+NUMTOSTRN(hhV(h,S1+1),2)),ALIGN2,COLORWHITE;
{向上跳空缺口}
I:=0;
flag:=0;
while I<BARSLAST(DISPSTATUS=1)-BARSLAST(DISPSTATUS=2)
DO
IF REF(L,I)>REF(H,I+1) AND REF(H,I+1)<LLV(LOW,I+1)
THEN BEGIN FLAG:=1;
S:=I;
I:=BARSLAST(DISPSTATUS=1);
END
ELSE I:=I+1;
STICKLINE(FLAG,REF(h,S+1),LLV(LOW,S+1),20*(s+1),500),COLORblue,ALIGN1,LAYER7;
DRAWTEXT(FLAG,REF(H,s+1),NUMTOSTRN(ref(h,s+1),2)+’-‘+NUMTOSTRN(LLV(LOW,S+1),2)),ALIGN2,COLORWHITE;
涨停:=IF(REF(C,1)*1.1-C<0.01 ,1,0);
STICKLINE(涨停,OPEN,CLOSE,4,0),COLORRED;
STICKLINE(涨停,OPEN,CLOSE,3,0),COLORYELLOW;
STICKLINE(涨停,H,L,0,0),COLORYELLOW;
评论(0)