- 金币:
-
- 奖励:
-
- 热心:
-
- 注册时间:
- 2011-3-4
|
|

楼主 |
发表于 2011-8-1 22:17
|
显示全部楼层
回复 #77 cristi1218 的帖子
Var1:=(H+L)/2;
上唇:REF(SMA(Var1,5,1),3),COLORGREEN;
牙齿:REF(SMA(Var1,8,1),5),COLORRED;
下颚:REF(SMA(Var1,13,1),8),COLORwhite;
这个可以用在飞狐和通达信,同花顺设置一下也可以用,网上应该也有的载。
上下分型比较复杂,我只有飞狐的。原版的带分形和变色k线。不过用处不是很大,还是三条均线来的简洁。下面这个是我根据分形叫朋友帮忙编写的支撑压力公式,略微改一下可以进行盘中选股,利用飞狐的实时功能可以找到刚刚突破压力线的股票。用于大级别往往可以找到牛股。
f_up:=0;
f_down:=0;
Hb2:=REF(HIGH,2); Lb2:=REF(LOW,2); //2天前最高最低价格,峰顶和峰谷
Hb1:=REF(HIGH,1); Lb1:=REF(LOW,1); //1天前最高最低价格
Hf1:=REFX(HIGH,1); Lf1:=REFX(LOW,1); //1天后最高最低价格
Hf2:=REFX(HIGH,2); Lf2:=REFX(LOW,2); //2天后最高最低价格
hf3:=REFX(HIGH,3); lf3:=REFX(LOW,3); //3天后
hf4:=REFX(HIGH,4); lf4:=REFX(LOW,4); //4天后
hf5:=REFX(HIGH,5); lf5:=REFX(LOW,5); //5天后
hf6:=refx(high,6); lf6:=refx(low,6); //6天后
H0:=HIGH; L0:=LOW; //今天
f_up:=IF( (H0>hb1 and H0>hb2 and h0>hf1 and h0>hf2 and datacount-barpos>=2) or (H0>Hb2 AND H0>Hb1 AND H0=Hf1 AND Hf1>Hf2 AND Hf1>Hf3 and datacount-barpos>=3 ) or (H0>Hb2 AND H0>Hb1 AND H0=Hf2 AND Hf2>Hf1 AND Hf2>Hf3 and datacount-barpos>=3) or ( H0>=HF1 and H0>hb1 and H0>hb2 and H0=hf2 and h0>hf3 and h0>hf4 and datacount-barpos>=4) or (H0> hb1 and h0>hb2 and h0>=hf1 and h0=hf2 and h0=hf3 and h0>hf4 and h0>hf5 and datacount-barpos>=5) or ( h0>hb1 and h0>hb2 and h0>=hf1 and h0=hf2 and h0>=hf3 and h0=hf4 and h0>hf5 and h0>hf6 and datacount-barpos>=6) ,H0,0);
DRAWICON(f_up,H0*1.01,4);
f_down:=IF( (L0<Lb1 and L0<lb2 and L0<lf1 and L0<lf2 and datacount-barpos>=2) or (Lb2>L0 AND Lb1>l0 AND L0=Lf1 AND Lf2>Lf1 AND Lf3>Lf1 and datacount-barpos>=3) or (Lb2>L0 AND Lb1>l0 AND L0=Lf2 AND Lf2<Lf1 AND Lf3>Lf2 and datacount-barpos>=3) or (Lb2>L0 AND Lb1>l0 AND L0=Lf2 AND Lf2<Lf1 AND Lf3>Lf2 and datacount-barpos>=3) or (lb2>L0 and lb1>L0 and L0<=lf1 and L0=lf2 and L0<lf3 and L0<lf4 and datacount-barpos>=4 ) or (lb2>L0 and lb1>L0 and L0<=lf1 and L0=lf2 and L0=lf3 and L0<lf4 and L0<lf5 and datacount-barpos>=5 ) or (lb2>L0 and lb1>L0 and L0<=lf1 and L0=lf2 and L0<=lf3 and L0=lf4 and L0<lf5 and L0<lf6 and datacount-barpos>=6) ,L0,0);
DRAWICON(f_down,L0*0.990,5);
updays:=BARSLAST(f_up>0);
up_high:=REF(HIGH,updays);
downdays:=BARSLAST(f_down>0);
down_low:=REF(LOW,downdays);
{找比最近上碎高}
for i=datacount downto datacount-150 do
if f_up>up_high[datacount] then
begin
tcha:=datacount-i;break;
end;
else
tcha:=0;
{找比最近下碎低}
for j=datacount downto datacount-150 do
if f_down[j]<down_low[datacount] and f_down[j]>0 then
begin
dcha:=datacount-j;break;
end;
else
dcha:=0;
tj1:=islastbar;{倒数第一个上碎}
tj2:=backset(tj1,updays+1);
tj3:=tj2>ref(tj2,1) ;
tj4:=islastbar;{倒数第二个上碎}
tj5:=backset(tj4 and tcha,tcha+1);
tj6:=tj5>ref(tj5,1) ;
tj7:=islastbar;{倒数第一个下碎}
tj8:=backset(tj7,downdays+1);
tj9:=tj8>ref(tj8,1);
tj10:=islastbar;{倒数第二个下碎}
tj11:=backset(tj10 and dcha,dcha+1);
tj12:=tj11>ref(tj11,1);
drawline(tj12,low,tj9,low,1),COLORwhite; //支撑线
drawline(tj6,high,tj3,high,1),COLORwhite; //压力线
chengli:=linevalue(tj12,low,tj9,low,0,0);
yali:=linevalue(tj6,high,tj3,high,0,0);
explainex(1,'压力',yali,2,1);
explainex(1,'撑力',chengli,2,1); |
-
查看全部评分
|
|