指标编写问答7学习的宝藏
31.问:这样的选股公式如何编?
1.选择股价从10元跌到8元,要求选择出所有符合这种条件的股票.最好是数值可以变动.
2.选择股价从8元涨到10元的所有股票.也是要求数值可以变动.
答(青青子):
w:=barslast(cross(10,c));
c=8 and w>0;
w1:=barslast(cross(c,8));
c=10 and w1>0;
QUOTE:
32.问:
我想把两个指标编进一个里面;可总是有一个指标被压缩的很小;搜索了一下懒汉老师的贴子,可是 里面的讲解少了一些,再加上本人太笨,没能参悟;请老师们帮忙讲解一下:比如如何能“KD”指标与“MACD”指标做在一起,谢谢。
KD指标
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1);
D:SMA(K,3,1);
macd指标
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA: EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
答(dfc ):
{KDJ+MACD}
mm:=IF(CATEGORY=0,2,150);
DIFF1 := EMA(CLOSE,12) - EMA(CLOSE,26);
diff:DIFF1*mm,colorred;
DEA1:= EMA(DIFF1,9);
DEA:DEA1*mm,coloryellow;
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K1:=SMA(RSV,3,1);
k:k1-50,COLORff9933;
D1:=SMA(K1,3,1);
d:d1-50,ColorF0ECE7;
J:3*K1-2*D1-50,ColorE200E4;
MACD : 2*(DIFF-DEA), COLORSTICK;
QUOTE:
33.问:
5天均线刚上穿30天线和55天线时在图上标出信号,在飞狐怎样表达?
答(多多):
DRAWICON(cross(ma(c,5),ma(c,30) and cross(ma(c,5),,a(c,55) ,l*0.985,4);
QUOTE:
34.问:
M20:=MA(C,20);
M40:=MA(C,40);
M60:=MA(C,60);
与M20正向相交:=(M20>=M40 and M40<=M60orM20>=M60);
与M20正向相交0:=cross(与M20正向相交,0.5);
与M20相交后的天数:barslast(与M20正向相交0);
这个公式表述的不正确。请帮助修改。
我想表述的是:M20>=M40 and M40<=M60的天数;M20>=M60的天数;在一个公式里表达。
答(懒汉):
M20:=MA(C,20);
M40:=MA(C,40);
M60:=MA(C,60);
sum(m20>=m40 and m40<=m60,barslast(cross(m20,m40)));//M20>=M40 and M40<=M60的天数;
sum(m20>=m60,barslast(cross(m20,m60));//M20>=M60的天数;
QUOTE:
35.问:
请哪位老师将黄金令的选股条件加上.谢谢!
var11:=(2*c+o+h+l)/5;
var12:=vol;
m8:=sum(var11*var12,8)/sum(var12,8);
m13:=sum(var11*var12,13)/sum(var12,13);
m21:=sum(var11*var12,21)/sum(var12,21);
r1:=c;
r2:=llv(low,45);
r3:=hhv(high,45);
y1:=c;
y2:=llv(low,144);
y3:=hhv(high,144);
RSV1:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV1,3,1),linethick1,colorff00ff;
D:=SMA(K,3,1),linethick2,coloryellow;
RSVr:=((r1-r2)/(r3-r2))*100;
Kr:=SMA(RSVr,3,1),colorred;
Dr:=SMA(Kr,3,1),coloryellow;
RSVy:=((y1-y2)/(y3-y2))*100;
Ky:=SMA(RSVy,3,1),colorccee33;
Dy:=SMA(Ky,3,1),coloryellow;
X1:=m8;
X2:=m13;
X3:=m21;
XX:=C>X2 AND C>X2 ,;
LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(ABS(CLOSE-LC),8,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),21,1)/SMA(ABS(CLOSE-LC),21,1)*100,;
DIFF:= EMA(CLOSE,8) - EMA(CLOSE,21);
DEA:= EMA(DIFF,8);
MACD:= 2*(DIFF-DEA);
J13:=m8-m21,;
K13:=SMA(J13,3,1), ;
D13:=SMA(K13,3,1), ;
MACD13:=4*(k13-D13);
js:= MACD>0 AND K>D AND RSI1>50AND DR<60 AND dy<60 AND XX>0 and macd13>0 and
macd13>ref(macd13,1);
XG:= js>0 and cross(k,d) and cross(macd,0)and ma(v,5)>ma(v,40);
短:=d,color00FF00,LINETHICK1;
短1:=ref(d,1),colorred,LINETHICK1;
中:=dr,coloryellow,LINETHICK1;
中1:=ref(dr,1),colorf0f000;
长:=dy,colorFF00FF,LINETHICK1;
长1:=ref(dy,1),colorFF00FF,LINETHICK1;
aaa:=cross(d,ref(d,2))and 短1<50 and dr>ref(dr,1)and dy>ref(dy,1) and d<30 and dr<20
and dy <20 ;
黄金令:STICKLINE(aaa>0,0,50,6,0),coloryellow;
白银令:STICKLINE(xg>0,0,50,6,0),colorwhite;
短期主力:d,color00FF00,LINETHICK1;
中期主力:dr,color0099ff,LINETHICK1;
长期主力:dy,colorFF00FF,LINETHICK1;
90;10;
答(清风斜阳):
var11:=(2*c+o+h+l)/5;
var12:=vol;
m8:=sum(var11*var12,8)/sum(var12,8);
m13:=sum(var11*var12,13)/sum(var12,13);
m21:=sum(var11*var12,21)/sum(var12,21);
r1:=c;
r2:=llv(low,45);
r3:=hhv(high,45);
y1:=c;
y2:=llv(low,144);
y3:=hhv(high,144);
RSV1:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV1,3,1),linethick1,colorff00ff;
D:=SMA(K,3,1),linethick2,coloryellow;
RSVr:=((r1-r2)/(r3-r2))*100;
Kr:=SMA(RSVr,3,1),colorred;
Dr:=SMA(Kr,3,1),coloryellow;
RSVy:=((y1-y2)/(y3-y2))*100;
Ky:=SMA(RSVy,3,1),colorccee33;
Dy:=SMA(Ky,3,1),coloryellow;
X1:=m8;
X2:=m13;
X3:=m21;
XX:=C>X2 AND C>X2 ,;
LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(ABS(CLOSE-LC),8,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),21,1)/SMA(ABS(CLOSE-LC),21,1)*100,;
DIFF:= EMA(CLOSE,8) - EMA(CLOSE,21);
DEA:= EMA(DIFF,8);
MACD:= 2*(DIFF-DEA);
J13:=m8-m21,;
K13:=SMA(J13,3,1), ;
D13:=SMA(K13,3,1), ;
MACD13:=4*(k13-D13);
js:= MACD>0 AND K>D AND RSI1>50AND DR<60 AND dy<60 AND XX>0 and macd13>0 and
macd13>ref(macd13,1);
XG:= js>0 and cross(k,d) and cross(macd,0)and ma(v,5)>ma(v,40);
短:=d,color00FF00,LINETHICK1;
短1:=ref(d,1),colorred,LINETHICK1;
中:=dr,coloryellow,LINETHICK1;
中1:=ref(dr,1),colorf0f000;
长:=dy,colorFF00FF,LINETHICK1;
长1:=ref(dy,1),colorFF00FF,LINETHICK1;
aaa:=cross(d,ref(d,2))and 短1<50 and dr>ref(dr,1)and dy>ref(dy,1) and d<30 and dr<20
and dy <20 ;
黄金令:STICKLINE(aaa>0,0,50,16,1),coloryellow;
黄金令选股:aaa=1;VERTLINE(aaa),colorred;
白银令:STICKLINE(xg>0,0,50,16,1),colorwhite;
短期主力:d,color00FF00,LINETHICK1;
中期主力:dr,color0099ff,LINETHICK1;
长期主力:dy,colorFF00FF,LINETHICK1;
90;10;
谢谢楼主的分享!
谢谢楼主分享!
页:
[1]