通达信山谷策略指标公式源码
X_1:=CLOSE/REF(CLOSE,1)>1.093 AND CLOSE=HIGH OR (CLOSE/OPEN>=1.093 AND CLOSE=HIGH);
X_2:=CLOSE/REF(CLOSE,1)>=1.035 AND CLOSE=HIGH OR (CLOSE/OPEN>=1.035 AND CLOSE=HIGH);
X_3:=IF(NAMELIKE(1),1,0);
X_4:=IF(NAMELIKE(2),1,0);
X_5:=X_3 OR X_4;
X_6:=IF(X_5,X_2,IF(X_5=0,X_1,DRAWNULL));
X_7:=NEWSAR(1,100);
X_8:=X_7<REF(X_7,1) AND REF(X_7,1)<REF(X_7,2) AND REF(X_7,2)<REF(X_7,3) AND CLOSE>X_7;
X_9:=Ema(CLOSE,5);
X_10:=EMA(CLOSE,10);
X_11:=EMA(CLOSE,20);
X_12:=ATAN((X_9/REF(X_9,5)-1)*100)*180/3.1416;
X_13:=ATAN((X_10/REF(X_10,5)-1)*100)*180/3.1416;
X_14:=ATAN((X_11/REF(X_11,5)-1)*100)*180/3.1416;
X_15:=X_12<=(-80) AND X_13<=(-75) AND X_14<=(-70);
X_16:=CLOSE/REF(CLOSE,1)>1.045 AND CLOSE=HIGH OR (CLOSE/OPEN>=1.045 AND CLOSE=HIGH);
X_17:=CLOSE/REF(CLOSE,1)>=1.035 AND CLOSE=HIGH OR (CLOSE/OPEN>=1.035 AND CLOSE=HIGH);
X_18:=IF(NAMELIKE(1),1,0);
X_19:=IF(NAMELIKE(2),1,0);
X_20:=X_18 OR X_19;
X_21:=IF(X_20,X_17,IF(X_20=0,X_16,DRAWNULL));
X_22:=BArslAst(NOT(IF(CLOSE>HHV(REF(HIGH,1),2),1,IF(CLOSE<LLV(REF(LOW,1),2),(-1),0))=0));
X_23:=IF(IF(CLOSE>HHV(REF(HIGH,1),2),1,IF(CLOSE<LLV(REF(LOW,1),2),(-1),0))=0,REF(IF(CLOSE>HHV(REF(HIGH,1),2),1,IF(CLOSE<LLV(REF(LOW,1),2),(-1),0)),X_22),IF(CLOSE>HHV(REF(HIGH,1),2),1,IF(CLOSE<LLV(REF(LOW,1),2),(-1),0)));
红进:X_21 AND X_15 AND X_8,NODRAW,COLORRED;
绿出:crOSS(0,X_23) AND COUNT(CROSS(0,X_23),BARSLAST(红进))=1,NODRAW,COLORGREEN;
X_24:=COUNT(绿出,BARSLAST(红进))=0;
收益点:IF(COUNT(绿出,BARSLAST(红进))=0>0,CLOSE/REF(CLOSE,BARSLAST(红进))*100-100,DRAWNULL),NODRAW,COLORWHITE;
STICKLINE(X_24 AND X_6,0,2,3,0),COLORFF0099;
STICKLINE(X_24 AND X_6,0,2,2.5,0),COLORFF00AA;
STICKLINE(X_24 AND X_6,0,2,2,0),COLORFF00BB;
STICKLINE(X_24 AND X_6,0,2,1.5,0),COLORFF00CC;
STICKLINE(X_24 AND X_6,0,2,1,0),COLORFF00DD;
STICKLINE(X_24 AND X_6,0,2,0.5,0),COLORFF00EE;
STICKLINE(X_24 AND X_6,0,2,0.25,0),COLORMAGENTA;
STICKLINE(红进>0,0,0.5,2,0),COLORYELLOW;
DRAWICON(红进,3,1);
STICKLINE(绿出>0,0,REF(收益点,1),2,0),COLORGREEN;
DRAWICON(绿出,REF(收益点,1)+1.5,2);
STICKLINE(X_24>0,0,收益点,2,0),COLOR000055;
STICKLINE(X_24>0,0,收益点,1.5,0),COLOR000077;
STICKLINE(X_24>0,0,收益点,1,0),COLOR000099;
STICKLINE(X_24>0,0,收益点,0.7,0),COLOR0000BB;
STICKLINE(X_24>0,0,收益点,0.4,0),COLOR0000DD;
STICKLINE(X_24>0,0,收益点,0.2,0),COLORRED;
STICKLINE(X_24>0,0,收益点,0.05,0),COLORWHITE;