DIFF:EMA(C,12)-EMA(C,26);
DEA :EMA(DIFF,9),COLORYELLOW;
MACD:2*(DIFF-DEA);
PARTLINE(DIFF,DIFF>REF(DIFF,1)AND REF(DIFF,1)>0,RGB(255,0,0),DIFF<REF(DIFF,1),
RGB(0,255,0),DIFF>REF(DIFF,1)AND REF(DIFF,1)<0,RGB(255,0,255));
PARTLINE(DEA,DEA>REF(DEA,1),RGB(255,255,0),DEA<REF(DEA,1),RGB(0,255,255));
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,6,0 ),COLOR00AAFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,6.6,0 ),COLOR00BBFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,4.4,0 ),COLOR00CCFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,3.3,0 ),COLOR00DDFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2.2,0 ),COLOR00EEFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,1.1,0 ),COLOR00FFFF;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,6,0 ),COLOR0000AA;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,6.6 ,0 ),COLOR0011BB;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,4.4,0 ),COLOr0022CC;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,3.3 ,0 ),COLOR0033DD;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,2.2 ,0 ),COLOR0044EE;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,1.1 ,0 ),COLOR0055FF;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,6,0 ),COLORAA00BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,6.6 ,0 ),COLORBB11BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,4.4,0 ),COLORCC22BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,3.3,0 ),COLORDD33BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,2.2 ,0 ),COLOREE44BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,1.1 ,0 ),COLORFF55BB;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,6,0 ),COLORFF7700;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,6.6 ,0 ),COLORFF8811;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,4.4,0 ),COLORFFAA22;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,3.3 ,0 ),COLORFFBB33;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,2.2 ,0 ),COLORFFDD44;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,1.1 ,0 ),COLORFFFF55;
KD
input:n(9,1,100),M1(3,2,40),M2(3,2,40);
20,pointdot;
50,pointdot;
80,pointdot;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,M1,1);
D:SMA(K,M2,1);
PARTLINE(k,k>REF(k,1)AND REF(k,1)>0,RGB(255,0,0),k<REF(k,1),
RGB(0,255,0),k>REF(k,1)AND REF(k,1)<0,RGB(255,0,255));
PARTLINE(d,d>REF(d,1),RGB(255,255,0),d<REF(d,1),RGB(0,255,255)); |