STICKLINE(1,H,L,6,0),COLORBLACK;
周期1:SUMBARS(VOL,CAPITAL/4),COLORWHITE,NODRAW;
周期2:SUMBARS(VOL,CAPITAL/2),COLORYELLOW,NODRAW;
周期3:SUMBARS(VOL,CAPITAL),COLORRED,NODRAW;
转向价咯幅度:HHV(ABS(C/REF(C,1)*100-100),(周期1+周期2+周期3)/3),COLORGREEN,NODRAW;
之转向线:=ZIG(3,转向价咯幅度);
上一次波峰值:=PEAK(3,转向价咯幅度,1);
上一次波谷值:=TROUGH(3,转向价咯幅度,1);
上一次波峰位置:=PEAKBARS(3,转向价咯幅度,1);
上一次波谷位置:=TROUGHBARS(3,转向价咯幅度,1);
BG:=CONST(上一次波谷位置);
BF:=CONST(上一次波峰位置);
目前所处趋势:=IF(上一次波谷位置<上一次波峰位置,1,0);
转向达成:=IF(目前所处趋势=1,上一次波谷值*(1+转向价咯幅度/100),上一次波峰值*(1-转向价咯幅度/100)),COLORRED,NODRAW;
向上达成:=CONST(EXIST(C>转向达成,BG));
向下达成:=CONST(EXIST(C<转向达成,BF));
预判价:IF(之转向线>REF(之转向线,1) AND CURRBARSCOUNT<=MIN(BF,BG) AND 向上达成<1,上一次波谷值*(1+转向价咯幅度*0.382/100),
IF(之转向线<REF(之转向线,1) AND CURRBARSCOUNT<=MIN(BF,BG) AND 向下达成<1,上一次波峰值*(1-转向价咯幅度*0.382/100),DRAWNULL)),COLORMAGENTA,DOTLINE;
纠错价:IF(之转向线>REF(之转向线,1) AND CURRBARSCOUNT<=MIN(BF,BG) AND 向上达成<1,上一次波谷值,
IF(之转向线<REF(之转向线,1) AND CURRBARSCOUNT<=MIN(BF,BG) AND 向下达成<1,上一次波峰值,DRAWNULL)),COLORLIBLUE,DOTLINE;
确认价:IF(之转向线>REF(之转向线,1) AND CURRBARSCOUNT<=MIN(BF,BG) AND 向上达成<1,转向达成,
IF(之转向线<REF(之转向线,1) AND CURRBARSCOUNT<=MIN(BF,BG) AND 向下达成<1,转向达成,DRAWNULL)),COLORRED,DOTLINE;
动态高点:IF(CURRBARSCOUNT<=MAX(BG,BF),REF(HHV(H,IF(周期1<2,2,周期1)),1),DRAWNULL),COLORBLUE,DOTLINE;
动态低点:IF(CURRBARSCOUNT<=MAX(BG,BF),REF(LLV(L,IF(周期1<2,2,周期1)),1),DRAWNULL),COLORBLUE,DOTLINE;
近期成本均线:=MA(C,周期1),COLORGREEN;
中期成本均线:=MA(C,周期2),COLORWHITE;
长期成本均线:=MA(C,周期3),COLORYELLOW;
ZQ1:=CONST(周期1);
ZQ2:=CONST(周期2);
ZQ3:=CONST(周期3);
STICKLINE(之转向线>REF(之转向线,1),H,L,0,1),COLORLIRED;
STICKLINE(之转向线>REF(之转向线,1),O,C,2,1),COLORLIRED;
STICKLINE(之转向线>REF(之转向线,1) AND C>O,O,C,2,0),COLORLIRED;
STICKLINE(之转向线<REF(之转向线,1),H,L,0,1),COLORCYAN;
STICKLINE(之转向线<REF(之转向线,1),O,C,2,1),COLORCYAN;
STICKLINE(之转向线<REF(之转向线,1) AND C<O,O,C,2,0),COLORCYAN;
STICKLINE(CURRBARSCOUNT<=BG AND 向上达成<1,H,L,0,0),COLORYELLOW;
STICKLINE(CURRBARSCOUNT<=BG AND 向上达成<1 AND C>O,O,C,2,0),COLORYELLOW;
STICKLINE(CURRBARSCOUNT<=BG AND 向上达成<1 AND C<O,O,C,2,1),COLORYELLOW;
STICKLINE(CURRBARSCOUNT<=BG AND 向上达成<1 AND C>预判价,H,L,0,0),COLORMAGENTA;
STICKLINE(CURRBARSCOUNT<=BG AND 向上达成<1 AND C>O AND C>预判价,O,C,2,0),COLORMAGENTA;
STICKLINE(CURRBARSCOUNT<=BG AND 向上达成<1 AND C<O AND C>预判价,O,C,2,1),COLORMAGENTA;
STICKLINE(CURRBARSCOUNT<=BF AND 向下达成<1,H,L,0,0),COLORGREEN;
STICKLINE(CURRBARSCOUNT<=BF AND 向下达成<1 AND C>O,O,C,2,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT<=BF AND 向下达成<1 AND C<O,O,C,2,0),COLORGREEN;
STICKLINE(C>近期成本均线 AND 近期成本均线>中期成本均线 AND 中期成本均线>长期成本均线,MAX(O,C),(O+C)/2,2.3,0),COLORRED;
STICKLINE(C<近期成本均线 AND 近期成本均线<中期成本均线 AND 中期成本均线<长期成本均线,MIN(O,C),(O+C)/2,2.3,0),COLORBLUE;
均线1:MA(C,ZQ1),COLORWHITE;
均线2:MA(C,ZQ2),COLORYELLOW;
均线3:MA(C,ZQ3),COLORRED,DOTLINE;
DRAWTEXT(ISLASTBAR AND 之转向线>REF(之转向线,1) AND 向上达成<1,转向达成,CON2STR(转向达成,2)),COLORRED;
DRAWTEXT(ISLASTBAR AND 之转向线<REF(之转向线,1) AND 向下达成<1,转向达成,CON2STR(转向达成,2)),COLORRED;
DRAWTEXT(ISLASTBAR AND 之转向线>REF(之转向线,1) AND 向上达成<1,预判价,CON2STR(预判价,2)),COLORWHITE;
DRAWTEXT(ISLASTBAR AND 之转向线<REF(之转向线,1) AND 向下达成<1,预判价,CON2STR(预判价,2)),COLORWHITE;
DRAWTEXT(ISLASTBAR AND 之转向线>REF(之转向线,1) AND 向上达成<1,纠错价,CON2STR(纠错价,2)),COLORLIBLUE;
DRAWTEXT(ISLASTBAR AND 之转向线<REF(之转向线,1) AND 向下达成<1,纠错价,CON2STR(纠错价,2)),COLORLIBLUE;
DRAWTEXT_FIX(1,0.3,0.5,0,'用到未来函数,信号会漂移,仅供学习交流,不作操作建议,底下有底,谨慎抄底!!!不读源码者禁用!!!!!!'),COLORMAGENTA;
DRAWICON(之转向线>REF(之转向线,1) AND CROSS(C,预判价),L*0.97,7);{不喜可删}
DRAWICON(之转向线<REF(之转向线,1) AND CROSS(预判价,C),H*1.02,8);{不喜可删}; |