通达信改编猎豹火车轨自用主图公式
补上这个 看能行不 我测试没问题
抱歉 另加一主图公式 {引用MA}
第一步,{引用MA}主图公式
{n 2 999 30}
MA_H:MA(HIGH,N);
MA_L:MA(LOW,N);
MA_C:MA(CLOSE,N);
第二步,火车轨主图公式
按步骤写才能通过
上轨:MA(HIGH,30);
下轨:MA(LOW,30);
日上轨:"引用MA.MA_H#DAY"(30);
日下轨:"引用MA.MA_L#DAY"(30);
S:=CROSS(CLOSE,日上轨);
X:=CROSS(日下轨,CLOSE);
WS:=BARSLAST(S)+1;
WX:=BARSLAST(X)+1;
SS:=CROSS(SUM(S,WX),0.5);
XX:=CROSS(SUM(X,WS),0.5);
DRAWICON(SS,LOW-0.1,1);
DRAWTEXT(SS,LOW-0.2,'买入'),COLORRED;
DRAWICON(XX,HIGH+0.1,2);
DRAWTEXT(XX,HIGH+0.2,'卖出'),COLORGREEN;
周上轨:"引用MA.MA_H#WEEK"(30);
周下轨:"引用MA.MA_L#WEEK"(30);
STICKLINE(CLOSE>日上轨,日上轨,日下轨,2,1),COLORGRAY;
STICKLINE(CLOSE<日下轨,日下轨,日上轨,2,1),COLORFF0000;
STICKLINE(CLOSE>周上轨,周上轨,周下轨,2,1),COLORGRAY;
STICKLINE(CLOSE<周下轨,周下轨,周上轨,2,1),COLORFF0000;
IF(CLOSE>上轨,上轨,DRAWNULL),COLORRED;
IF(CLOSE<上轨,上轨,DRAWNULL),COLORGREEN;
IF(CLOSE<下轨,下轨,DRAWNULL),COLORGREEN;
IF(CLOSE>日上轨,日上轨,DRAWNULL),COLORRED;
IF(CLOSE<日上轨,日上轨,DRAWNULL),COLORGREEN;
IF(CLOSE>日下轨,日下轨,DRAWNULL),COLORRED;
IF(CLOSE<日下轨,日下轨,DRAWNULL),COLORGREEN;
IF(CLOSE>周上轨,周上轨,DRAWNULL),COLORRED;
IF(CLOSE<周上轨,周上轨,DRAWNULL),COLORGREEN;
IF(CLOSE>周下轨,周下轨,DRAWNULL),COLORRED;
IF(CLOSE<周下轨,周下轨,DRAWNULL),COLORGREEN;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,3,0),COLORFF5B00;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2.8,0),COLORFF6C00;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2.5,0),COLORFF7B00;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2.2,0),COLORFF9C00;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2,0),COLORFFBE00;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,1.5,0),COLORFFCC00;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,1,0),COLORFFFF00;
STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,3,0),COLORRED;
STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,2.5,0),COLORRED;
STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,2.2,0),COLORRED;
STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,1.8,0),COLORRED;
STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,1.5,0),COLORRED;
STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,1,0),COLORRED;
MA20:=MA(C,20),COLORWHITE,LINETHICK2;
MA120:=MA(C,120),COLORFFCCCC,LINETHICK2;
MA250:=MA(C,250),COLORFFCC66,LINETHICK2;
乖离线:=((C-REF(MA20,1))/20+MA20)*1.20;
TT1:=CROSS(MA20,MA120) AND CROSS(MA20,MA250) AND V>REF(V,1);
TT2:=MA20>REF(MA20,2) AND V>REF(V,1) AND CROSS(C,MA20);
STICKLINE(TT1,L,L-0.09,4,0),COLORYELLOW;
DRAWTEXT(TT1,L-0.13,'金叉'),COLORYELLOW;
STICKLINE(CROSS(C,MA120) AND CROSS(C,MA250) AND CROSS(C,MA20),L,L-0.09,4,0),COLORYELLOW;
DRAWTEXT(CROSS(C,MA120) AND CROSS(C,MA250) AND CROSS(C,MA20),L-0.13,'并线开花'),COLORYELLOW;
STICKLINE(TT2,L,L-0.09,4,0),COLORYELLOW;
DRAWTEXT(TT2,L-0.13,'买点1'),COLORYELLOW;
STICKLINE(CROSS(C,乖离线),H,H+0.09,4,0),COLOR00FF00;
DRAWTEXT(CROSS(C,乖离线) ,H+0.13,'卖点'),COLOR00FF00;
STICKLINE(MA250>=REF(MA250,1) AND MA20>=REF(MA20,1) AND CROSS(C,MA250),L,L-0.09,4,0),COLORFFCC66;
DRAWTEXT(MA250>=REF(MA250,1) AND MA20>=REF(MA20,1) AND CROSS(C,MA250),L-0.13,'牛象'),COLORFFCC66;
STICKLINE(MA120>=REF(MA120,1) AND CROSS(C,MA20) AND CROSS(C,MA120) AND V>REF(V,1),L,L-0.09,4,0),COLORFF00FF;
DRAWTEXT(MA120>=REF(MA120,1) AND CROSS(C,MA20) AND CROSS(C,MA120) AND V>REF(V,1),L-0.13,'买点2'),COLORFF00FF;