编写要求:
www.gszx.com.cn网解答:
网友求助:
求老师编写一个多空指标的选股公式!要求如下,前一天短期达到100,中期、中长期、长期都小于100,第二天短期保持100不变,中期、中长期、长期值都达到100(这个值可以调)选股,公式如下:
短期:100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5)),COLORWHITE;
中期:100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10)),COLORYELLOW;
中长期:100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20)),COLORMAGENTA;
长期:100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30)),COLORRED,LINETHICK2;
强市线:80,POINTDOT;
弱市线:20,POINTDOT;
分水岭:50,POINTDOT;
解答如下:
T1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5)),COLORWHITE;
T2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10)),COLORYELLOW;
T3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20)),COLORMAGENTA;
T4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30)),COLORRED,LINETHICK2;
J1:=REF(T1,1)=100 AND REF(T2,1)<100 AND REF(T3,1)<100 AND REF(T4,1)<100;
J2:=T1=100 AND T2=100 AND T3=100 AND T4=100;
XG:J1 AND J2;