MACD与斐波那契周期(副图)
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
S1:=last(BARSLAST(CROSS(DEA,DIFF)) and DIFF<DEA);
S2:=last(BARSLAST(CROSS(DIFF,DEA)) and DIFF>DEA);
drawtext(S1=1,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=3,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=5,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=8,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=13,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=21,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=26,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=29,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=34,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=55,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S1=68,DIFF,STR(S1)),color0000ff,LINETHICK1,align1,valign0;
drawtext(S2=1,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=3,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=5,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=8,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=13,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=21,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=26,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=29,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=34,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=55,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;
drawtext(S2=68,DIFF *1.,STR(S2)),color00ff00,LINETHICK1,align1,valign2;