{公式名称: 顺势为赢}
K:=1;
DRAWGBK(OPEN>0,RGB(10,10,10),RGB(0,0,0),0,1,0);
XA_1:=MA(CLOSE,13);
XA_2:=REF(XA_1,13/2+1);
XA_3:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
XA_4:=BARSLAST(XA_3>3);
XA_5:=IF(XA_4>0,1,0);
STICKLINE(CLOSE>=XA_2 AND XA_5=0,HIGH,LOW,0,1),COLOR2CB3E3;
STICKLINE(CLOSE>=XA_2 AND XA_5=0,OPEN,CLOSE,8,1),COLOR2CB3E3;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
XA_6:=HHV(CLOSE,2);
XA_7:=LLV(CLOSE,2);
XA_8:=REF(CLOSE,1);
XA_9:=SMA(MAX(CLOSE-XA_8,0),6,1)/SMA(ABS(CLOSE-XA_8),6,1)*100;
XA_10:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
XA_11:=REF(XA_10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_12:=REF(XA_11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_13:=REF(XA_12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_14:=REF(XA_13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_15:=REF(XA_14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_16:=REF(XA_15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_17:=REF(XA_16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_18:=REF(XA_17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_19:=REF(XA_18,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_20:=REF(XA_19,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_21:=REF(XA_20,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_22:=HHV(FORCAST(XA_9,7),14);
XA_23:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
XA_24:=REF(XA_23,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_25:=REF(XA_24,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_26:=REF(XA_25,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_27:=REF(XA_26,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_28:=REF(XA_27,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_29:=REF(XA_28,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_30:=REF(XA_29,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_31:=REF(XA_30,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_32:=REF(XA_31,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_33:=REF(XA_32,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
XA_34:=REF(XA_33,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XA_35:=SMA(XA_22,3,1);
XA_36:=SMA(XA_35,3,1);
XA_37:=3*XA_35-2*XA_36;
XA_38:=REF(XA_23 OR XA_24 OR XA_25 OR XA_26 OR XA_27 OR XA_28 OR XA_29 OR XA_30 OR XA_31 OR XA_32 OR XA_33 OR XA_34,1) AND XA_10;
XA_39:=REF(XA_10 OR XA_11 OR XA_12 OR XA_13 OR XA_14 OR XA_15 OR XA_16 OR XA_17 OR XA_18 OR XA_19 OR XA_20 OR XA_21,1) AND XA_23;
红色持股:XA_10 OR XA_11 OR XA_12 OR XA_13 OR XA_14 OR XA_15 OR XA_16 OR XA_17 OR XA_18 OR XA_19 OR XA_20 OR XA_21,NODRAW,COLORRED;
XA_40:=IF(红色持股,XA_7,DRAWNULL);
XA_41:=XA_40;
XA_42:=REF(XA_40,1);
XA_43:=XA_23 OR XA_24 OR XA_25 OR XA_26 OR XA_27 OR XA_28 OR XA_29 OR XA_30 OR XA_31 OR XA_32 OR XA_33 OR XA_34;
XA_44:=IF(XA_43,XA_6,DRAWNULL);
XA_45:=XA_44;
XA_46:=REF(XA_45,1);
XA_47:=XA_38;
XA_48:=XA_39;
XA_49:=SMA(XA_9,3,1);
XA_50:=SMA(XA_49,3,1);
XA_51:=3*XA_49-2*XA_50;
STICKLINE(ISLASTBAR AND (红色持股 OR REF(红色持股,1)=1),XA_42,XA_42,30,1),COLORRED;
STICKLINE(ISLASTBAR AND (XA_43 OR REF(XA_43,1)=1),XA_46,XA_46,30,1),COLORGREEN;
STICKLINE(CLOSE>=OPEN,LOW,HIGH,0,0),COLOR0000CC;
STICKLINE(CLOSE<OPEN,LOW,HIGH,0,0),COLOR999900;
STICKLINE(1,CLOSE,OPEN,3.5,0),COLOR858500;
STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,3.5,0),COLOR0000E5;
XA_52:=IF(CLOSE>=MA(CLOSE,20),80,50);
XA_53:=IF(CLOSE>=MA(CLOSE,20),50,20);
STICKLINE(红色持股,CLOSE,OPEN,2.8,0),COLOR000055;
STICKLINE(红色持股,CLOSE,OPEN,2,0),COLOR000088;
STICKLINE(红色持股,CLOSE,OPEN,1.5,0),COLOR0000AA;
STICKLINE(红色持股,CLOSE,OPEN,1,0),COLOR0000CC;
STICKLINE(红色持股,CLOSE,OPEN,0.5,0),COLOR0000EE;
STICKLINE(XA_43,CLOSE,OPEN,2.8,0),COLOR555500;
STICKLINE(XA_43,CLOSE,OPEN,2,0),COLOR888800;
STICKLINE(XA_43,CLOSE,OPEN,1.5,0),COLORAAAA00;
STICKLINE(XA_43,CLOSE,OPEN,1,0),COLORCCCC00;
STICKLINE(XA_43,CLOSE,OPEN,0.5,0),COLOREEEE00;
YL:IF(CROSS(XA_37,XA_51),HIGH,REF(HIGH,BARSLAST(CROSS(XA_37,XA_51)))),DOTLINE,COLORWHITE;
XA_54:=IF(XA_51<XA_52 AND REF(XA_51,1)>=XA_52,HHV(REF(HIGH,1),BARSLAST(XA_51>=XA_52 AND REF(XA_51,1)<XA_52)-1),REF(HHV(REF(HIGH,1),BARSLAST(XA_51>=XA_52 AND REF(XA_51,1)<XA_52)-1),BARSLAST(XA_51<XA_52 AND REF(XA_51,1))));
XA_55:=IF(HIGH>XA_54,LOW,REF(LOW,BARSLAST(HIGH>XA_54)));
XA_56:=BARSLAST(CLOSE>=XA_2 AND XA_5=0);
XA_57:=IF(HIGH>XA_54,XA_51,REF(XA_51,BARSLAST(HIGH>XA_54)));
DRAWICON(XA_9>XA_22,LOW*0.99,41);
LZ:IF(HIGH>XA_55 AND XA_51<XA_57 AND XA_51<XA_37,HIGH,REF(HIGH,BARSLAST(HIGH>XA_55 AND XA_51<XA_57 AND XA_51<XA_37))),DOTLINE,COLORGREEN;
XA_58:=IF(XA_51>XA_53 AND REF(XA_51,1)<=XA_53,LLV(REF(LOW,1),BARSLAST(XA_51<=XA_53 AND REF(XA_51,1)>XA_53)-1),REF(LLV(REF(LOW,1),BARSLAST(XA_51<=XA_53 AND REF(XA_51,1)>XA_53)-1),BARSLAST(XA_51>XA_53 AND REF(XA_51,1))));
XA_59:=IF(LOW<XA_58,HIGH,REF(HIGH,BARSLAST(LOW<XA_58)));
XA_60:=IF(LOW<XA_58,XA_51,REF(XA_51,BARSLAST(LOW<XA_58)));
XA_61:=REF(HIGH,XA_56);
ZC:IF(CROSS(XA_51,XA_37),LOW,REF(LOW,BARSLAST(CROSS(XA_51,XA_37)))),DOTLINE,COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.35,0.15,0,CODE),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.42,0.15,0,STKNAME),COLORRED;
DRAWTEXT_FIX(ISLASTBAR,0.53,0.15,0,HYBLOCK),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.62,0.15,0,DYBLOCK),COLORB4EEB4;
DRAWTEXT_FIX(ISLASTBAR,0.35,0.25,0,GNBLOCK),COLORWHITE;
DRAWTEXT_FIX(ISLASTBAR,0.56,0.25,0,FGBLOCK),COLORMAGENTA;
DRAWTEXT_FIX(ISLASTBAR,0.35,0.35,0,ZSBLOCK);
YJ:IF(LOW<XA_59 AND XA_51>XA_60 AND XA_51>XA_37,LOW,REF(LOW,BARSLAST(LOW<XA_59 AND XA_51>XA_60 AND XA_51>XA_37))),DOTLINE,COLORMAGENTA;
DRAWTEXT(FILTER(ABS(ZC-YL)>0.045 OR ABS(ZC-YL)=0 AND CLOSE>ZC AND CLOSE>OPEN AND (ABS(REF(ZC,2)-REF(ZC,2))>0.05 OR ABS(REF(ZC,1)-REF(ZC,1)=0)),30),LOW,2),COLORYELLOW;
DRAWTEXT(FILTER(ABS(YL-ZC)>0.045 OR ABS(YL-ZC)=0 AND CLOSE>YL AND CLOSE>OPEN AND (ABS(REF(YL,2)-REF(YL,2))>0.05 OR ABS(REF(YL,1)-REF(YL,1)=0)),30),LOW,3),COLORCYAN;
XA_62:=MA(CLOSE,10);
XA_63:=50*(CLOSE-XA_62)/STD(CLOSE,10);
XA_64:=MA(CLOSE,20);
XA_65:=50*(CLOSE-XA_64)/STD(CLOSE,20);
XA_66:=MA(CLOSE,60);
XA_67:=60*(CLOSE-XA_66)/STD(CLOSE,60);
XA_68:=MA(CLOSE,120);
XA_69:=50*(CLOSE-XA_68)/STD(CLOSE,120);
XA_70:=(XA_63+XA_65+XA_67+XA_69)/4;
XA_71:=EMA(XA_70,5);
IF(XA_71>REF(XA_71,1),YL,DRAWNULL),COLORRED;
IF(XA_71<REF(XA_71,1),YL,DRAWNULL),COLORBLUE;
IF(XA_71>REF(XA_71,1),ZC,DRAWNULL),COLORRED;
IF(XA_71<REF(XA_71,1),ZC,DRAWNULL),COLORBLUE;
IF(XA_71>REF(XA_71,1),LZ,DRAWNULL),COLORRED;
IF(XA_71<REF(XA_71,1),LZ,DRAWNULL),COLORBLUE;
IF(XA_71>REF(XA_71,1),YJ,DRAWNULL),COLORRED;
IF(XA_71<REF(XA_71,1),YJ,DRAWNULL),COLORBLUE;
XA_72:=KDJ.J;
XA_73:=BARSLAST(XA_72<REF(XA_72,1));
XA_74:=SUMBARS(XA_73=1,2);
XA_75:=SUMBARS(XA_73=1,3);
XA_76:=REF(XA_72,XA_73);
XA_77:=REF(XA_72,XA_74);
XA_78:=REF(XA_72,XA_75);
XA_79:=XA_76>XA_77 AND XA_77>XA_78 AND XA_72>REF(XA_72,1);
XA_80:=(CLOSE/OPEN-1)*100;
XA_81:=(CLOSE/REF(CLOSE,1)-1)*100;
XA_82:=XA_80>3 AND XA_80=HHV(XA_80,6);
XA_83:=XA_81>3 AND XA_81=HHV(XA_81,6);
XA_84:=XA_81>=9 AND CLOSE=HIGH;
XA_85:=XA_79;
XA_86:=BARSLAST(XA_85);
XA_87:=IF(XA_86<=13 AND COUNT(CLOSE>REF(LOW,XA_86),XA_86)>=XA_86-1,XA_86,0);
XA_88:=IF(XA_86>=4 AND COUNT(CLOSE>REF(CLOSE,XA_86),3)>=3,REF(CLOSE,XA_86),REF(LOW,XA_86));
XA_89:=LOW<XA_88*1.01 AND COUNT(LOW<XA_88*1.01,XA_87)=1;
XA_90:=LOW<XA_88 AND COUNT(LOW<XA_88,XA_87)=1;
XA_91:=IF(XA_89 OR XA_90,1,0);
DRAWICON(XA_85,LOW*0.97,23);
DRAWTEXT(XA_85,LOW*0.96,4),COLORYELLOW;
DRAWTEXT(XA_91,LOW*0.985,5),COLORGREEN;
XA_92:=LLV(LOW,4);
XA_93:=LLV(LOW,19);
XA_94:=HHV(HIGH,4);
XA_95:=HHV(HIGH,19);
DRAWTEXT(XA_92-XA_93>XA_95-XA_94 AND XA_49=1 AND BARSTATUS=2,XA_92,6),COLORMAGENTA;
DRAWTEXT(XA_92-XA_93<XA_95-XA_94 AND XA_49=1 AND BARSTATUS=2,XA_94,7),COLORCYAN;
XA_96:=8;
XA_97:=BARSLAST(VOL=HHV(VOL,20));
DRAWTEXT(XA_97,CLOSE,XA_96),COLORFCFCFC;
DRAWNUMBER(XA_56,XA_61,HIGH),COLORWHITE;
顺势为赢主图指标 通达信 手机版 源码
|