请版主帮忙能不能改成通达信指标谢谢 吴迪选股公式原码
先建一个公式,选股公式引用用的!
YY0
yyo:INDEXO,colorred,linethick2;
yyh:INDEXH,coloryellow,linethick2;
yyl:INDEXL,colorblue,linethick2;
yyc:INDEXC,colorgreen,linethick2;
{!A地量}
b1:=ma(v,3);
b2:=v<ref(v,1)*0.5;
b3:=CAPITAL/v/100<0.25;
地量:count(v<b1*0.4,2)>=1 or b2 or b3;
{回档}
aa1:=(max(c,o)+h)/2;
aa2:=(min(c,o)+l)/2;
a2:=c>=ref(c,2)+(ref(c,1)-ref(c,2))/ref(c,2)/4;
a3:=ref(c,1)>ref(c,2)*1.03 or ref(c,1)>ref(c,3)*1.04 or
count(ref(c,1)>ref(c,2),3)=3;
a4:=(aa1-aa2)/ref(c,1)<0.04 and
(c-ref(c,1))/ref(c,1)<=0.75*(ref(c,1)-ref(c,2))/ref(c,2);
a5:=(aa1-aa2)/ref(c,1)<0.6*(ref(c,1)-ref(c,2))/ref(c,2);
a6:=(ref(h,1)-ref(c,1))<(ref(c,1)-ref(c,2))*1.5 and ref(c,1)>=ref(o,1);
回档:a2 and a3 and a4 and a5 and a6;
{回调整理}
{参数设置1:振幅:1-8,默认值3.}
{参数设置2:量比:1-5,默认值1.}
H1:=CLOSE > MA(CLOSE,5);
H2:=MA(CLOSE,10) > MA(CLOSE,5);
H3:=MA(CLOSE,10) > MA(CLOSE,30);
H4:=MA(CLOSE,30) > REF(MA(CLOSE,30),1);
H5:=MA(CLOSE,10) > REF(MA(CLOSE,10),1);
HP3R:=(HHV(HIGH,3)-LLV(LOW,3))/LLV(LOW,3) < 振幅/100;
HP4R:=(HHV(HIGH,4)-LLV(LOW,4))/LLV(LOW,4) < 振幅/100;
HP5R:=(HHV(HIGH,5)-LLV(LOW,5))/LLV(LOW,5) < 振幅/100;
HP6R:=(HHV(HIGH,6)-LLV(LOW,6))/LLV(LOW,6) < 振幅/100;
HP7R:=(HHV(HIGH,7)-LLV(LOW,7))/LLV(LOW,7) < 振幅/100;
HP8R:=(HHV(HIGH,8)-LLV(LOW,8))/LLV(LOW,8) < 振幅/100;
HP9R:=(HHV(HIGH,9)-LLV(LOW,9))/LLV(LOW,9) < 振幅/100;
HP10R:=(HHV(HIGH,10)-LLV(LOW,10))/LLV(LOW,10) < 振幅/100;
HP11R:=(HHV(HIGH,11)-LLV(LOW,11))/LLV(LOW,11) < 振幅/100;
HP12R:=(HHV(HIGH,12)-LLV(LOW,12))/LLV(LOW,12) < 振幅/100;
HP312:=HP3R OR HP4R OR HP5R OR HP6R OR HP7R OR HP8R OR HP9R OR HP10R OR HP11R OR HP12R;
V3R:=LLV(VOL,3) / HHV(VOL,20) < 量比/10;
V4R:=LLV(VOL,4) / HHV(VOL,20) < 量比/10;
V5R:=LLV(VOL,5) / HHV(VOL,20) < 量比/10;
V35R:=V3R OR V4R OR V5R;
回调: H1 AND H2 AND H3 AND H4 AND H5 AND HP312 AND V35R;
{短暂整理}
aa1:="EXPLORER.回档";
a1:=ref(aa1,1)=1;
a2:=(c-ref(c,1))/ref(c,1)<0.03 and (h-l)/ref(c,1)<0.06;
t1:=a1 and a2;
t2:=ref(t1,1)=1 and (c-ref(c,1))/ref(c,1)<0.03 and (h-l)/ref(c,1)<0.06 ;
t3:=SLOPE(ma(c,5),2)*100>3;
短暂整理: (t1 or t2) and t3 and c>ma(c,13);
{天量,N,26,5,300}
a1:=ma(c,250)<=ref(ma(c,250),1);
a2:=c<ma(c,250) and c>ma(c,250)*0.90;
a3:=ma(c,5)<ma(c,250) and ma(c,5)>ref(ma(c,5),1);
a4:=CAPITAL/v/100>0.03;
xx:= (HIGH+LOW+CLOSE)/3;
a5:=SUM(MAX(0,HIGH-REF(xx,1)),N)/SUM(MAX(0,REF(xx,1)-L),N)*100>175;
tj1:=a1 and a2 and a3 and a4 and a5;
b1:=v>ma(v,5)*3.33 and v>ref(v,1)*2.5;
b2:=v>ma(v,5)*2.5 and ma(v,5)>ma(v,10) and ma(v,10)>ma(v,30);
tj2:=b1 or b2 or v>ref(ma(v,3),1)*4 or 100*v/CAPITAL>10;
tj3:=tj2 and ma(c,5)>ref(ma(c,5),1) and 100*v/CAPITAL>1;
天量:tj1 or tj3;
{横盘30分,N,30,1,240,10,1,240}(这个公式分析周期是1分钟)
a1:=(hhv(h,n)-llv(l,n))/ma(c,n)<p/1000;
a2:=BARSSINCE(c);
a3:=(hhv(h,a2)-llv(l,a2))/"yyo.yyo#day"<0.04;
a4:=if(a2>n and a2>3,n,a2);
a5:=1.5*abs((hhv(INDEXh,a4)-llv(INDEXl,a4))/"yyo.yyo#day")>
abs((hhv(h,a4)-llv(l,a4))/"yyo.yyo#day");
a6:=COUNT(v>1,a4)>a4/5;
a7:=("yyo.yyo#day"-llv(l,a4))/"yyo.yyo#day"<
("yyo.yyo#day"-llv(INDEXl,a4))/"yyo.yyo#day";
a8:=v>ref(hhv(v,a2),1) and c>ref("yyo.yyh#day",1);
aa1:=ref(a1,1) and a3 and a5 and a6;
aa:= aa1;
b1:=COUNT(v>1,a4)<3;
b2:=(hhv(h,a2)-llv(l,a2))/"yyo.yyh#day"<0.002;
bb:=b1 and b2;
强于大盘:=C/REF(C,1)>INDEXC/REF(INDEXC,1);
横盘30分:强于大盘 and (aa or bb) and dynainfo(7)>=dynainfo(11);
公式使用说明:
1. .每天收盘后分别用“回挡”、“短暂”、“稍长”、“平台”、“五日弯至十日均线”、回调”(可根据当时大盘同态势择要),“六形态综合选股”、 “地量”等把第二天需要要重点关注的股票选出来放入相应板块或自选股。
2. 大盘在上升趋势中应重点关注和大盘相同态势的个股,如大盘短暂整理,就重点关注短暂整理个股。大盘横盘态势则重点关注综合选股,大盘正处于下跌态势则重点关注抗跌个股。也可以每天都用综合选股,把所有符合经典形态的都选出来,这样范围较大.
3. 由于两市1,000多只股票,各自都有其不同的运行轨迹,用一种形态选股难免遗漏,按“视焦目标化”的要求,在每天收市后(或午后2:30时开始),搜览沪深两市全部股票,要先看地量,因此每天用"地量"选股,将其中形态较好的个股也放入自选股中;
4. 第二天,用"分时横盘"启动预警,预警的范围就设定为这些需要重点关注的股票。
5. 我们的目标是不让一匹黑马从我们的视野中溜走,因此第二天我们可以不断地根据大盘情况用“20分钟横盘”、“40分钟横盘”“60分种横盘”(参数可根据大盘时况自行调整)选股,发现好的横盘走势,回头来看k线,符合“契合买点3+1”即可放心买入。
6.“天量”不是一个买入选股条件,而是一个警示条件,天量天价,出现天量切不可追涨,至少短期内另有低点可寻,大牛市中的疯狂行情除外。
7. “双底”是长线投资趋势成立的买点,也是其它经典形态选股成立的背景条件。不能在一个下降趋势中用经典形态来选股,因为很可能变盘向下,只是下跌当中短暂的反弹而已。
8. 在一个上升趋势中会有多个经典形态的买点出现,我们主张买在第一、第二买点,以后的买点尽量不 |