趋势风控

MA5:=MA(C,5);

MA10:=MA(C,10);

MA20:=MA(C,20);

MA30:=MA(C,30);

MA60:=MA(C,60);

MA120:=MA(C,120);

MA200:=MA(C,250);

角5:=CONST(ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416);

角10:=CONST(ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416);

角20:=CONST(ATAN((MA20/REF(MA20,1)-1)*100)*180/3.1416);

角30:=CONST(ATAN((MA30/REF(MA30,1)-1)*100)*180/3.1416);

角60:=CONST(ATAN((MA60/REF(MA60,1)-1)*100)*180/3.1416);

角120:=CONST(ATAN((MA120/REF(MA120,1)-1)*100)*180/3.1416);

角200:=CONST(ATAN((MA200/REF(MA200,1)-1)*100)*180/3.1416);

DRAWTEXT_FIX(角5>=0,0,0.18,0,STRCAT('角5:',CON2STR(角5,1))),COLORRED;

DRAWTEXT_FIX(角5<0,0,0.18,0,STRCAT('角5:',CON2STR(角5,1))),COLORGREEN;

DRAWTEXT_FIX(角10>=0,0,0.28,0,STRCAT('角10:',CON2STR(角10,1))),COLORRED;

DRAWTEXT_FIX(角10<0,0,0.28,0,STRCAT('角10:',CON2STR(角10,1))),COLORGREEN;

DRAWTEXT_FIX(角20>=0,0,0.38,0,STRCAT('角20:',CON2STR(角20,1))),COLORRED;

DRAWTEXT_FIX(角20<0,0,0.38,0,STRCAT('角20:',CON2STR(角20,1))),COLORGREEN;

DRAWTEXT_FIX(角30>=0,0,0.48,0,STRCAT('角30:',CON2STR(角30,1))),COLORRED;

DRAWTEXT_FIX(角30<0,0,0.48,0,STRCAT('角30:',CON2STR(角30,1))),COLORGREEN;

DRAWTEXT_FIX(角60>=0,0,0.58,0,STRCAT('角60:',CON2STR(角60,1))),COLORRED;

DRAWTEXT_FIX(角60<0,0,0.58,0,STRCAT('角60:',CON2STR(角60,1))),COLORGREEN;

DRAWTEXT_FIX(角120>=0,0,0.68,0,STRCAT('角120:',CON2STR(角120,1))),COLORRED;

DRAWTEXT_FIX(角120<0,0,0.68,0,STRCAT('角120:',CON2STR(角120,1))),COLORGREEN;

DRAWTEXT_FIX(角200>=0,0,0.75,0,STRCAT('角200:',CON2STR(角200,1))),COLORRED;

DRAWTEXT_FIX(角200<0,0,0.75,0,STRCAT('角200:',CON2STR(角200,1))),COLORGREEN;

DRAWTEXT_FIX(角5>=0,0.1,0.18,0,STRCAT('MA5:',CON2STR(MA5,1))),COLORRED;

DRAWTEXT_FIX(角5<0,0.1,0.18,0,STRCAT('MA5:',CON2STR(MA5,1))),COLORGREEN;

DRAWTEXT_FIX(角10>=0,0.1,0.28,0,STRCAT('MA10:',CON2STR(MA10,2))),COLORRED;

DRAWTEXT_FIX(角10<0,0.1,0.28,0,STRCAT('MA10:',CON2STR(MA10,2))),COLORGREEN;

DRAWTEXT_FIX(角20>=0,0.1,0.38,0,STRCAT('MA20:',CON2STR(MA20,2))),COLORRED;

DRAWTEXT_FIX(角20<0,0.1,0.38,0,STRCAT('MA20:',CON2STR(MA20,2))),COLORGREEN;

DRAWTEXT_FIX(角30>=0,0.1,0.48,0,STRCAT('MA30:',CON2STR(MA30,2))),COLORRED;

DRAWTEXT_FIX(角30<0,0.1,0.48,0,STRCAT('MA30:',CON2STR(MA30,2))),COLORGREEN;

DRAWTEXT_FIX(角60>=0,0.1,0.58,0,STRCAT('MA60:',CON2STR(MA60,2))),COLORRED;

DRAWTEXT_FIX(角60<0,0.1,0.58,0,STRCAT('MA60:',CON2STR(MA60,2))),COLORGREEN;

DRAWTEXT_FIX(角120>=0,0.1,0.68,0,STRCAT('MA120:',CON2STR(MA120,2))),COLORRED;

DRAWTEXT_FIX(角120<0,0.1,0.68,0,STRCAT('MA120:',CON2STR(MA120,2))),COLORGREEN;

DRAWTEXT_FIX(角200>=0,0.1,0.75,0,STRCAT('MA200:',CON2STR(MA200,2))),COLORRED;

DRAWTEXT_FIX(角200<0,0.1,0.75,0,STRCAT('MA200:',CON2STR(MA200,2))),COLORGREEN;

MAXMA:=MAX(MAX(MAX(MAX(MAX(MAX(MA5,MA10),MA20),MA30),MA60),MA120),MA200);

MINMA:=MIN(MIN(MIN(MIN(MIN(MIN(MA5,MA10),MA20),MA30),MA60),MA120),MA200);

均线粘合度:=100*ABS((MAXMA-MINMA)/C),NODRAW,COLORMAGENTA;

C3:=REF(C,1);

涨停:=(C/C3>=1.095 AND C=H) OR (NAMELIKE('ST') OR NAMELIKE('*') AND C/REF(C,1)>=1.0491 AND H=C);

跌停:=IF((C3-C)*100/C3>=(10-0.01*100/C3),1,0) OR IF(NAMELIKE('ST') OR NAMELIKE('*') AND REF(C,1)/C>=1.0491 AND L=C, 1,0);

半年涨停板:=COUNT(涨停,180),NODRAW,COLORYELLOW;

一年涨停板:=COUNT(涨停,250),NODRAW,COLORLIRED;

DRAWTEXT_FIX(1,0.2,0.18,0,STRCAT('均线粘合度:',CON2STR(均线粘合度,1))),COLORMAGENTA;

DRAWTEXT_FIX(1,0.2,0.28,0,STRCAT('半年涨停板:',CON2STR(半年涨停板,1))),COLORRED;

DRAWTEXT_FIX(1,0.2,0.38,0,STRCAT('一年涨停板:',CON2STR(一年涨停板,1))),COLORRED;

DRAWTEXT_FIX(1,0.29,0.01,0,STRCAT(STKNAME,'仓位管理:0成仓')),COLORGREEN;

DRAWTEXT_FIX(1,0.29,0.1,0,STRCAT(STKNAME,'长周期:')),COLORGREEN;

CD:=MA60>MA120 AND MA120>MA250;

CK:=MA60<MA120 AND MA120<MA250;

DRAWTEXT_FIX(ISLASTBAR AND CD=1,0.29,0.2,0,STRCAT('长期多头:','MA60>MA120>MA250')),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CK=1,0.29,0.3,0,STRCAT('长期空头:','MA60<MA120<MA250')),COLORGREEN;

DRAWTEXT_FIX(1,0.39,0.1,0,STRCAT(STKNAME,'中周期:')),COLORGREEN;

ZD:=MA20>MA30 AND MA30>MA60;

ZK:=MA20<MA30 AND MA30<MA60;

DRAWTEXT_FIX(ISLASTBAR AND ZD=1,0.39,0.2,0,STRCAT('中期多头:','MA20>MA30>MA60')),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND ZK=1,0.39,0.3,0,STRCAT('中期空头:','MA20<MA30<MA60')),COLORGREEN;

DRAWTEXT_FIX(1,0.49,0.1,0,STRCAT(STKNAME,'短周期:')),COLORGREEN;

DD:=MA5>MA10 AND MA10>MA20;

DK:=MA5<MA10 AND MA10<MA20;

DRAWTEXT_FIX(ISLASTBAR AND DD=1,0.49,0.2,0,STRCAT('短期多头:','MA5>MA10>MA20')),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND DK=1,0.49,0.3,0,STRCAT('短期空头:','MA5<MA10<MA20')),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CK=1 AND ZK=1 AND DK=1,0.69,0.01,0,'空仓'),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CK=1 AND ZK=1 AND DD=1,0.59,0.02,0,'1仓'),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CK=1 AND ZD=1 AND DK=1,0.59,0.03,0,'2仓'),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CK=1 AND ZD=1 AND DD=1,0.59,0.04,0,'3仓'),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CD=1 AND ZK=1 AND DK=1,0.59,0.05,0,'4仓'),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CD=1 AND ZK=1 AND DD=1,0.59,0.06,0,'5仓'),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CD=1 AND ZD=1 AND DK=1,0.59,0.07,0,'6仓'),COLORGREEN;

DRAWTEXT_FIX(ISLASTBAR AND CD=1 AND ZD=1 AND DD=1,0.59,0.08,0,'7仓'),COLORGREEN;

(0)

相关推荐