软件名称:[B]小天KDJ主图优化[/B]
软件类型:国产软件
运行环境:Win9X/Win2000/WinXP/Win2003/
软件语言:简体中文
授权方式:解密版
软件大小:265 KB
官方主页:Home Page
更新时间:2009-09-21 15:59:40
软件简介:
小天KDJ主图优化(源码)
NN:=20;N:=2;
RSV:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
RSV12:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;
K12:=SMA(RSV12,3,1);
D12:=SMA(K12,3,1);
J12:=3*K12-2*D12;
RSV24:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;
K24:=SMA(RSV24,3,1);
D24:=SMA(K24,3,1);
J24:=3*K24-2*D24;
RSI1:=SMA(MAX(CLOSE-LOW,0),9,1)/SMA(ABS(CLOSE-LOW),9,1)*100;
上防线:IF(CROSS(J24,RSI1),H,REF(H,BARSLAST(CROSS(J24,RSI1)))),COLORBLUE;
支撑位:IF(CROSS(J,J24),L,REF(L,BARSLAST(CROSS(J,J24)))),COLORYELLOW;
压力位:IF(CROSS(J24,J),H,REF(H,BARSLAST(CROSS(J24,J)))),COLORRED;
U2L:=IF(C>=MA(C,NN),80,50);
L2L:=IF(C>=MA(C,NN),50,20);
RH1:=IF(J< U2L AND REF(J,1)>=U2L,HHV(REF(H,1),BARSLAST(J>=U2L AND REF(J,1)< U2L)-1),
REF(HHV(REF(H,1),BARSLAST(J>=U2L AND REF(J,1)< U2L)-1),BARSLAST(J< U2L AND REF(J,1))));
RH4:=IF(H>RH1,L,REF(L,BARSLAST(H>RH1)));
RH42:=IF(H>RH1,J,REF(J,BARSLAST(H>RH1)));
拦截:IF(H>RH4 AND J< RH42 AND J< J24,H,REF(H,BARSLAST(H>RH4 AND J< RH42 AND J< J24))),COLORGREEN;
RL1:=IF(J>L2L AND REF(J,1)<=L2L,LLV(REF(L,1),BARSLAST(J<=L2L AND REF(J,1)>L2L)-1),
REF(LLV(REF(L,1),BARSLAST(J<=L2L AND REF(J,1)>L2L)-1),BARSLAST(J>L2L AND REF(J,1))));
RL4:=IF(L< RL1,H,REF(H,BARSLAST(L< RL1)));
RL42:=IF(L< RL1,J,REF(J,BARSLAST(L< RL1)));
寻底:IF(L< RL4 AND J>RL42 AND J>J24,L,REF(L,BARSLAST(L< RL4 AND J>RL42 AND J>J24))),COLORWHITE;
TYX3:=MA(REF(HHV((C+L+O+H)/4,30),1),3);
TYX4:=MA((C+L+O+H)/4,13);
TYX5:=EMA((C+L+O+H)/4,21);
{空心红}
STICKLINE(C<TYX5 AND C>O,H,L,0,0),COLORRED;
STICKLINE(C<TYX5 AND C>O,C,O,3,1),COLORRED;
{深绿}
STICKLINE(C<TYX5 AND C<O,H,L,0,0),COLOR007700;
STICKLINE(C<TYX5 AND C<O,C,O,3,0),COLOR005500;
STICKLINE(C<TYX5 AND C<O,C,O,2,0),COLOR006600;
STICKLINE(C<TYX5 AND C<O,C,O,1,0),COLOR007700;
{蓝}
STICKLINE(C>TYX5 AND C<O,H,L,0,0),COLORFFDD44;
STICKLINE(C>TYX5 AND C<O,C,O,3,0 ),COLORFF7700;
STICKLINE(C>TYX5 AND C<O,C,O,2,0 ),COLORFFAA22;
STICKLINE(C>TYX5 AND C<O,C,O,1 ,0 ),COLORFFDD44;
{黄}
STICKLINE(C>TYX5 AND C>O,H,L,0,0 ),COLOR00EEFF;
STICKLINE(C>TYX5 AND C>O,C,O,3,0 ),COLOR00AAFF;
STICKLINE(C>TYX5 AND C>O,C,O,2,0 ),COLOR00CCFF;
STICKLINE(C>TYX5 AND C>O,C,O,1,0 ),COLOR00EEFF;
{粉红}
STICKLINE(C>TYX4 AND C>O,H,L,0,0),COLORFF66AA;
STICKLINE(C>TYX4 AND C>O,C,O,3,0 ),COLORFF11FF;
STICKLINE(C>TYX4 AND C>O,C,O,2,0 ),COLORFF44FF;
STICKLINE(C>TYX4 AND C>O,C,O,1,0 ),COLORFF66FF;
{亮灰}
STICKLINE(C>TYX4 AND C<O,H,L,0,0),COLOR999999;
STICKLINE(C>TYX4 AND C<O,C,O,3,0),COLOR555555;
STICKLINE(C>TYX4 AND C<O,C,O,2,0),COLOR777777;
STICKLINE(C>TYX4 AND C<O,C,O,1,0),COLOR999999;
{深红}
STICKLINE(C>TYX3 AND C>O,H,L,0,0),COLOR0000DD;
STICKLINE(C>TYX3 AND C>O,C,O,3,0),COLOR000099;
STICKLINE(C>TYX3 AND C>O,C,O,2,0),COLOR0000BB;
STICKLINE(C>TYX3 AND C>O,C,O,1,0),COLOR0000DD;
{涨跌停K线}
STICKLINE(HIGH=LOW AND CLOSE=OPEN AND (CLOSE/REF(CLOSE,1))>1.048,HIGH,LOW,3,0) ,COLORRED;
STICKLINE(HIGH=LOW AND CLOSE=OPEN AND (REF(CLOSE,1)/CLOSE)>1.048,HIGH,LOW,3,0) ,COLOR00FF00;
{突破}
STICKLINE(REF(COUNT(C<TYX3,5)=5,1) AND C>TYX3 AND C>O,C,O,1,0),COLOR00CCFF;
AA:=COUNT(CROSS(EMA(C,21),MA(C,8)),30)=1;
BB:=COUNT(CROSS(EMA(C,21),MA(C,60)),30)=1;
CC:=REF(BARSLAST(AA AND BB),1);
DD:=CC AND CROSS(MA(C,8),EMA(C,21));
DRAWTEXT(DD,(LOW * 0.99),'←乘风'),COLOR80FFFF;
VARZ1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
VARZ2:=REF(VARZ1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ3:=REF(VARZ2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZ4:=REF(VARZ3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ5:=REF(VARZ4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZ6:=REF(VARZ5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ7:=REF(VARZ6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZ8:=REF(VARZ7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ9:=REF(VARZ8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZA:=REF(VARZ9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZB:=REF(VARZA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZC:=REF(VARZB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VARZE:=REF(VARZD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZF:=REF(VARZE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ10:=REF(VARZF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZ11:=REF(VARZ10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ12:=REF(VARZ11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZ13:=REF(VARZ12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ14:=REF(VARZ13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZ15:=REF(VARZ14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ16:=REF(VARZ15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZ17:=REF(VARZ16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARZ18:=REF(VARZ17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARZ19:=REF(VARZD OR VARZE OR VARZF OR VARZ10 OR VARZ11 OR VARZ12 OR VARZ13 OR
VARZ14 OR VARZ15 OR VARZ16 OR VARZ17 OR VARZ18,1) AND VARZ1;
VARZ1A:=REF(VARZ1 OR VARZ2 OR VARZ3 OR VARZ4 OR VARZ5 OR VARZ6 OR VARZ7 OR
VARZ8 OR VARZ9 OR VARZA OR VARZB OR VARZC,1) AND VARZD;
DRAWTEXT(FILTER(VARZ19=1,5),LOW,' ★买进'),COLORFF00FF;
DRAWTEXT(FILTER(VARZ1A=1,5),HIGH+0.08,'◆卖出'),COLORYELLOW;
PPA2:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
PB1:=REF(C,PPA2+1)>C AND REF("MACD.DIF",PPA2+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");
DRAWTEXT(PB1>0,L-0.02,'★M'),COLOR00FFFF;{MACD底背离}
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
PB2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
DRAWTEXT(PB2,L-0.10,'◎K'),COLORFF00FF;{KDJ底背离}
PA3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
PB3:=REF(C,PA3+1)>C AND REF("RSI.RSI1",PA3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(PB3>0,L-0.18,'◆R'),COLOR0000FF;{RSI底背离}
PC1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
PD1:=REF(C,PC1+1)<C AND REF("MACD.DIF",PC1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");
DRAWTEXT(PD1>0,H+0.16,'★M'),COLOR00FF00;{MACD顶背离}
PC2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
PD2:=REF(C,PC2+1)<C AND REF("KDJ.K",PC2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");
DRAWTEXT(PD2>0,
[url=http://www.70822.com/soft/sort013/sort05/down-12831.html]小天KDJ主图优化[/url]