缠论一买、三买选股公式(飞狐+悟多公式)
公式指标 2009-08-14 11:42:38 阅读5639 评论20 字号:大中小 订阅
一买的选股公式初步搞出来的,当然还不完善,不能算是一买的公式,充其量算选出即将盘整背驰的,不过两个中枢下的盘整背驰就是一买了,当然真正是否背驰还要靠人工来判断,它只能
初选,不过也省下很多事了,欢迎使用,多提意见。
begin
if DATAPERIOD=0 then minbi:=\base.var2#min1\ if DATAPERIOD=1 then minbi:=\base.var2#min5\ if DATAPERIOD=2 then minbi:=\base.var2#min30\if DATAPERIOD=3 then minbi:=\base.var2#min60\if DATAPERIOD=4 then minbi:=\base.var2#day\ if DATAPERIOD=5 then minbi:=\base.var2#day\ if DATAPERIOD=6 then minbi:=\base.var2#week\ if DATAPERIOD=7 then minbi:=\base.var2#month\ if DATAPERIOD=8 then minbi:=\base.var2#year\
var001:=\se.var2#min30\
if datatype=3 then var001:=\se.var2#min60\if datatype=4 then var001:=\se.var2#day\
var1:=\ var2:=\i\处理笔关系} var3:=\ngji\同级别分解} zg:=\一定要先调用ZG
zd:=\zswz:=barslast(zg>zd);
tj3:=count(abs(var3),barslast(var3=1))=0;
tj4:=l0; tj6:=ref(h,barslast(var2=1))zd,barslast(var3=1))>0; not(zg>zd)&&tj3&&tj7&&tj4&&tj5&&tj6;
end;
一买是模糊的,不准确的,三买就比较标准了,同样背驰需自行判断,否则不背驰就跌回中枢了:
begin
if DATAPERIOD=0 then minbi:=\base.var2#min1\ if DATAPERIOD=1 then minbi:=\base.var2#min5\ if DATAPERIOD=2 then minbi:=\base.var2#min30\if DATAPERIOD=3 then minbi:=\base.var2#min60\if DATAPERIOD=4 then minbi:=\base.var2#day\ if DATAPERIOD=5 then minbi:=\base.var2#day\ if DATAPERIOD=6 then minbi:=\base.var2#week\ if DATAPERIOD=7 then minbi:=\base.var2#month\ if DATAPERIOD=8 then minbi:=\base.var2#year\
var001:=\se.var2#min30\
if datatype=3 then var001:=\se.var2#min60\if datatype=4 then var001:=\se.var2#day\
var1:=\ var2:=\i\处理笔关系} var3:=\ngji\同级别分解} zg:=\一定要先调用ZG
zd:=\var1:=\ var2:=\i\ var4:=barslast(var001<>0); tj1:=ref(var001,var2)=-1; //上级别是底
var5:=sum(abs(var2),var2); tj2:=var5=1; //第一个回调才算 tj3:=count(abs(var3),barslast(var3=-1))=0;
zswz:=barslast(zg>zd);
tj4:=count(zg>zd,barslast(var3=-1))>0; tj5:=count(var2=1,barslast(var2=-1))=1;
tj6:=count(var2=1,zswz-1)=1;
tj7:=ref(l,barslast(var2=1))>ref(zg,barslast(zg>zd));
not(zg>zd)&&tj3&&tj4&&tj5&&tj6&&tj7;
end;
MA10:=MA(CLOSE,10); MA5:=MA(CLOSE,5); MA1:=MA5-MA10; MA2:=MA10; MA3:=MA10;
DATANUMBER:=DATATYPE; DATANUMBER1:=DATATYPE; DATANUMBER2:=DATATYPE; DATANUMBER3:=DATATYPE; LING:=HIGH; <%
vbdatanumber = FFL.VarData(\ vbdatanumber1 = FFL.VarData(\ vbdatanumber2 = FFL.VarData(\ vbdata=1
vbdata1=0.001 vbdata2=1
Select Case vbdatanumber Case 0
vbdata=0.015 vbdata1=0.001 vbdata2=0.015 Case 1
vbdata=0.018 vbdata1=0.001 vbdata2=0.018 Case 2
vbdata=0.037 vbdata1=0.001 vbdata2=0.037 Case 3
vbdata=0.052 vbdata1=0.001 vbdata2=0.052 Case 4
vbdata=0.067 vbdata1=0.001 vbdata2=0.067 Case 5
vbdata=0.13 vbdata1=0.001 vbdata2=0.13 Case 6
vbdata=0.28 vbdata1=0.001 vbdata2=0.28 Case 7
vbdata=0.45 vbdata1=0.001 vbdata2=0.45 Case 8
vbdata=0.73 vbdata1=0.001 vbdata2=0.73 Case 9
vbdata=1.2 vbdata1=0.001 vbdata2=1.2 Case 10
vbdata=0.6 vbdata1=0.001 vbdata2=0.6 Case 11 vbdata=0.1 vbdata1=0.001 vbdata2=0.1 Case 12
vbdata=0.02 vbdata1=0.001 vbdata2=0.02 Case else vbdata=2
vbdata1=0.001 vbdata2=2 End Select
FFL.VarData(\FFL.VarData(\FFL.VarData(\vbling = FFL.VarData(\ vbma = FFL.VarData(\ vbma2 = FFL.VarData(\ vbma3 = FFL.VarData(\ nlast = UBound( vbma ) nvalue = 0.0000 nvaluefu = 0.0000 bianhua = 2 oldbianhua = 0 for m = 0 to nlast vbma2(m) = 0 vbma3(m) = 0 vbling(m)=0 next m= 0
for i = 0 to nlast m=m+1 'nlast - m
'vbma2(i) = 0
if (vbma(i) > 0) then bianhua = 1
nvalue = nvalue + vbma(i) else
bianhua = 2
nvaluefu = nvaluefu + vbma(i)
end if
if (oldbianhua = bianhua) then else
vbma3(i) = m m=0
if (bianhua = 1) then vbma2(i) = nvaluefu nvaluefu = 0 'nvaluefu = 0 else
vbma2(i) = nvalue nvalue = 0 'nvalue = 0 end if end if
oldbianhua = bianhua next
FFL.VarData(\FFL.VarData(\FFL.VarData(\ %>
DRAWNUMBER(REF(MA2,0)<0 AND 0=1,LLV(LOW,5),REF(MA2,0)*1000,0),colorFF00; DRAWNUMBER(REF(MA2,0)<0 AND 0=1,LLV(LOW,5)-DATANUMBER,REF(MA3,0),0),colorFFFF; DRAWNUMBER(REF(MA2,0)<0 AND 0=1,LLV(LOW,5)-DATANUMBER*2,REF(MA2,0)*1000/REF(MA3,0),0),colorFF00; DRAWNUMBER(REF(MA2,0)>0 AND 0=1,HHV(HIGH,5),REF(MA2,0)*1000,0),colorFF; DRAWNUMBER(REF(MA2,0)>0 AND 0=1,HHV(HIGH,5)+DATANUMBER,REF(MA3,0),0),colorFFFF; DRAWNUMBER(REF(MA2,0)>0 AND 0=1,HHV(HIGH,5)+DATANUMBER*2,REF(MA2,0)*1000/REF(MA3,0),0),colorFF; MA1:=MA5-MA10; WEIHE:=LING; WEIPING:=LING; <%
vbhe=FFL.VarData(\ vbping=FFL.VarData(\ vbma = FFL.VarData(\ nlast = UBound( vbma ) nvalue = 0.0000 nvaluefu = 0.0000 bianhua = 2
oldbianhua = 0 i= 0
m= nlast
if (vbma(nlast) > 0) then Do While (vbma(m)>0)
nvalue = vbma(m) + nvalue i=i+1 m=m-1
if(m<0) then exit do end if Loop else
Do While (vbma(m)<0)
nvalue = vbma(m) + nvalue i=i+1 m=m-1
if(m<0) then exit do end if Loop end if
if (i=0) then i=1 end if
nvaluefu = nvalue/i vbhe(nlast) = nvalue vbping(nlast) = nvaluefu FFL.VarData(\FFL.VarData(\%>
DRAWNUMBER(WEIHE<>0 AND 0=1,IF(WEIHE>0,HIGH,LOW),WEIHE*1000,0),colorFF; DRAWNUMBER(WEIHE<>0 AND 0=1,(IF(WEIHE>0,HIGH,LOW))-DATANUMBER*2,WEIPING*1000,0),colorFF00; DRAWNUMBER(WEIPING<>0 AND 0=1,(IF(WEIHE>0,HIGH,LOW))-DATANUMBER,WEIHE/WEIPING,0),colorFFFF; DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIFF,9); MACD:=2*(DIFF-DEA); MA1:=MACD; MA2:=MACD; MA3:=MACD; MA1WE:=MACD;
HE:=MA2;
WEIHEMACD:=0; WEIPINGMACD:=0; H1:=HIGH; L1:=LOW; FOXH:=HIGH; FOXL:=LOW;
FOXBAOHAN:=LING; FOXBAOHAN1:=LING; FOXGUANXI:=LING; FOXFENXING:=LING; FOXFENXING1:=LING; FOXFENNUMBER:=LING; FOXQUEKOU:=LING; FOXBICOUNT:=LING; FOXWEIBI:=LING; <%
vbquekou=FFL.VarData(\
vbfennumber=FFL.VarData(\ vbdatanumber = FFL.VarData(\ vbh = FFL.VarData(\ vbL = FFL.VarData(\ vbh1 = FFL.VarData(\ vbL1 = FFL.VarData(\
vbbaohan = FFL.VarData(\ vbbaohan1 = FFL.VarData(\ vbguanxi = FFL.VarData(\ vbfenxing = FFL.VarData(\ vbfenxing1 = FFL.VarData(\ vbbicount=FFL.Vardata(\ vbweibi=FFL.Vardata(\ nlast = UBound( vbh ) nvalue = 0.0000 nvaluefu = 0.0000 bianhua = 2
vbguanxi(0) = 1 for m = 1 to nlast
if (vbh(m)>vbh(m-1) and vbl(m)>vbl(m-1)) then vbguanxi(m)=1 else
if (vbh(m) vbguanxi(m) = 0 if (vbguanxi(m-1)=1) then vbguanxi(m)=1 if (vbh(m)>=vbh(m-1) and vbl(m)<=vbl(m-1)) then vbbaohan(m) = 2 vbbaohan(m-1) = 1 vbh(m-1)=vbh(m) vbl(m)=vbl(m-1) else vbbaohan(m-1) = -1 vbbaohan(m) = -2 vbh(m)=vbh(m-1) vbl(m-1)=vbl(m) end if else vbguanxi(m)=-1 if (vbh(m)>=vbh(m-1) and vbl(m)<=vbl(m-1)) then vbbaohan(m) = 2 vbbaohan(m-1) = 1 vbh(m)=vbh(m-1) vbl(m-1)=vbl(m) else vbbaohan(m-1) = -1 vbbaohan(m) = -2 vbh(m-1)=vbh(m) vbl(m)=vbl(m-1) end if end if end if end if next '处理连续包含即:连续3个及以上K线间存在的包含关系 for m = 0 to nlast vbbaohan1(m) = vbbaohan(m) NEXT i=0 do while (vbbaohan(i)=0) i=i+1 if (i>nlast) then Exit Do end if loop '第一个包含的位置 lastfenxing=i bao=0 existbao=0 for m = i to nlast if (vbbaohan(m) <> 0) then bao=bao+1 if (bao>=2) then if (vbbaohan(m)=2 and vbbaohan(m-1)=1 or vbbaohan(m)=-2 and vbbaohan(m-1)=-1) then vbbaohan1(m) = bao if (bao>2) then existbao=BAO for i = 1 to bao vbh(m-bao+i)=vbh(m) vbL(m-bao+i)=vbl(m) if (i = 1 or i=bao ) then else vbbaohan1(m-bao+i)=-3 end if next end if 'do while (bao>1) 'vbh(m-bao+1)=vbh(m) 'vbL(m-bao+1)=vbl(m) 'if (existbao=BAO or bao=existbao-1) then 'else 'vbbaohan1(m-bao+1)=-3 'end if 'bao=bao-1 'loop bao=0 end if end if else bao=0 end if next '分型预处理 existbao=vbguanxi(0) for m = 1 to nlast 'if (vbh(m-1)>=vbh(m-2) and vbh(m-1)>=vbh(m) and vbl(m-1)>=vbl(m-2) and vbl(m-1)>=vbl(m) or vbh(m-1)<=vbh(m-2) and vbh(m-1)<=vbh(m) and vbl(m-1) if (vbguanxi(m)<>existbao) then if (vbguanxi(m-1)=1) then vbfenxing(m-1) = 1 '顶 else vbfenxing(m-1) = -1 '底 end if existbao=vbguanxi(m) end if next '以上分型预处理 for m = 0 to nlast vbfenxing1(m) = vbfenxing(m) vbfenxing1(m) = 0 next i=0 do while (vbfenxing(i)=0) i=i+1 if (i>nlast) then Exit Do end if loop lastfenxing=i '取第一个分型位置 '下面去掉连续的顶或底 for m = lastfenxing+1+nlast to nlast if (vbfenxing(m)<>0) then if (vbfenxing(m)<>vbfenxing(lastfenxing)) then lastfenxing=m else if (vbfenxing(m)=1) then if (vbh(m)>vbh(lastfenxing)) then vbfenxing(lastfenxing)=0 lastfenxing=m else vbfenxing(m)=0 end if else if (vbl(m) vbfenxing(m)=0 end if end if '顶要高的 底要低的 相等时要选时间在前面的 'vbfenxing(m)=0 end if end if next '以下处理分型间距离不小于4的要求同时处理连续的顶和底的问题 bao=0 i=0 n=0 existbao=vbfenxing(0) m=0 do while (vbbaohan1(i) <2) i=i+1 if (i>nlast) then Exit Do end if loop lastbaohan=i '第一个包含位置 i=0 do while (vbfenxing(i)=0) i=i+1 if (i>nlast) then Exit Do end if loop '第一个预备分型位置 lastfenxing=i lastfenxing1=lastfenxing i=0 for m = lastfenxing+1 to nlast if (vbbaohan(m) = 0) then bao=bao+1 else if (vbbaohan1(m) >=2 ) then n=n+1 end if end if vbfenxing1(m) = bao+n '包含关系只视为一个k线 'vbfenxing1(m)=vbbaohan1(m) 'if (m>735) then 'exit for 'end if if (vbfenxing(m)<>0) then if (bao+n>= 4) then '分型间距离大于等于4 符合要求 if (vbfenxing(m)<>vbfenxing(lastfenxing)) then 'vbfenxing1(m)=vbfenxing(m) n=0 bao=0 lastfenxing1=lastfenxing lastfenxing=m else if (vbfenxing(m)=1) then if (vbh(m)>vbh(lastfenxing)) then 'exit for vbfenxing(lastfenxing)=0 n=0 bao=0 lastfenxing1=lastfenxing lastfenxing=m else vbfenxing(m)=0 end if else if (vbl(m) lastfenxing1=lastfenxing lastfenxing=m else vbfenxing(m)=0 end if end if '顶要高的 底要低的 相等时要选时间在前面的 end if '将上一个分开型位置数据更新为当下位置 else '分型间距离小于4 要看情况 若与前分型不同且破坏前笔,可保留其它情况要去掉 '破坏前笔即相邻分型不同且高于上上个顶或低于上上个底 if (vbfenxing(m)<>vbfenxing(lastfenxing)) then 'vbfenxing1(m)=vbfenxing(m) 'i=lastfenxing-1 'do while (vbfenxing(i)<>vbfenxing(m)) 'i=i-1 'if (i=0) then 'Exit Do 'end if 'loop 'lastfenxing1=lastfenxing i=lastfenxing1 if (vbfenxing(m)=1) then if (vbl(m)>vbl1(m))then t1=vbl1(m) else t1=vbl(m) end if if (vbh(i)>vbh1(i))then t2=vbh(m) else t2=vbh1(m) end if if (t1>t2) then n=0 bao=0 lastfenxing1=lastfenxing lastfenxing=m else vbfenxing(m)=0 end if else if (vbh(m)>vbh1(m))then t1=vbh(m) else t1=vbh1(m) end if if (vbl(i)>vbl1(i))then t2=vbl(m) else t2=vbl1(m) end if if (t1 'if (vbh(m) lastfenxing1=lastfenxing lastfenxing=m else vbfenxing(m)=0 end if end if else if (vbfenxing(m)=1) then if (vbh(m)>vbh(lastfenxing)) then 'exit for vbfenxing(lastfenxing)=0 n=0 bao=0 lastfenxing1=lastfenxing lastfenxing=m else vbfenxing(m)=0 end if else if (vbl(m) lastfenxing1=lastfenxing lastfenxing=m else vbfenxing(m)=0 end if end if '顶要高的 底要低的 相等时要选时间在前面的 end if end if end if next '以上处理分型间距离不小于4的要求 '以下去掉连续的顶或底 i=0 do while (vbfenxing(i)=0) i=i+1 if (i>nlast) then Exit Do end if loop lastfenxing=i '取第一个分型位置 '下面去掉连续的顶或底 for m = lastfenxing+1+nlast to nlast if (vbfenxing(m)<>0) then if (vbfenxing(m)<>vbfenxing(lastfenxing)) then lastfenxing=m else if (vbfenxing(m)=1) then if (vbh(m)>vbh(lastfenxing)) then vbfenxing(lastfenxing)=0 lastfenxing=m else vbfenxing(m)=0 end if else if (vbl(m) vbfenxing(m)=0 end if end if '顶要高的 底要低的 相等时要选时间在前面的 'vbfenxing(m)=0 end if end if next '以下处理一个顶要大于相邻的两个底及一个底要小于相邻的两个顶的问题 '取第一个分型位置 i=0 do while (vbfenxing(i)=0) i=i+1 if (i>nlast) then Exit Do end if loop lastfenxing=i for m = lastfenxing+1 to nlast if (vbfenxing(m)<>0) then if (vbfenxing(m)>0) then if (vbh(m)>vbl(lastfenxing)) then '满足条件顶>底 lastfenxing=m else '不满足条件顶>底 两个全置为0,并查下一个 vbfenxing(m)=0 vbfenxing(lastfenxing)=0 m=m+1 do while (vbfenxing(m)=0) m=m+1 if (m>nlast) then Exit Do end if loop lastfenxing=m end if else if (vbl(m) '不满足条件底<顶 两个全置为0,并查下一个 vbfenxing(m)=0 vbfenxing(lastfenxing)=0 m=m+1 do while (vbfenxing(m)=0) m=m+1 if (m>nlast) then Exit Do end if loop lastfenxing=m end if end if end if next i=0 for m = 0 to nlast if (vbfenxing(m)<>0) then i=i+1 vbfennumber(m)=i end if next 'vbfennumber(nlast)=0 'vbfenxing(nlast)=-vbfenxing(lastfenxing) x1=0 x2=0 x3=0 x4=0 x5=0 x6=0 x7=0 bi=0 maxbi=0 zhsh=0 '先取三个分型数据,然后进入循环处理 a=0 'Do While (vbfenxing(a) = 0 and a <= nlast) Do While ( a < nlast) if ( vbfenxing(a) <> 0) then exit do end if a = a + 1 Loop x1=a a=x1+1 Do While ( a < nlast) if ( vbfenxing(a) <> 0) then exit do end if a = a + 1 Loop x2=a a=x2+1 Do While ( a < nlast) if ( vbfenxing(a) <> 0) then exit do end if a = a + 1 Loop x3=a a=x3+1 bi=0 zhshbegin=x1 zzg=0 zzd=0 zgg=0 zdd=0 zg=0 zd=0 gg=0 dd=0 FOR m=a TO nlast '(1)开始 按照找出不能形成线段(中枢)的连续三笔中的中间那笔是两个线段(中枢)的分界标志 '其它则是不同级别的中枢和线段的思路设计 '在大盘和指数中分笔与1分中1分级别要大一些,在个股中1分要大一些因有的个股1分钟内可能无成交 if (vbfenxing(m)<>0) then '(2) begin 只在分型不为0时进行处理,即:是分型时处理 bi=bi+1 x4=m if (zhshbegin=0) then zhshbegin=x4 end if if (vbfenxing(x1)>0) then '以顶分型开始,x1,x3取高点x2,x4取低点,线段及中枢区间取高点中的低者,低点中的高者 zg=min(vbh(x1),vbh(x3)) '临时中枢高点 zd=max(vbl(x2),vbl(x4)) '临时中枢低点 gg=max(vbh(x1),vbh(x3)) '临时中枢高高点 dd=min(vbl(x2),vbl(x4)) '临时中枢低低点 else '以底分型开始,x2,x4取高点x1,x3取低点 zg=min(vbh(x2),vbh(x4)) '临时中枢高点 zd=max(vbl(x1),vbl(x3)) '临时中枢低点 gg=max(vbh(x2),vbh(x4)) '临时中枢高高点 dd=min(vbl(x1),vbl(x3)) '临时中枢低低点 end if if (zd>zg ) then '(3)中枢低点大于高点,即未形成中枢,要将x2,x3的位置记录出来 vbweibi(x2)=1 vbweibi(x3)=2 'msgbox(\当前的vbweibi(x3):\maxbi=max(maxbi,bi) vbbicount(x2)=bi bi=-1 zhshbegin=0 else '(3)中枢低点小于等于高点,即形成中枢,不用记录位置 end if '(3)结束,将x1,x2,x3的值分别换成x2,x3,x4的值,也即向前推进一个分型,然后再返回进行比较 x1=x2 x2=x3 x3=x4 end if '(2) 结束 NEXT '(1)结束找出所有连续三笔无重叠的位置,即不能形成中枢的候选位置,以下要对这些位置进行筛选并逐个分析,看图时要特别注意这些位置'以下为自定义函数部分 Function max(a, b) If (a >= b) Then max = a Else max = b End If End Function Function min(a, b) If (a <= b) Then min = a Else min = b End If End Function FFL.Vardata(\FFL.Vardata(\FFL.VarData(\FFL.VarData(\ FFL.VarData(\FFL.VarData(\FFL.VarData(\ FFL.VarData(\FFL.VarData(\ FFL.VarData(\FFL.VarData(\%> FOXXIAN:=LING; FOXXIANG:=LING; FOXXIAND:=LING; FOXTEG:=LING; FOXTED:=LING; FOXTEGX:=LING; FOXTEG1:=LING; FOXTED1:=LING; FOXTEGX1:=LING; FOXDATATYPE:=DATATYPE; FOXTEBAO:=LING; FOXTEBAO1:=LING; FOXTEGUANXI1:=LING; FOXFENNUMXIAN:=LING; FOXZQDM:=STRLEFT(STKLABEL,2); FOXXIAOSHU:=0; <% vbquekou=FFL.VarData(\ vbfennumber=FFL.VarData(\ vbdatanumber = FFL.VarData(\ vbfennumxian=FFL.VarData(\vbxiaoshu=FFL.VarData(\vbh = FFL.VarData(\ vbL = FFL.VarData(\ vbh1 = FFL.VarData(\ vbL1 = FFL.VarData(\ vbbaohan = FFL.VarData(\ vbbaohan1 = FFL.VarData(\ vbguanxi = FFL.VarData(\ vbfenxing = FFL.VarData(\ vbfenxing1 = FFL.VarData(\ vbzqdm = FFL.VarData(\ vbxian=FFL.Vardata(\vbxiang=FFL.Vardata(\ vbxiand=FFL.Vardata(\ vbteg=FFL.Vardata(\vbted=FFL.Vardata(\vbtegx=FFL.Vardata(\vbtebao=FFL.Vardata(\ vbtebao1=FFL.Vardata(\ vbteg1=FFL.Vardata(\vbted1=FFL.Vardata(\vbtegx1=FFL.Vardata(\ vbweibi=FFL.Vardata(\ vbbicount=FFL.Vardata(\ nlast = UBound( vbh ) 'msgbox(\当前的数据类型为:\ IF ( vbzqdm =\or vbzqdm =\or vbzqdm =\or vbzqdm =\or vbzqdm =\ vbxiaoshu=3 else vbxiaoshu=2 end if IF ((vbdatanumber>=0 OR vbdatanumber=1 ) )THEN 'IF ((vbdatanumber=0 OR vbdatanumber=1 ) and ( vbzqdm =\or vbzqdm =\or vbzqdm =\or vbzqdm =\or vbzqdm =\or vbzqdm =\ELSE FOR m=0 TO nlast if (vbfenxing(m)<>0) then vbxian(m)=vbfenxing(m) vbxiang(m)=vbh(m) vbxiand(m)=vbl(m) end if NEXT ENd IF '笔的数据是按K线数据自动计算的即:vbfenxing '初始计算相关数据置为0 当数据类型为0和1即分笔和1分钟时要按笔-线段的过程组成中枢 '其它级别(指5分钟及以上)时用笔组成中枢此时要将笔的数据即:分型位置代入线段数组中 IF ((vbdatanumber>=0 OR vbdatanumber=1 ) )THEN 'IF ((vbdatanumber=0 OR vbdatanumber=1 ) and ( vbzqdm =\or vbzqdm =\or vbzqdm =\or vbzqdm =\or vbzqdm =\or vbzqdm =\ '(1)分笔和1分钟 计算线段数据 vbzqdm =0 为指数 '公式还未考虑开始连续三笔无重叠不能形成线段的处理,缠论中对此也未明确不能形成线段的笔应发生属于那个线段 '对走势中间连续三笔无重叠不能形成线段的处理也未明确不能形成线段的笔应属于那个线段 '缠论中规定线段是连续的且以不同的分型作为两个端点即:不能顶到顶和底到底,此规定要考虑的 i = 0 ex=0 Do While ( i <= nlast) If (vbfenxing(i) <> 0 ) then exit do end if i = i + 1 Loop x1 = i xianbegin = x1 i = x1 + 1 Do While ( i <= nlast) If (vbfenxing(i) <> 0 ) then exit do end if i = i + 1 Loop x2 = i i = x2 + 1 Do While ( i <= nlast) If (vbfenxing(i) <> 0 ) then exit do end if i = i + 1 Loop x3 = i i = x3 + 1 Do While ( ex=0 ) '() if (x3>nlast or x2>nlast ) then 'msgbox(\当前的1 x2:\当前的1 x3:\当前的nlast:\exit do end if if ( vbweibi(x2)=0 or vbweibi(x3)=0 or vbweibi(x3)=1 or vbweibi(x2)=2 ) then 'msgbox(\当前的1 x2:\当前的1 x3:\当前的nlast:\exit do else x1=x2 x2=x3 Do While ( i <= nlast) If (vbfenxing(i) <> 0 ) then exit do end if i = i + 1 Loop x3 = i i = x3 + 1 end if loop '() i = x3 + 1 xianbegin = x1 tewei = x2 if (x3<=nlast) then If (vbfenxing(x1) = 1) Then xianfang = -1 '以顶分型开始,线段方向向下 vbted(tewei) = vbl(tewei) vbteg(tewei) = vbh(x3) Else xianfang = -1 '以底分型开始,线段方向向上 vbteg(tewei) = vbl(tewei) vbted(tewei) = vbh(x3) End If vbtegx(tewei) = xianfang '定义出第一个特征序列,及关系即:是上升的还是下降的 end if 'tewei = x4 tenumber = 0 i = x3 + 1 vbxian(xianbegin) = vbfenxing(xianbegin) vbxiang(xianbegin) = vbh(xianbegin) vbxiand(xianbegin) = vbl(xianbegin) 'vbxiang(xianbegin) = gg 'vbxiand(xianbegin) = dd For m = i To nlast '(2) Do While ( m <= nlast) If (vbfenxing(m) <> 0 ) then exit do end if m = m + 1 Loop x4 = m m = x4 + 1 Do While ( m <= nlast) If (vbfenxing(m) <> 0 ) then exit do end if m = m + 1 Loop x5 = m m = x5 + 1 newtewei = x4 if ( x5 > nlast) then exit for end if If (xianfang = -1) Then 'xianfang=-1 以顶分型开始,线段方向向下 vbted(newtewei) = vbl(newtewei) vbteg(newtewei) = vbh(x5) Else 'xianfang=1 以底分型开始,线段方向向上 vbteg(newtewei) = vbh(newtewei) vbted(newtewei) = vbl(x5) End If '判断方向/缺口及包含 vbtegx(newtewei) = xianfang tenumber = 1 + tenumber 'if (tenumber >= 1) then If (vbted(newtewei) > vbted(tewei) And vbteg(newtewei) > vbteg(tewei) Or vbted(newtewei) < vbted(tewei) And vbteg(newtewei) < vbteg(tewei)) Then '(3)向上或向下即:不是包含 If (vbted(newtewei) > vbted(tewei) And vbteg(newtewei) > vbteg(tewei)) Then '(4) 特征序列的方向向上 tefang = 1 Else tefang = -1 '(4)特征序列的方向向下 End If vbtegx(newtewei) = tefang If (xianfang <> tefang) Then '(5)线段方向与特征序列的方向不同,即:出现了特征序列的分型 线段方向与特征序列关系不同,出现分型, '首先判断自tewei(x2)开始的三笔是否构成线段,构成线段则下一步,不构成线段返回原线段继续,再判断第一个(tewei的前一个特征序列)与第二个(tewei)之间是否有缺口 if ( vbweibi(x4)=0 or vbweibi(x3)=0 or vbweibi(x4)=1 or vbweibi(x3)=2 ) then 'if ( vbweibi(x6)=0 or vbweibi(x5)=0 ) then '{}构成线段,新线段从newtewei开始,原线段在newtewei处结束 还要判断顶是否大于底 if (tenumber <= 1) then '(tenumber)此情况发生在三笔构成线段但线段的两端不是其最高点或最低点的情况,当下只有三笔不能开始新线段否则就出现一笔构成一个线段的现象了 i=m Do While ( i <= nlast) If (vbfenxing(i) <> 0 ) then exit do end if i = i + 1 Loop x6 = i if ( x6 > nlast) then 'msgbox( \当前的x6:\当前的nlast:\exit for end if '再判断x5,x6是否构成线段,构成则新线段否则原线段继续 if ( vbweibi(x6)=0 or vbweibi(x5)=0 or vbweibi(x6)=1 or vbweibi(x5)=2 ) then '开始 构成新线段,新线段在newtewei开始xianbegin=newtewei vbxian(xianbegin) = vbfenxing(xianbegin) vbxiang(xianbegin) = vbh(xianbegin) vbxiand(xianbegin) = vbl(xianbegin) x2=x5 x3=x6 tewei=x2 m = x6 + 1 If (vbfenxing(xianbegin) = 1) Then xianfang = -1 '以顶分型开始,线段方向向下 vbted(tewei) = vbl(tewei) vbteg(tewei) = vbh(x3) Else xianfang = 1 '以底分型开始,线段方向向上 vbteg(tewei) = vbh(tewei) vbted(tewei) = vbl(x3) End If vbtegx(tewei) = xianfang tenumber = 0 else 'else 原线段继续 tewei=newtewei vbtegx(newtewei) = xianfang x2=x4 x3=x5 m = x5 + 1 end if '开始结束 else '(tenumber) tenumber = 0 bao = 0 xianbegin = tewei vbxian(xianbegin) = vbfenxing(xianbegin) vbxiang(xianbegin) = vbh(xianbegin) vbxiand(xianbegin) = vbl(xianbegin) x2 = X3 x3 = x4 tewei = x2 If (vbfenxing(xianbegin) = 1) Then xianfang = -1 '以顶分型开始,线段方向向下 vbted(tewei) = vbl(tewei) vbteg(tewei) = vbh(x3) Else xianfang = 1 '以底分型开始,线段方向向上 vbteg(tewei) = vbh(tewei) vbted(tewei) = vbl(x3) End If vbtegx(tewei) = xianfang m = x3+1 end if '(tenumber) else '{}不构成线段,原线段继续 tewei=newtewei vbtegx(newtewei) = xianfang x2=x4 x3=x5 m = x5 + 1 end if '{} Else '(5)线段方向与特征序列关系相同,未出现分型tewei的值更新为newtewei 'tenumber = 1+tenumber vbtegx(newtewei) = xianfang tewei=newtewei x2=x4 x3=x5 End If '(5) Else '(3)包含 vbtegx(newtewei) = xianfang If (vbted(tewei) >= vbted(newtewei) And vbteg(tewei) <= vbteg(newtewei)) Then '后面包含前面 newtewei是后面的 tewei在前面 1为tewei被后一个包含 2为newtewei包含前一个 vbtebao(tewei) = 1 vbtebao(newtewei) = 2 Else '前面包含后面 -1为tewei包含后一个 -2为newtewei被前一个包含 vbtebao(tewei) = -1 vbtebao(newtewei) = -2 End If If (xianfang = -1) Then '线段方向向下取向下包含 temp = min(vbted(newtewei), vbted(tewei)) vbted(newtewei) = temp vbted(tewei) = temp temp = min(vbteg(newtewei), vbteg(tewei)) vbteg(newtewei) = temp vbteg(tewei) = temp Else '线段方向向上取向上包含 temp = max(vbted(newtewei), vbted(tewei)) vbted(newtewei) = temp vbted(tewei) = temp temp = max(vbteg(newtewei), vbteg(tewei)) vbteg(newtewei) = temp vbteg(tewei) = temp End If '判断与tewei的前面是否有连续的包含关系 temp = tewei - 1 ex = 0 bao = 0 Do While (ex = 0) Do While ( temp >=0) If (vbteg(temp) <> 0 ) then exit do end if temp = temp - 1 Loop if (temp<0) then 'msgbox(\当前的10 temp:\当前的nlast:\exit do end if If (vbtebao(temp) = 0 Or vbtebao(temp) >= 2 Or vbtebao(temp) = -2 Or vbtegx(temp) <> xianfang) Then ex = 1 Else bao = bao + 1 End If temp = temp - 1 Loop '有几个连续包含,指大于三个K线的包含,BAO的值是包含的K线数减2,当只有两个连续K线包含时BAO为0 temp = tewei - 1 For i = 1 To bao Do While ( temp >=0) If (vbteg(temp) <> 0 ) then exit do end if temp = temp - 1 Loop if (temp<0) then 'msgbox(\当前的11 temp:\当前的nlast:\exit for end if vbteg(temp) = vbteg(tewei) vbted(temp) = vbted(tewei) temp = temp - 1 Next vbtebao(newtewei) = bao + 2 temp = tewei - 1 For i = 1 To bao + 2 If (i = 1 Or i = bao + 2) Then Else Do While ( temp >0) If (vbteg(temp) <> 0 ) then exit do end if temp = temp - 1 Loop if (temp<0) then 'msgbox(\当前的12 temp:\当前的nlast:\exit for end if vbtebao(temp) = -3 temp = temp - 1 End If Next tewei=newtewei x2=x4 x3=x5 m = x5 + 1 End If '(3) Next '(2) For i = 0 To nlast If (vbtebao(i) = -2) Then vbtebao(i) = 2 End If If (vbtebao1(i) = -2) Then vbtebao1(i) = 2 End If Next '包含关系标准化,即结束标志都为2及以上 '处理线段的两个端点满足条件顶>=底 i=0 do while (vbxian(i)=0) i=i+1 if (i>nlast) then Exit Do end if loop lastfenxing=i for m = lastfenxing+1+ nlast to nlast if (vbxian(m)<>0) then if (vbxian(m)>0) then if (vbxiang(m)>=vbxiand(lastfenxing)) then '满足条件顶>=底 lastfenxing=m else '不满足条件顶<底 两个全置为0,并查下一个 vbxian(m)=0 vbxian(lastfenxing)=0 vbxiang(m)=0 vbxiang(lastfenxing)=0 vbxiand(m)=0 vbxiand(lastfenxing)=0 m=m+1 do while (vbxian(m)=0) m=m+1 if (m>nlast) then Exit Do end if loop lastfenxing=m end if else if (vbxiand(m)<=vbxiang(lastfenxing)) then '满足条件底<顶 lastfenxing=m else '不满足条件底<顶 两个全置为0,并查下一个 vbxian(m)=0 vbxian(lastfenxing)=0 vbxiang(m)=0 vbxiang(lastfenxing)=0 vbxiand(m)=0 vbxiand(lastfenxing)=0 m=m+1 do while (vbxian(m)=0) m=m+1 if (m>nlast) then Exit Do end if loop lastfenxing=m end if end if end if next '计算线段的高点和低点 i=0 do while (vbxian(i)=0) i=i+1 if (i>nlast) then Exit Do end if loop lastfenxing=i 'vbxiang(i)=vbh(i) 'vbxiand(i)=vbl(i) gg=vbxiang(i) dd=vbxiand(i) for m = lastfenxing+1+ nlast to nlast if (vbfenxing(m)<>0) then gg=max(gg,vbh(m)) dd=min(dd,vbl(m)) if (vbxian(m)<>0) then vbxiang(i)=gg vbxiand(i)=dd if (vbxian(m)>0) then else end if gg=vbh(m) dd=vbl(m) end if end if next end if '(1) i=nlast do while (vbxian(i)=0) i=i-1 if (i>nlast or i<0) then Exit Do end if loop lastfenxing=i 'vbxian(nlast) = -vbxian(lastfenxing) 'vbxiang(nlast) = vbh(nlast) 'vbxiand(nlast) = vbl(nlast) 'vbteg(newtewei) = 0 'vbted(newtewei) = 0 '以下为自定义函数部分 Function max(a, b) If (a >= b) Then max = a Else max = b End If End Function Function min(a, b) If (a <= b) Then min = a Else min = b End If End Function FFL.VarData(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\FFL.Vardata(\%> FOXWEI:=LING; FOXBUYSELL:=LING; <% vbdatanumber3 = FFL.VarData(\ vbbicount=FFL.Vardata(\ vbweibi=FFL.Vardata(\ vbquekou=FFL.VarData(\ vbfennumber=FFL.VarData(\ vbfennumxian=FFL.VarData(\ vbh = FFL.VarData(\ vbL = FFL.VarData(\ vbh1 = FFL.VarData(\ vbL1 = FFL.VarData(\ vbbaohan = FFL.VarData(\ vbbaohan1 = FFL.VarData(\ vbguanxi = FFL.VarData(\ vbfenxing = FFL.VarData(\ vbfenxing1 = FFL.VarData(\ vbbuysell=FFL.VarData(\ vbwei=FFL.Vardata(\vbxian=FFL.Vardata(\vbxiang=FFL.Vardata(\vbxiand=FFL.Vardata(\ vbteg=FFL.Vardata(\vbted=FFL.Vardata(\vbtegx=FFL.Vardata(\vbteg1=FFL.Vardata(\vbted1=FFL.Vardata(\ vbtegx1=FFL.Vardata(\ nlast = UBound( vbh ) i=0 for m = 0 to nlast if (vbxian(m)<>0) then i=i+1 vbfennumxian(m)=i end if next 'vbfennumxian(nlast)=0 x1=0 x2=0 x3=0 x4=0 x5=0 x6=0 x7=0 bi=0 maxbi=0 zhsh=0 '先取三个分型数据,然后进入循环处理 a=0 'Do While (vbxian(a) = 0 and a <= nlast) Do While ( a < nlast) if ( vbxian(a) <> 0) then exit do end if a = a + 1 Loop x1=a a=x1+1 Do While ( a < nlast) if ( vbxian(a) <> 0) then exit do end if a = a + 1 Loop x2=a a=x2+1 Do While ( a < nlast) if ( vbxian(a) <> 0) then exit do end if a = a + 1 Loop x3=a a=x3+1 bi=0 zhshbegin=x1 zzg=0 zzd=0 zgg=0 zdd=0 zg=0 zd=0 gg=0 dd=0 'vbbicount=FFL.Vardata(\ 'vbweibi=FFL.Vardata(\FOR m=a TO nlast '(1)开始 按照找出不能形成线段(中枢)的连续三笔中的中间那笔是两个线段(中枢)的分界标志 '其它则是不同级别的中枢和线段的思路设计 '在大盘和指数中分笔与1分中1分级别要大一些,在个股中1分要大一些因有的个股1分钟内可能无成交 if (vbxian(m)<>0) then '(2) begin 只在分型不为0时进行处理,即:是分型时处理 bi=bi+1 x4=m if (zhshbegin=0) then zhshbegin=x4 end if if (vbxian(x1)>0) then '以顶分型开始,x1,x3取高点x2,x4取低点,线段及中枢区间取高点中的低者,低点中的高者 zg=min(vbxiang(x1),vbxiang(x3)) '临时中枢高点 zd=max(vbxiand(x2),vbxiand(x4)) '临时中枢低点 gg=max(vbxiang(x1),vbxiang(x3)) '临时中枢高高点 dd=min(vbxiand(x2),vbxiand(x4)) '临时中枢低低点 else '以底分型开始,x2,x4取高点x1,x3取低点 zg=min(vbxiang(x2),vbxiang(x4)) '临时中枢高点 zd=max(vbxiand(x1),vbxiand(x3)) '临时中枢低点 gg=max(vbxiang(x2),vbxiang(x4)) '临时中枢高高点 dd=min(vbxiand(x1),vbxiand(x3)) '临时中枢低低点 end if if (zd>zg ) then '(3)中枢低点大于高点,即未形成中枢,要将x2,x3的位置记录出来 vbwei(x2)=1 vbwei(x3)=2 '还要计算上一个中枢的级别和中枢区间及波动区间,计算中枢的级别根据bi记数器的值,中枢计算完毕后笔记数器bi清零 'bi记数器的值小于等于6时为本级别中枢,值为7或8时可能为本级别两个中枢,大于或等于9时为上一级别的中枢 maxbi=max(maxbi,bi) vbbicount(x2)=bi bi=-1 zhshbegin=0 else '(3)中枢低点小于等于高点,即形成中枢,不用记录位置 end if '(3)结束,将x1,x2,x3的值分别换成x2,x3,x4的值,也即向前推进一个分型,然后再返回进行比较 x1=x2 x2=x3 x3=x4 end if '(2) 结束 NEXT '(1)结束找出所有连续三线段无重叠的位置,即不能形成中枢的候选位置,以下要对这些位置进行筛选并逐个分析,看图时要特别注意这些位置 FFL.Vardata(\FFL.Vardata(\ Function max(a, b) If (a >= b) Then max = a Else max = b End If End Function Function min(a, b) If (a <= b) Then min = a Else min = b End If End Function FFL.Vardata(\ FFL.VarData(\FFL.Vardata(\ FFL.VarData(\%> FOXZHSH:=LING; FOXZHSHG:=LING; FOXZHSHD:=LING; FOXZHSHGG:=LING; FOXZHSHDD:=LING; FOXZHSH5:=LING; FOXZHSHG5:=LING; FOXZHSHD5:=LING; FOXZHSHGG5:=LING; FOXZHSHDD5:=LING; FOXZHSH15:=LING; FOXZHSHG15:=LING; FOXZHSHD15:=LING; FOXZHSHGG15:=LING; FOXZHSHDD15:=LING; FOXZHSH30:=LING; FOXZHSHG30:=LING; FOXZHSHD30:=LING; FOXZHSHGG30:=LING; FOXZHSHDD30:=LING; FOXZHSH60:=LING; FOXZHSHG60:=LING; FOXZHSHD60:=LING; FOXZHSHGG60:=LING; FOXZHSHDD60:=LING; FOXZHSHR:=LING; FOXZHSHGR:=LING; FOXZHSHDR:=LING; FOXZHSHGGR:=LING; FOXZHSHDDR:=LING; FOXZHSHZ:=LING; FOXZHSHGZ:=LING; FOXZHSHDZ:=LING; FOXZHSHGGZ:=LING; FOXZHSHDDZ:=LING; FOXZHSHY:=LING; FOXZHSHGY:=LING; FOXZHSHDY:=LING; FOXZHSHGGY:=LING; FOXZHSHDDY:=LING; FOXZHSHN:=LING; FOXZHSHGN:=LING; FOXZHSHDN:=LING; FOXZHSHGGN:=LING; FOXZHSHDDN:=LING; FOXZHSHMM:=LING; FOXZHSHMM5:=LING; FOXZHSHMM15:=LING; FOXZHSHMM30:=LING; FOXZHSHMM60:=LING; FOXZHSHMMR:=LING; FOXZHSHMMZ:=LING; FOXZHSHMMY:=LING; FOXZHSHMMN:=LING; FOXYANWEI:=LING; DATANUMBER4:=DATATYPE; FOXYANBICOUNT:=LING; <% vbquekou=FFL.VarData(\ vbfennumber=FFL.VarData(\ vbh = FFL.VarData(\ vbL = FFL.VarData(\ vbh1 = FFL.VarData(\ vbL1 = FFL.VarData(\ vbbaohan = FFL.VarData(\ vbbaohan1 = FFL.VarData(\ vbguanxi = FFL.VarData(\ vbfenxing = FFL.VarData(\ vbfenxing1 = FFL.VarData(\ vbbuysell=FFL.VarData(\ vbwei=FFL.Vardata(\vbxian=FFL.Vardata(\vbxiang=FFL.Vardata(\ vbxiand=FFL.Vardata(\ vbzhsh = FFL.VarData(\ vbzhshg = FFL.VarData(\ vbzhshd = FFL.VarData(\ vbzhshgg = FFL.VarData(\ vbzhshdd = FFL.VarData(\ vbzhsh5 = FFL.VarData(\vbzhshg5 = FFL.VarData(\ vbzhshd5 = FFL.VarData(\ vbzhshgg5 = FFL.VarData(\ vbzhshdd5 = FFL.VarData(\ vbzhsh15 = FFL.VarData(\vbzhshg15 = FFL.VarData(\vbzhshd15 = FFL.VarData(\vbzhshgg15 = FFL.VarData(\ vbzhshdd15 = FFL.VarData(\ vbzhsh30 = FFL.VarData(\vbzhshg30 = FFL.VarData(\vbzhshd30 = FFL.VarData(\vbzhshgg30 = FFL.VarData(\vbzhshdd30 = FFL.VarData(\ vbzhsh60 = FFL.VarData(\vbzhshg60 = FFL.VarData(\vbzhshd60 = FFL.VarData(\vbzhshgg60 = FFL.VarData(\ vbzhshdd60 = FFL.VarData(\ vbzhshr = FFL.VarData(\vbzhshgr = FFL.VarData(\ vbzhshdr = FFL.VarData(\ vbzhshggr = FFL.VarData(\ vbzhshddr = FFL.VarData(\ vbzhshz = FFL.VarData(\ vbzhshgz = FFL.VarData(\ vbzhshdz = FFL.VarData(\vbzhshggz = FFL.VarData(\vbzhshddz = FFL.VarData(\vbzhshy = FFL.VarData(\ vbzhshgy = FFL.VarData(\vbzhshdy = FFL.VarData(\vbzhshggy = FFL.VarData(\ vbzhshddy = FFL.VarData(\vbzhshn = FFL.VarData(\ vbzhshgn = FFL.VarData(\ vbzhshdn = FFL.VarData(\ vbzhshggn = FFL.VarData(\ vbzhshddn = FFL.VarData(\ vbzhshmm=FFL.VarData(\ vbzhshmm5=FFL.VarData(\vbzhshmm15=FFL.VarData(\vbzhshmm30=FFL.VarData(\ vbzhshmm60=FFL.VarData(\vbzhshmmr=FFL.VarData(\ vbzhshmmz=FFL.VarData(\ vbzhshmmy=FFL.VarData(\vbzhshmmn=FFL.VarData(\vbyanwei=FFL.Vardata(\maxyanbi=FFL.VarData(\ vbyanbicount=FFL.Vardata(\ nlast = UBound( vbh ) foxbicount=0 x1=0 x2=0 x3=0 x4=0 x5=0 x6=0 x7=0 '先取三个分型数据,然后进入循环处理 a=0 if (a <= nlast) then Do While ( vbxian(a) = 0 and a <= nlast) a = a + 1 if (a = nlast) then exit do end if Loop end if x1=a a=x1+1 if (a <= nlast) then Do While ( vbxian(a) = 0 and a <= nlast) a = a + 1 if (a = nlast) then exit do end if Loop end if x2=a a=x2+1 if (a <= nlast) then Do While ( vbxian(a) = 0 and a <= nlast) a = a + 1 if (a = nlast) then exit do end if Loop end if x3=a a=x3+1 bi=0 zhshbegin=x1 zhshxing=0 '是否已形成中枢 zhshhoubi=0 '形成中枢后笔记数器 yanshen=0 '是否延伸 yanshenbi=0 '延伸的笔数 qushi=0 '趋势 zhshend=0 maxbi=0 FOR m=a TO nlast '(1)开始 中枢级别为:1分,5分,15分,30分,60分,日,周,月,年,分别用vbdatanumber代表即:1,2,3,4,5,6,7,8,9 if (vbxian(m)<>0) then '(2) begin 只在分型不为0时进行处理,即:是分型时处理 if (zhshxing=1) then zhshhoubi=zhshhoubi+1 end if x4=m if (zhshbegin=0) then zhshbegin=x1 end if if (zhshxing=0) then '(3)开始 没有中枢形成的情况 if (vbxian(x1)>0) then '以顶分型开始,x1,x3取高点x2,x4取低点,线段及中枢区间取高点中的低者,低点中的高者 zg=min(vbxiang(x1),vbxiang(x3)) zd=max(vbxiand(x2),vbxiand(x4)) gg=max(vbxiang(x1),vbxiang(x3)) dd=min(vbxiand(x2),vbxiand(x4)) else '以底分型开始,x2,x4取高点x1,x3取低点 zg=min(vbxiang(x2),vbxiang(x4)) zd=max(vbxiand(x1),vbxiand(x3)) gg=max(vbxiang(x2),vbxiang(x4)) dd=min(vbxiand(x1),vbxiand(x3)) end if if (zg>=zd) then '(4)开始 形成中枢 if (zhshxing=0) then vbzhsh(zhshbegin)=1 vbzhshg(zhshbegin)=zg vbzhshd(zhshbegin)=zd vbzhshgg(zhshbegin)=gg vbzhshdd(zhshbegin)=dd end if zhshxing=1 zhshend=m else '(4)else未形成中枢,下移一笔继续返回分析 zhshbegin=x2 x1=x2 x2=x3 x3=x4 end if '(4)结束 else '(3)else 有中枢形成的情况 'if (zhshhoubi Mod 2 =1) then '(5)begin中枢后的单数笔要判断中枢否结束,中枢结束的标志是中枢后的单数笔不回到中枢区间内(可能是震荡或趋势),中枢后的单数笔回到中枢区间内则为中枢延伸 '单数笔肯定回到波动区间,但不一定回中枢区间;不回中枢区间则要看下面走势的发展若其后走势不回到波动区间则构成趋势,若其后走势回到波动区间是中枢振荡 ',回中枢区间也是振荡.新中枢自当下M的分型开始,原中枢自zhshend(上一个M)处结束.此处与教材不同,比教材要早确认一个分型 if (vbxian(m)>0) then '(6)顶分型,要比较三种情况即:vbxiang(m)是否大于等于GG,ZG,ZD,大于等于ZD为延伸,大于等于ZG,大于等于GG,若下一个(即:zhshhoubi Mod 2 =0)底回到中枢(即:vbxiand(m)<=ZG)则为延伸否则为三卖 if (vbxiang(m)>=zd) then '(7) begin中枢后的单数笔回到中枢区间内则为中枢延伸,要记录下来, vbxiang(m)肯定于大于等于dd,因是相邻伐肯定要大于底,在计算笔时已有保证,要计算延伸中枢四个数据 yanshen=1 yanshenbi=yanshenbi+1 maxyanbi=max(maxyanbi,yanshenbi) vbyanwei(m)=m vbyanbicount(m)=yanshenbi if (yanshenbi<6) then zhshend=m else '延伸超过6笔构成级别扩展,上一级别中枢结束,新的本级别中枢开始 vbzhsh(zhshend)=2 vbzhshg(zhshend)=zg vbzhshd(zhshend)=zd vbzhshgg(zhshend)=gg vbzhshdd(zhshend)=dd vbzhsh(zhshbegin)=1 vbzhshg(zhshbegin)=zg vbzhshd(zhshbegin)=zd vbzhshgg(zhshbegin)=gg vbzhshdd(zhshbegin)=dd yanshen=0 yanshenbi=0 zhshxing=0 vbzhsh5(m)=2 vbzhsh5(zhshbegin)=1 a=m+1 if (a <= nlast) then Do While ( vbxian(a) = 0 and a <= nlast) a = a + 1 if (a = nlast) then exit do end if Loop end if x1=a zhshbegin=x1 a=x1+1 if (a <= nlast) then Do While ( vbxian(a) = 0 and a <= nlast) a = a + 1 if (a = nlast) then exit do end if Loop end if x2=a a=x2+1 if (a <= nlast) then Do While ( vbxian(a) = 0 and a <= nlast) a = a + 1 if (a = nlast) then exit do end if Loop end if x3=a m=x3+1 zhshhoubi=0 end if else '(7) else 单数笔不回到中枢区间内,形成第三类卖点,应标记出来,同时老中枢结束新中枢开始,老中枢在zhshend处结束新中枢在当下m处理开始,形成中枢振荡 yanshen=0 yanshenbi=0 vbzhshmm(m)=-1 '-1为卖与分型数正好相反 ,1为买,将中枢结束信息记录到zhsheng位置 ,再取两个分型进行比较,因第一个分型即是m所以x1的值的为m,x1不用计算只取x2和x3 zhshxing=0 vbzhsh(zhshend)=2 vbzhshg(zhshend)=zg vbzhshd(zhshend)=zd vbzhshgg(zhshend)=gg vbzhshdd(zhshend)=dd vbzhsh(zhshbegin)=1 vbzhshg(zhshbegin)=zg vbzhshd(zhshbegin)=zd vbzhshgg(zhshbegin)=gg vbzhshdd(zhshbegin)=dd if (yanshenbi>=6) then '(12)begin 延伸超过6笔构成级别扩展,计算上一级别(5分)中枢的中枢区间及波动区间,ygg,yzg,yzd,ydd已经计算 vbzhsh5(zhshbegin)=1 vbzhsh5(m)=2 end if '(12)结束 zhshbegin=m x1=m a=x1+1 if (a <= nlast) then Do While ( vbxian(a) = 0 and a <= nlast) a = a + 1 if (a = nlast) then exit do end if Loop end if x2=a a=x2+1 if (a <= nlast) then Do While ( vbxian(a) = 0 and a <= nlast) a = a + 1 if (a = nlast) then exit do end if Loop end if x3=a m=x3+1 zhshhoubi=0 end if '(7)结束 else '(6) else底分型,要比较三种情况即:vbxiand(m)是否小于等于ZG,ZD,DD,小于等于ZG为延伸,小于等于ZG,小于等于DD,若下一个(即:zhshhoubi Mod 2 =0)顶回到中枢(即:vbxiang(m)>=ZD)则为延伸否则为三买 if (vbxiand(m)<=zg) then '(8) begin中枢后的单数笔回到中枢区间内则为中枢延伸,要记录下来, vbxiand(m)肯定于小于等于gg,因是相邻伐肯定要大于底,在计算笔时已有保证 yanshen=1 yanshenbi=yanshenbi+1 maxyanbi=max(maxyanbi,yanshenbi) vbyanwei(m)=m vbyanbicount(m)=yanshenbi if (yanshenbi<6) then zhshend=m else '延伸超过6笔构成级别扩展,上一级别中枢结束