TAG:个股 指数

 网友求助:

首先感谢大庆老杨 老师的无私奉献,发出(看大做小)指标源码:

趋势强弱:MA(100*(C-LLV(C,34))/(HHV(H,34)-LLV(L,34)),5)-20,COLORSTICK;
个股趋势:3*SMA((C-LLV(L,34))/(HHV(H,34)-LLV(L,34))*100,20,1)-2*SMA(SMA((C-LLV(L,34))/(HHV(H,34)-LLV(L,34))*100,20,1),15,1);
大盘趋势:3*SMA((INDEXC-LLV(INDEXL,34))/(HHV(INDEXH,34)-LLV(INDEXL,34))*100,20,1)-2*SMA(SMA((INDEXC-LLV(INDEXL,34))/(HHV(INDEXH,34)-LLV(INDEXL,34))*100,20,1),15,1);
大盘危险:FILLRGN(大盘趋势>80,大盘趋势,80);
个股危险:FILLRGN(个股趋势>80,个股趋势,80);
持币:PARTLINE(个股趋势<ref(个股趋势,1),个股趋势),LINETHICK2,colorffff00;
持股:PARTLINE(个股趋势>ref(个股趋势,1)and 大盘趋势>ref(大盘趋势,1),个股趋势),LINETHICK2,colorred;
预警:STICKLINE(CROSS(大盘趋势,个股趋势)and 个股趋势<3 or LONGCROSS(个股趋势,0,3),0,20,6,0),COLORRED;
地板价:IF(COUNT(个股趋势<0,3)=3 AND 个股趋势>ref(个股趋势,1),10,0),COLORFF0000,LINETHICK2;

使用上述指标时,我发现中小板和创业板指数,INDEX都用了深证的指数,显示的并不是创业板和中小板的真实指数,以致指标信号不正确。
我查了些资料,发现上证,深证,中小板,创业板等指数,应该用下述的语句表达比较正确。

上盘:3*SMA(("1A0001$CLOSE"-LLV("1A0001$LOW",34))/(HHV("1A0001$HIGH",34)-LLV("1A0001$LOW",34))*100,20,1)-2*SMA(SMA(("1A0001$CLOSE"-LLV("1A0001$LOW",34))/(HHV("1A0001$HIGH",34)-LLV("1A0001$LOW",34))*100,20,1),15,1);
深盘:3*SMA(("399001$CLOSE"-LLV("399001$LOW",34))/(HHV("399001$HIGH",34)-LLV("399001$LOW",34))*100,20,1)-2*SMA(SMA(("399001$CLOSE"-LLV("399001$LOW",34))/(HHV("399001$HIGH",34)-LLV("399001$LOW",34))*100,20,1),15,1);
中盘:3*SMA(("399005$CLOSE"-LLV("399005$LOW",34))/(HHV("399005$HIGH",34)-LLV("399005$LOW",34))*100,20,1)-2*SMA(SMA(("399005$CLOSE"-LLV("399005$LOW",34))/(HHV("399005$HIGH",34)-LLV("399005$LOW",34))*100,20,1),15,1);
创盘:3*SMA(("399006$CLOSE"-LLV("399006$LOW",34))/(HHV("399006$HIGH",34)-LLV("399006$LOW",34))*100,20,1)-2*SMA(SMA(("399006$CLOSE"-LLV("399006$LOW",34))/(HHV("399006$HIGH",34)-LLV("399006$LOW",34))*100,20,1),15,1);

 

 

 

来源于大庆老杨老师(看大做小)个股对应指数问题

 

解答如下:

B:=IF(STKTYPE=1,INTPART(STRTONUM(STKLABEL)/1000),-1);
A1:=STKINDI('1A0001','KDJ.J(34,20,15)',0,-1);
A2:=STKINDI('399001','KDJ.J(34,20,15)',0,-1);
A3:=STKINDI('399005','KDJ.J(34,20,15)',0,-1);
A4:=STKINDI('399005','KDJ.J(34,20,15)',0,-1);
AA:=IF(B=300,A4,IF(B=2,A3,IF(B=0 OR B=1,A2,IF(B=600 OR B=601,A1,0))));
趋势强弱:MA(100*(C-LLV(C,34))/(HHV(H,34)-LLV(L,34)),5)-20,COLORSTICK;
个股趋势:3*SMA((C-LLV(L,34))/(HHV(H,34)-LLV(L,34))*100,20,1)-2*SMA(SMA((C-LLV(L,34))/(HHV(H,34)-LLV(L,34))*100,20,1),15,1);
大盘趋势:AA;
大盘危险:FILLRGN(大盘趋势>80,大盘趋势,80);
个股危险:FILLRGN(个股趋势>80,个股趋势,80);
持币:PARTLINE(个股趋势<ref(个股趋势,1),个股趋势),LINETHICK2,colorffff00;
持股:PARTLINE(个股趋势>ref(个股趋势,1)and 大盘趋势>ref(大盘趋势,1),个股趋势),LINETHICK2,colorred;
预警:STICKLINE(CROSS(大盘趋势,个股趋势)and 个股趋势<3 or LONGCROSS(个股趋势,0,3),0,20,6,0),COLORRED;
地板价:IF(COUNT(个股趋势<0,3)=3 AND 个股趋势>ref(个股趋势,1),10,0),COLORFF0000,LINETHICK2;