您的位置 首页 飞狐公式

飞狐缠中说禅主图指标公式

{公式名称:缠论形态—本级}
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("datanumber")
vbdatanumber1 = FFL.VarData("datanumber1")
vbdatanumber2 = FFL.VarData("datanumber2")
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("datanumber") =vbdata
FFL.VarData("datanumber1") =vbdata1
FFL.VarData("datanumber2") =vbdata2
vbling = FFL.VarData("ling")
vbma = FFL.VarData("ma1")
vbma2 = FFL.VarData("ma2")
vbma3 = FFL.VarData("ma3")
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("ma2") = vbma2
FFL.VarData("ma3") = vbma3
FFL.VarData("ling") =vbling
%>
DRAWNUMBER(REF(MA2,0)<0 AND 0=1,LLV(LOW,5),REF(MA2,0)*1000,0),colorFF00;
{公式指标 www.gszb.top}
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("weihe")
vbping=FFL.VarData("weiping")
vbma = FFL.VarData("ma1")
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("weihe") =vbhe
FFL.VarData("weiping")= vbping
%>
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("foxquekou")
vbfennumber=FFL.VarData("foxfennumber")
vbdatanumber = FFL.VarData("datanumber")
vbh = FFL.VarData("foxh")
vbL = FFL.VarData("foxl")
vbh1 = FFL.VarData("foxh")
vbL1 = FFL.VarData("foxl")
vbbaohan = FFL.VarData("foxbaohan")
vbbaohan1 = FFL.VarData("foxbaohan1")
vbguanxi = FFL.VarData("foxguanxi")
vbfenxing = FFL.VarData("foxfenxing")
vbfenxing1 = FFL.VarData("foxfenxing1")
vbbicount=FFL.Vardata("foxbicount")
vbweibi=FFL.Vardata("foxweibi")
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)<vbh(m-1) and vbl(m)<vbl(m-1)) then
vbguanxi(m)=-1
else
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)<vbl(m-2) and vbl(m-1)<=vbl(m)) then
'end if
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)<vbl(lastfenxing)) then
vbfenxing(lastfenxing)=0
lastfenxing=m
else
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)<vbl(lastfenxing)) then
vbfenxing(lastfenxing)=0
n=0
bao=0
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<t2) then
'if (vbh(m)<vbl(i)) then
n=0
bao=0
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)<vbl(lastfenxing)) then
vbfenxing(lastfenxing)=0
n=0
bao=0
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)<vbl(lastfenxing)) then
vbfenxing(lastfenxing)=0
lastfenxing=m
else
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)<vbh(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
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):" & cstr(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("foxweibi")=vbweibi
FFL.Vardata("foxbicount")=vbbicount
FFL.VarData("foxh") =vbh
FFL.VarData("foxl") =vbl
FFL.VarData("foxbaohan") = vbbaohan
FFL.VarData("foxbaohan1") = vbbaohan1
FFL.VarData("foxguanxi") = vbguanxi
FFL.VarData("foxfenxing") = vbfenxing
FFL.VarData("foxfenxing1") = vbfenxing1
FFL.VarData("foxfennumber") = vbfennumber
FFL.VarData("foxquekou") = vbquekou
%>
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("foxquekou")
vbfennumber=FFL.VarData("foxfennumber")
vbdatanumber = FFL.VarData("foxdatatype")
vbfennumxian=FFL.VarData("foxfennumxian")
vbxiaoshu=FFL.VarData("foxxiaoshu")
vbh = FFL.VarData("foxh")
vbL = FFL.VarData("foxl")
vbh1 = FFL.VarData("foxh")
vbL1 = FFL.VarData("foxl")
vbbaohan = FFL.VarData("foxbaohan")
vbbaohan1 = FFL.VarData("foxbaohan1")
vbguanxi = FFL.VarData("foxguanxi")
vbfenxing = FFL.VarData("foxfenxing")
vbfenxing1 = FFL.VarData("foxfenxing1")
vbzqdm = FFL.VarData("foxzqdm")
vbxian=FFL.Vardata("foxxian")
vbxiang=FFL.Vardata("foxxiang")
vbxiand=FFL.Vardata("foxxiand")
vbteg=FFL.Vardata("foxteg")
vbted=FFL.Vardata("foxted")
vbtegx=FFL.Vardata("foxtegx")
vbtebao=FFL.Vardata("foxtebao")
vbtebao1=FFL.Vardata("foxtebao1")
vbteg1=FFL.Vardata("foxteg1")
vbted1=FFL.Vardata("foxted1")
vbtegx1=FFL.Vardata("foxtegx1")
vbweibi=FFL.Vardata("foxweibi")
vbbicount=FFL.Vardata("foxbicount")
nlast = UBound( vbh )
'msgbox("当前的数据类型为:" & cstr(vbzqdm))
IF ( vbzqdm ="58" or vbzqdm ="90" or vbzqdm ="03" or vbzqdm ="18" or vbzqdm ="50" or vbzqdm ="51" or vbzqdm ="52" ) THEN
vbxiaoshu=3
else
vbxiaoshu=2
end if
IF ((vbdatanumber>=0 OR vbdatanumber=1 ) )THEN
'IF ((vbdatanumber=0 OR vbdatanumber=1 ) and ( vbzqdm ="88" or vbzqdm ="1b" or vbzqdm ="1B" or vbzqdm ="1a" or vbzqdm ="1A" or vbzqdm ="39" ) )THEN
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 ="88" or vbzqdm ="1b" or vbzqdm ="1B" or vbzqdm ="1a" or vbzqdm ="1A" or vbzqdm ="39" ) )THEN
'(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:" & cstr(x2) & "当前的1 x3:" & cstr(x3) & "当前的nlast:" & cstr(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:" & cstr(x2) & "当前的1 x3:" & cstr(x3) & "当前的nlast:" & cstr(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:" & cstr(x6) & "当前的nlast:" & cstr(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:" & cstr(temp) & "当前的nlast:" & cstr(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:" & cstr(temp) & "当前的nlast:" & cstr(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:" & cstr(temp) & "当前的nlast:" & cstr(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("foxxiaoshu") =vbxiaoshu
FFL.Vardata("foxteg")=vbteg
FFL.Vardata("foxted")=vbted
FFL.Vardata("foxtegx")=vbtegx
FFL.Vardata("foxteg1")=vbteg1
FFL.Vardata("foxted1")=vbted1
FFL.Vardata("foxtegx1")=vbtegx1
FFL.Vardata("foxtebao")=vbtebao
FFL.Vardata("foxtebao1")=vbtebao1
FFL.Vardata("foxxian")=vbxian
FFL.Vardata("foxxiang")=vbxiang
FFL.Vardata("foxxiand")=vbxiand
%>
FOXWEI:=LING;
FOXBUYSELL:=LING;
<%
vbdatanumber3 = FFL.VarData("datanumber3")
vbbicount=FFL.Vardata("foxbicount")
vbweibi=FFL.Vardata("foxweibi")
vbquekou=FFL.VarData("foxquekou")
vbfennumber=FFL.VarData("foxfennumber")
vbfennumxian=FFL.VarData("foxfennumxian")
vbh = FFL.VarData("foxh")
vbL = FFL.VarData("foxl")
vbh1 = FFL.VarData("foxh")
vbL1 = FFL.VarData("foxl")
vbbaohan = FFL.VarData("foxbaohan")
vbbaohan1 = FFL.VarData("foxbaohan1")
vbguanxi = FFL.VarData("foxguanxi")
vbfenxing = FFL.VarData("foxfenxing")
vbfenxing1 = FFL.VarData("foxfenxing1")
vbbuysell=FFL.VarData("foxbuysell")
vbwei=FFL.Vardata("foxwei")
vbxian=FFL.Vardata("foxxian")
vbxiang=FFL.Vardata("foxxiang")
vbxiand=FFL.Vardata("foxxiand")
vbteg=FFL.Vardata("foxteg")
vbted=FFL.Vardata("foxted")
vbtegx=FFL.Vardata("foxtegx")
vbteg1=FFL.Vardata("foxteg1")
vbted1=FFL.Vardata("foxted1")
vbtegx1=FFL.Vardata("foxtegx1")
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("foxbicount")
'vbweibi=FFL.Vardata("foxweibi")
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("foxweibi")=vbweibi
FFL.Vardata("foxbicount")=vbbicount
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("foxwei")=vbwei
FFL.VarData("datanumber3") =maxbi
FFL.Vardata("foxbicount")=vbbicount
FFL.VarData("foxfennumxian") = vbfennumxian
%>
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("foxquekou")
vbfennumber=FFL.VarData("foxfennumber")
vbh = FFL.VarData("foxh")
vbL = FFL.VarData("foxl")
vbh1 = FFL.VarData("foxh")
vbL1 = FFL.VarData("foxl")
vbbaohan = FFL.VarData("foxbaohan")
vbbaohan1 = FFL.VarData("foxbaohan1")
vbguanxi = FFL.VarData("foxguanxi")
vbfenxing = FFL.VarData("foxfenxing")
vbfenxing1 = FFL.VarData("foxfenxing1")
vbbuysell=FFL.VarData("foxbuysell")
vbwei=FFL.Vardata("foxwei")
vbxian=FFL.Vardata("foxxian")
vbxiang=FFL.Vardata("foxxiang")
vbxiand=FFL.Vardata("foxxiand")
vbzhsh = FFL.VarData("foxzhsh")
vbzhshg = FFL.VarData("foxzhshg")
vbzhshd = FFL.VarData("foxzhshd")
vbzhshgg = FFL.VarData("foxzhshgg")
vbzhshdd = FFL.VarData("foxzhshdd")
vbzhsh5 = FFL.VarData("foxzhsh5")
vbzhshg5 = FFL.VarData("foxzhshg5")
vbzhshd5 = FFL.VarData("foxzhshd5")
vbzhshgg5 = FFL.VarData("foxzhshgg5")
vbzhshdd5 = FFL.VarData("foxzhshdd5")
vbzhsh15 = FFL.VarData("foxzhsh15")
vbzhshg15 = FFL.VarData("foxzhshg15")
vbzhshd15 = FFL.VarData("foxzhshd15")
vbzhshgg15 = FFL.VarData("foxzhshgg15")
vbzhshdd15 = FFL.VarData("foxzhshdd15")
vbzhsh30 = FFL.VarData("foxzhsh30")
vbzhshg30 = FFL.VarData("foxzhshg30")
vbzhshd30 = FFL.VarData("foxzhshd30")
vbzhshgg30 = FFL.VarData("foxzhshgg30")
vbzhshdd30 = FFL.VarData("foxzhshdd30")
vbzhsh60 = FFL.VarData("foxzhsh60")
vbzhshg60 = FFL.VarData("foxzhshg60")
vbzhshd60 = FFL.VarData("foxzhshd60")
vbzhshgg60 = FFL.VarData("foxzhshgg60")
vbzhshdd60 = FFL.VarData("foxzhshdd60")
vbzhshr = FFL.VarData("foxzhshr")
vbzhshgr = FFL.VarData("foxzhshgr")
vbzhshdr = FFL.VarData("foxzhshdr")
vbzhshggr = FFL.VarData("foxzhshggr")
vbzhshddr = FFL.VarData("foxzhshddr")
vbzhshz = FFL.VarData("foxzhshz")
vbzhshgz = FFL.VarData("foxzhshgz")
vbzhshdz = FFL.VarData("foxzhshdz")
vbzhshggz = FFL.VarData("foxzhshggz")
vbzhshddz = FFL.VarData("foxzhshddz")
vbzhshy = FFL.VarData("foxzhshy")
vbzhshgy = FFL.VarData("foxzhshgy")
vbzhshdy = FFL.VarData("foxzhshdy")
vbzhshggy = FFL.VarData("foxzhshggy")
vbzhshddy = FFL.VarData("foxzhshddy")
vbzhshn = FFL.VarData("foxzhshn")
vbzhshgn = FFL.VarData("foxzhshgn")
vbzhshdn = FFL.VarData("foxzhshdn")
vbzhshggn = FFL.VarData("foxzhshggn")
vbzhshddn = FFL.VarData("foxzhshddn")
vbzhshmm=FFL.VarData("foxzhshmm")
vbzhshmm5=FFL.VarData("foxzhshmm5")
vbzhshmm15=FFL.VarData("foxzhshmm15")
vbzhshmm30=FFL.VarData("foxzhshmm30")
vbzhshmm60=FFL.VarData("foxzhshmm60")
vbzhshmmr=FFL.VarData("foxzhshmmr")
vbzhshmmz=FFL.VarData("foxzhshmmz")
vbzhshmmy=FFL.VarData("foxzhshmmy")
vbzhshmmn=FFL.VarData("foxzhshmmn")
vbyanwei=FFL.Vardata("foxyanwei")
maxyanbi=FFL.VarData("datanumber4")
vbyanbicount=FFL.Vardata("foxyanbicount")
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笔构成级别扩展,上一级别中枢结束,新的本级别中枢开始
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
Do While ( vbxian(a) = 0 and a <= nlast)
a = a + 1
if (a = nlast) then
exit do
end if
Loop
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
'(8) 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
'(13)begin 延伸超过6笔构成级别扩展,计算上一级别(5分)中枢的中枢区间及波动区间,ygg,yzg,yzd,ydd已经计算
vbzhsh5(zhshbegin)=1
vbzhsh5(m)=2
end if
'(13)结束
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
'(8)结束
end if
'(6)结束
'else
'(5)else
'end if
'(5)结束
end if
'(3)结束
end if
'(2) 结束
NEXT
'(1)结束
if (zhshxing=1) then
vbzhsh(nlast)=2
vbzhshg(nlast)=zg
vbzhshd(nlast)=zd
vbzhshgg(nlast)=gg
vbzhshdd(nlast)=dd
end if
a=0
FOR m=0 TO nlast
if (vbzhsh5(m)>0) then
if (vbzhsh5(m)=2) then
if (a>0) then
vbzhsh5(a)=0
end if
a=m
else
a=0
end if
end if
next
a=0
ygg=0
ydd=0
FOR m=0 TO nlast
if (vbxian(m)<>0 ) then
'1 begin
if (vbzhsh(m)=1) then
'2 BEGIN
gg=vbzhshgg(m)
dd=vbzhshdd(m)
a=1
end if
'2 END
if (a=1) then
'3 BEGIN
if (vbxian(m)=1 ) then
if (vbxiang(m)=gg and ygg=0) then
vbzhshgg(m)=gg
ygg=1
end if
else
if (vbxiand(m)=dd and ydd=0) then
vbzhshdd(m)=dd
ydd=1
end if
end if
end if
'3 END
if (vbzhsh(m)=2) then
a=0
ygg=0
ydd=0
end if
end if
'1 end
next
'将本级别vbzhsh高高点和低低点的数据也计算出来,后面要用到
FOR m=0 TO nlast
'延伸成高级别中枢的情况应先分成三个连续的三段每段取最高点和最低点然后再按高点中的低者,低点中的高者的规则计算高级中枢的中枢区间及高高点和低低点
if (vbxian(m)<>0) then
if (vbzhsh5(m)=1) then
zhshbegin=m
x1=1
x2=0
x3=1000000
x4=0
x5=1000000
x6=0
x7=1000000
end if
if (x1>=1 ) then
x1=x1+1
if (x1<=3) then
x2=max(x2,vbxiang(m))
x3=min(x3,vbxiand(m))
else
if (x1<=6) then
x4=max(x4,vbxiang(m))
x5=min(x5,vbxiand(m))
else
x6=max(x6,vbxiang(m))
x7=min(x7,vbxiand(m))
end if
end if
if (vbzhsh5(m)=2) then
zg=min(x2,x4)
zg=min(zg,x6)
gg=max(x2,x4)
gg=max(gg,x6)
zd=max(x3,x5)
zd=max(zd,x7)
dd=min(x3,x5)
dd=min(dd,x7)
vbzhshg5(zhshbegin)=zg
vbzhshd5(zhshbegin)=zd
vbzhshgg5(zhshbegin)=gg
vbzhshdd5(zhshbegin)=dd
vbzhshg5(m)=zg
vbzhshd5(m)=zd
vbzhshgg5(m)=gg
vbzhshdd5(m)=dd
x1=0
end if
end if
end if
next
'计算5分即:本级中枢延伸柢成的上一级别中枢的数据
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("foxzhsh") = vbzhsh
FFL.VarData("foxzhshg") = vbzhshg
FFL.VarData("foxzhshd") = vbzhshd
FFL.VarData("foxzhshgg") = vbzhshgg
FFL.VarData("foxzhshdd") = vbzhshdd
FFL.VarData("foxzhsh5") = vbzhsh5
FFL.VarData("foxzhshg5") = vbzhshg5
FFL.VarData("foxzhshd5") = vbzhshd5
FFL.VarData("foxzhshgg5") = vbzhshgg5
FFL.VarData("foxzhshdd5") = vbzhshdd5
FFL.VarData("foxzhsh15") = vbzhsh15
FFL.VarData("foxzhshg15") = vbzhshg15
FFL.VarData("foxzhshd15") = vbzhshd15
FFL.VarData("foxzhshgg15") = vbzhshgg15
FFL.VarData("foxzhshdd15") = vbzhshdd15
FFL.VarData("foxzhsh30") = vbzhsh30
FFL.VarData("foxzhshg30") = vbzhshg30
FFL.VarData("foxzhshd30") = vbzhshd30
FFL.VarData("foxzhshgg30") = vbzhshgg30
FFL.VarData("foxzhshdd30") = vbzhshdd30
FFL.VarData("foxzhsh60") = vbzhsh60
FFL.VarData("foxzhshg60") = vbzhshg60
FFL.VarData("foxzhshd60") = vbzhshd60
FFL.VarData("foxzhshgg60") = vbzhshgg60
FFL.VarData("foxzhshdd60") = vbzhshdd60
FFL.VarData("foxzhshr") = vbzhshr
FFL.VarData("foxzhshgr") = vbzhshgr
FFL.VarData("foxzhshdr") = vbzhshdr
FFL.VarData("foxzhshggr") = vbzhshggr
FFL.VarData("foxzhshddr") = vbzhshddr
FFL.VarData("foxzhshz") = vbzhshz
FFL.VarData("foxzhshgz") = vbzhshgz
FFL.VarData("foxzhshdz") = vbzhshdz
FFL.VarData("foxzhshggz") = vbzhshggz
FFL.VarData("foxzhshddz") = vbzhshddz
FFL.VarData("foxzhshy") = vbzhshy
FFL.VarData("foxzhshgy") = vbzhshgy
FFL.VarData("foxzhshdy") = vbzhshdy
FFL.VarData("foxzhshggy") = vbzhshggy
FFL.VarData("foxzhshddy") = vbzhshddy
FFL.VarData("foxzhshn") = vbzhshn
FFL.VarData("foxzhshgn") = vbzhshgn
FFL.VarData("foxzhshdn") = vbzhshdn
FFL.VarData("foxzhshggn") = vbzhshggn
FFL.VarData("foxzhshddn") = vbzhshddn
FFL.VarData("foxzhshmm")= vbzhshmm
FFL.VarData("foxzhshmm5")= vbzhshmm5
FFL.VarData("foxzhshmm15")= vbzhshmm15
FFL.VarData("foxzhshmm30")= vbzhshmm30
FFL.VarData("foxzhshmm60")= vbzhshmm60
FFL.VarData("foxzhshmmr")= vbzhshmmr
FFL.VarData("foxzhshmmz")= vbzhshmmz
FFL.VarData("foxzhshmmy")= vbzhshmmy
FFL.VarData("foxzhshmmn")= vbzhshmmn
FFL.VarData("datanumber3") =maxbi
FFL.Vardata("foxyanwei")=vbyanwei
FFL.VarData("datanumber4") =maxyanbi
FFL.Vardata("foxyanbicount")=vbyanbicount
%>
DRAWLINE(FOXZHSH=1 AND FOXZHSHDD>0,FOXZHSHG,FOXZHSH=2,FOXZHSHG,0),colorFF;
DRAWLINE(FOXZHSH=1 AND FOXZHSHDD>0,FOXZHSHD,FOXZHSH=2,FOXZHSHD,0),colorFF;
STICKLINE(FOXZHSH=1 AND FOXZHSHDD>0,FOXZHSHDD,FOXZHSHGG,0,0),LINEDASHDOT,colorFF;
STICKLINE(FOXZHSH=2 AND FOXZHSHDD>0,FOXZHSHDD,FOXZHSHGG,0,0),LINEDASHDOT,colorFF;
DRAWTEXT(FOXZHSH=1 AND FOXZHSHDD>0,FOXZHSHG,'/n本/n级'),colorFF;
DRAWLINE(FOXZHSH=1 AND FOXZHSHDD>0,FOXZHSHGG,FOXZHSH=2,FOXZHSHGG,0),LINEDASHDOT,colorFF;
DRAWLINE(FOXZHSH=1 AND FOXZHSHDD>0,FOXZHSHDD,FOXZHSH=2,FOXZHSHDD,0),LINEDASHDOT,colorFF;
DRAWTEXT(FOXZHSHMM>=1 AND FOXZHSHDD>0,IF(FOXL<LOW,FOXL,LOW),'/n /n /n本/n级/n三/n买'),colorFF;
DRAWTEXT(FOXZHSHMM<=-1 AND FOXZHSHDD>0,IF(FOXH>HIGH,FOXH,HIGH),'/n /n /n本/n级/n三/n卖'),colorFFFF;
DRAWTEXT(FOXZHSHMM>=2 AND FOXZHSHDD>0,IF(FOXL<LOW,FOXL,LOW),' 本级二买'),colorFF;
DRAWTEXT(FOXZHSHMM<=-2 AND FOXZHSHDD>0,IF(FOXH>HIGH,FOXH,HIGH),' 本级二卖'),colorFFFF;
DRAWTEXT(FOXZHSHMM>=3 AND FOXZHSHDD>0,IF(FOXL<LOW,FOXL,LOW),' 本级一买'),colorFF;
DRAWTEXT(FOXZHSHMM<=-3 AND FOXZHSHDD>0,IF(FOXH>HIGH,FOXH,HIGH),' 本级一卖'),colorFFFF;
DRAWTEXT(FOXZHSHMM>=4 AND FOXZHSHDD>0,IF(FOXL<LOW,FOXL,LOW),' 本级00买'),colorFF;
DRAWTEXT(FOXZHSHMM<=-4 AND FOXZHSHDD>0,IF(FOXH>HIGH,FOXH,HIGH),' 本级00卖'),colorFFFF;
DRAWICON(FOXZHSHMM>=1 AND FOXZHSHDD>0,IF(FOXL<LOW,FOXL,LOW),1);
DRAWICON(FOXZHSHMM<=-1 AND FOXZHSHDD>0,IF(FOXH>HIGH,FOXH,HIGH),2),ALIGN2;
<%
vbquekou=FFL.VarData("foxquekou")
vbfennumber=FFL.VarData("foxfennumber")
vbh = FFL.VarData("foxh")
vbL = FFL.VarData("foxl")
vbh1 = FFL.VarData("foxh")
vbL1 = FFL.VarData("foxl")
vbbaohan = FFL.VarData("foxbaohan")
vbbaohan1 = FFL.VarData("foxbaohan1")
vbguanxi = FFL.VarData("foxguanxi")
vbfenxing = FFL.VarData("foxfenxing")
vbfenxing1 = FFL.VarData("foxfenxing1")
vbbuysell=FFL.VarData("foxbuysell")
vbwei=FFL.Vardata("foxwei")
vbxian=FFL.Vardata("foxxian")
vbxiang=FFL.Vardata("foxxiang")
vbxiand=FFL.Vardata("foxxiand")
vbzhsh = FFL.VarData("foxzhsh")
vbzhshg = FFL.VarData("foxzhshg")
vbzhshd = FFL.VarData("foxzhshd")
vbzhshgg = FFL.VarData("foxzhshgg")
vbzhshdd = FFL.VarData("foxzhshdd")
vbzhsh5 = FFL.VarData("foxzhsh5")
vbzhshg5 = FFL.VarData("foxzhshg5")
vbzhshd5 = FFL.VarData("foxzhshd5")
vbzhshgg5 = FFL.VarData("foxzhshgg5")
vbzhshdd5 = FFL.VarData("foxzhshdd5")
vbzhsh15 = FFL.VarData("foxzhsh15")
vbzhshg15 = FFL.VarData("foxzhshg15")
vbzhshd15 = FFL.VarData("foxzhshd15")
vbzhshgg15 = FFL.VarData("foxzhshgg15")
vbzhshdd15 = FFL.VarData("foxzhshdd15")
vbzhsh30 = FFL.VarData("foxzhsh30")
vbzhshg30 = FFL.VarData("foxzhshg30")
vbzhshd30 = FFL.VarData("foxzhshd30")
vbzhshgg30 = FFL.VarData("foxzhshgg30")
vbzhshdd30 = FFL.VarData("foxzhshdd30")
vbzhsh60 = FFL.VarData("foxzhsh60")
vbzhshg60 = FFL.VarData("foxzhshg60")
vbzhshd60 = FFL.VarData("foxzhshd60")
vbzhshgg60 = FFL.VarData("foxzhshgg60")
vbzhshdd60 = FFL.VarData("foxzhshdd60")
vbzhshr = FFL.VarData("foxzhshr")
vbzhshgr = FFL.VarData("foxzhshgr")
vbzhshdr = FFL.VarData("foxzhshdr")
vbzhshggr = FFL.VarData("foxzhshggr")
vbzhshddr = FFL.VarData("foxzhshddr")
vbzhshz = FFL.VarData("foxzhshz")
vbzhshgz = FFL.VarData("foxzhshgz")
vbzhshdz = FFL.VarData("foxzhshdz")
vbzhshggz = FFL.VarData("foxzhshggz")
vbzhshddz = FFL.VarData("foxzhshddz")
vbzhshy = FFL.VarData("foxzhshy")
vbzhshgy = FFL.VarData("foxzhshgy")
vbzhshdy = FFL.VarData("foxzhshdy")
vbzhshggy = FFL.VarData("foxzhshggy")
vbzhshddy = FFL.VarData("foxzhshddy")
vbzhshn = FFL.VarData("foxzhshn")
vbzhshgn = FFL.VarData("foxzhshgn")
vbzhshdn = FFL.VarData("foxzhshdn")
vbzhshggn = FFL.VarData("foxzhshggn")
vbzhshddn = FFL.VarData("foxzhshddn")
vbzhshmm=FFL.VarData("foxzhshmm")
vbzhshmm5=FFL.VarData("foxzhshmm5")
vbzhshmm15=FFL.VarData("foxzhshmm15")
vbzhshmm30=FFL.VarData("foxzhshmm30")
vbzhshmm60=FFL.VarData("foxzhshmm60")
vbzhshmmr=FFL.VarData("foxzhshmmr")
vbzhshmmz=FFL.VarData("foxzhshmmz")
vbzhshmmy=FFL.VarData("foxzhshmmy")
vbzhshmmn=FFL.VarData("foxzhshmmn")
vbyanwei=FFL.Vardata("foxyanwei")
maxyanbi=FFL.VarData("datanumber4")
vbyanbicount=FFL.Vardata("foxyanbicount")
nlast = UBound( vbh )
foxbicount=0
x1=0
x2=0
x3=0
x4=0
x5=0
x6=0
x7=0
'先取三个分型数据,然后进入循环处理
'要逐分型判断,取第一个1分中枢的高高和低低位置及信息,zhshxingci为次级别中枢形成标志,qushi为次级别趋势标志0为无趋势1为上上升-1为下降
a=0
x0=0
zhshhoubi=0
zhshxing=0
zhshbegin=0
zhshend=0
yanshen=0
yanshenbi=0
qushi=0
zhshbeginci=0
zhshendci=0
zhshbeginci1=0
zhshendci1=0
'找第一个1分中枢,找到后检查1分中枢开始位置是否也是5分中枢的开始位置(指是不是1分延伸出的5分,程序中对延伸的处理使用得延伸出的高级别中枢与次级别中枢在同一位置开始,结束位置不一样)
FOR a=a TO nlast
if (vbxian(a)<>0) then
'(a)是分型时处理
if (zhshxing=0) then
'(b)是否已形成了5分中枢
if (zhshbeginci=0) then
'(c)是否已形成了1分中枢
if (vbzhsh(a) = 1) then
'(d)是1分中枢开始位置;以1分中枢的数据为基础形成5分的中枢数据,要先判断1分的数据
if (vbzhsh5(a) = 1) then
'(e)是5分中枢开始位置
zhshxing=1
zhshbegin=a
zhshbeginci=0
zhshendci=0
yanshen=0
yanshenbi=0
qushi=0
zhshbeginci=0
zhshendci=0
zhshbeginci1=0
zhshendci1=0
zg=vbzhshg5(zhshbegin)
gg=vbzhshgg5(zhshbegin)
zd=vbzhshd5(zhshbegin)
dd=vbzhshdd5(zhshbegin)
else
'(e)
zhshxing=0
zhshbegin=a
zhshbeginci=a
ygg=vbzhshgg(zhshbeginci)
ydd=vbzhshdd(zhshbeginci)
end if
'(e)
end if
'(d)
else
'(c)
if (vbxian(a)=1 and vbxiang(a)=ygg ) then
x1=a
end if
if (vbxian(a)=-1 and vbxiand(a)=ydd ) then
x2=a
end if
if (vbzhsh(a) = 2) then
zhshendci=a
exit for
end if
end if
'(c)
else
'(b)
if (vbzhsh5(a) = 2) then
zhshend=a
exit for
end if
end if
'(b)
end if
'(a)
next
a=a+1
FOR m=a TO nlast
'(1)开始,此时m为第1个1分或第1个5分中枢结束位置加上1,zhshxing=1为5分0为1分,其下一个分型有可能为5分开始或1分开始或只是一笔三种情况
if ( vbxian(m)<>0 ) then
'(2)开始 分型时处理,先判断是不是5分中枢再判断是不是1分中枢最后才是是不是笔
if (vbzhsh5(m)=1 ) then
'(3)开始 是5分中枢开始,不论上一个m位置是1分5分还是单独的一笔均结束要取新5分的数据后返回,要判断此时zhshxing的值为1时要结束上一个5分中枢
if (zhshxing=1) then
vbzhsh5(zhshbegin)=1
vbzhsh5(zhshend)=2
vbzhshg5(zhshbegin)=zg
vbzhshgg5(zhshbegin)=gg
vbzhshd5(zhshbegin)=zd
vbzhshdd5(zhshbegin)=dd
vbzhshg5(zhshend)=zg
vbzhshgg5(zhshend)=gg
vbzhshd5(zhshend)=zd
vbzhshdd5(zhshend)=dd
end if
zhshxing=1
zhshbegin=m
qushi=0
a=m
if (a <= nlast) then
Do While ( vbzhsh5(a) < 2 and a <= nlast)
a = a + 1
if (a = nlast) then
exit do
end if
Loop
end if
zhshend=a
'5分中枢结束位置为zhshend,开始位置为zhshbegin即x0(值为当下m)
zg=vbzhshg5(zhshbegin)
gg=vbzhshgg5(zhshbegin)
zd=vbzhshd5(zhshbegin)
dd=vbzhshdd5(zhshbegin)
m = a + 1
else
'(3)else 不是5分中枢开始判断是否为1分的开始
if (vbzhsh(m)=1 ) then
'(4)开始 是1分中枢开始,要先取新1分的数据,要据zhshxing的值判断是否已有5分还1分中枢存在,已有1分高高点及低低点位置保存在x1,x2中,5分开始位置置为当下M
if (zhshbegin=0) then
'zhshbegin=m
end if
FOR a=m TO nlast
if (vbxian(a)<>0) then
if (vbzhsh(a) = 1) then
zhshbeginci1=a
ygg1=vbzhshgg(zhshbeginci1)
ydd1=vbzhshdd(zhshbeginci1)
end if
if (vbxian(a)=1 and vbxiang(a)=ygg1 ) then
x3=a
end if
if (vbxian(a)=-1 and vbxiand(a)=ydd1 ) then
x4=a
end if
if (vbzhsh(a) = 2) then
zhshendci1=a
exit for
end if
end if
next
'此时a为1分中枢结束位置,开始位置此时只记录了第一个1分中枢的高高点和低低点即: x3和x4它们是构成5分中枢的点位
a = a + 1
m=a
if (zhshxing=0) then
'(0)开始 无5分即有1分存在,有1分存在(不是5分延伸后的1分要是5分破坏后的1分)要判断是构成1分的趋势还是1分的振荡,若是1分的振荡就构成了5分中枢,要计算新5分数据并返回
'先取本1分的高高点低低点,还要判断是否构成二类买卖点应取高高点低低点的位置保存到x3,x4
if (ygg<ydd1) then
qushi1=1
else
if (ydd>ygg1) then
qushi1=-1
else
qushi1=0
end if
end if
if (qushi1<>0 ) then
zhshendci=zhshendci1
zhshbeginci=zhshbeginci1
ygg=ygg1
ydd=ydd1
if ( qushi<>qushi1 and qushi<>0 ) then
'1分趋势被破坏形成5分中枢,记录位置及信息并返回,形成1分的1类买卖点要记录并区分出类型,上升趋势被破坏形成1类卖点,下降趋势被破坏形成1类买点,1类买卖点要滞后与教材相反,要在趋势被破坏后才能判断出来;
zhshxing=1
'zhshbegin=zhshbeginci
qushi=0
zhshend=zhshendci1
'5分中枢结束位置为zhshendci1
vbzhsh5(zhshbegin)=1
vbzhsh5(zhshend)=2
zg=min(ygg,ygg1)
gg=max(ygg,ygg1)
zd=max(ydd,ydd1)
dd=min(ydd,ydd1)
vbzhshg5(zhshbegin)=zg
vbzhshgg5(zhshbegin)=gg
vbzhshd5(zhshbegin)=zd
vbzhshdd5(zhshbegin)=dd
vbzhshg5(zhshend)=zg
vbzhshgg5(zhshend)=gg
vbzhshd5(zhshend)=zd
vbzhshdd5(zhshend)=dd
if (qushi=1) then
if (ydd=dd) then
vbzhshmm5(x2)=3
else
vbzhshmm5(x4)=3
end if
else
if (ygg=gg) then
vbzhshmm5(x1)=-3
else
vbzhshmm5(x3)=-3
end if
end if
qushi=0
else
' 1分趋势未破坏没有形成5分中枢,将ygg换成ygg1的值
ygg=ygg1
ydd=ydd1
zhshbeginci=zhshbeginci1
zhshendci=zhshendci1
x3=x1
x4=x2
end if
else
if (qushi1<>0) then
'形成趋势
qushi=qushi1
zhshendci=zhshendci1
zhshbeginci=zhshbeginci1
else
'趋势为0,即是形成了高级中枢要记录并返回
zhshxing=1
'zhshbegin=zhshbeginci
qushi=0
zhshend=zhshendci1
'5分中枢结束位置为zhshendci1,开始位置为zhshbeginc1
vbzhsh5(zhshbegin)=1
vbzhsh5(zhshend)=2
zg=min(ygg,ygg1)
gg=max(ygg,ygg1)
zd=max(ydd,ydd1)
dd=min(ydd,ydd1)
vbzhshg5(zhshbegin)=zg
vbzhshgg5(zhshbegin)=gg
vbzhshd5(zhshbegin)=zd
vbzhshdd5(zhshbegin)=dd
vbzhshg5(zhshend)=zg
vbzhshgg5(zhshend)=gg
vbzhshd5(zhshend)=zd
vbzhshdd5(zhshend)=dd
m = a
end if
end if
else
'(0)else 有5分存在要判断是否枢成5分的延伸,还是5分中枢的破坏,5分中枢的破坏就构成二类买卖点,二类买卖点是一分中枢的高高或低低点若此点也是三类买卖点,则二/三类买卖点重合,要特别注意
'5分中枢破坏的标准为:5分中枢后的1分中枢的高高点或低低点不回到5分内即:不是延伸就是破坏 ,为与教材一致此处仍分单数与双数进行处理并要处理延伸的数量不超过6为5分中枢等于6即形成15分中枢要返回处理
'要先取1分中枢的高高点和低低点的位置及数值
if (zhshxing=1) then
zhshhoubi=zhshhoubi+1
end if
'if (zhshhoubi Mod 2 =1) then
'(5)begin中枢后的单数笔要判断中枢否结束,中枢结束的标志是中枢后的单数笔不回到中枢区间内(可能是震荡或趋势).此处与教材不同,比教材要早确认一个分型
if (ygg1<zd or ydd1>zg ) then
'(7) begin 未回到5分中枢内,判断条件为1分的低低点大于5分的高点或1分的高高点小于5分的低点
',应标记出来,同时5分中枢结束新5分中枢开始,老5分中枢在zhshend处结束,新5分中枢在zhshbeginci1处开始在zhshendci1处结束
'此时要判断买卖点,若1分低低点大于5分高点则1分低低点为5分二买,若1分高高点小于5分低点则1分高高点为5分二卖
if (ygg1<zd ) then
vbzhshmm5(x4)=2
else
vbzhshmm5(x3)=-2
end if
yanshen=0
yanshenbi=0
zhshxing=0
vbzhsh5(zhshend)=2
vbzhshg5(zhshend)=zg
vbzhshd5(zhshend)=zd
vbzhshgg5(zhshend)=gg
vbzhshdd5(zhshend)=dd
vbzhsh5(zhshbegin)=1
vbzhshg5(zhshbegin)=zg
vbzhshd5(zhshbegin)=zd
vbzhshgg5(zhshbegin)=gg
vbzhshdd5(zhshbegin)=dd
zhshend=zhshendci1
zhshbegin=zhshbeginci1
ygg=ygg1
ydd=ydd1
zhshbeginci=zhshbeginci1
zhshendci=zhshendci1
x1=x3
x2=x4
'取下一个1分或5分中枢的位置
zhshhoubi=0
zhshxing=0
'zhshbegin=0
'zhshend=0
yanshen=0
yanshenbi=0
qushi=0
'zhshbeginci=0
'zhshendci=0
zhshbeginci1=0
zhshendci1=0
a=a+1
m=a
else
'(7) else 单数笔回到中枢区间内,不形成买卖点,要记录下来,5分中枢结束标志zhshend更新为zhshendci1
yanshen=1
yanshenbi=yanshenbi+1
maxyanbi=max(maxyanbi,yanshenbi)
'vbyanwei(m)=m
'vbyanbicount(m)=yanshenbi
zhshend=zhshendci1
if (yanshenbi<6) then
vbzhsh5(zhshend)=2
vbzhshg5(zhshend)=zg
vbzhshd5(zhshend)=zd
vbzhshgg5(zhshend)=gg
vbzhshdd5(zhshend)=dd
else
'延伸超过6笔构成级别扩展,上一级别中枢结束,新的本级别中枢开始
yanshen=0
yanshenbi=0
zhshxing=0
vbzhsh5(zhshend)=2
vbzhsh5(zhshbegin)=1
vbzhshg5(zhshend)=zg
vbzhshd5(zhshend)=zd
vbzhshgg5(zhshend)=gg
vbzhshdd5(zhshend)=dd
vbzhshg5(zhshbegin)=zg
vbzhshd5(zhshbegin)=zd
vbzhshgg5(zhshbegin)=gg
vbzhshdd5(zhshbegin)=dd
vbzhsh15(zhshendci1)=2
vbzhsh15(zhshbegin)=1
zhshhoubi=0
'取下一个1分或5分中枢的位置
zhshhoubi=0
zhshxing=0
zhshbegin=0
zhshend=0
yanshen=0
yanshenbi=0
qushi=0
zhshbeginci=0
zhshendci=0
zhshbeginci1=0
zhshendci1=0
'找第一个1分中枢,找到后检查1分中枢开始位置是否也是5分中枢的开始位置(指是不是1分延伸出的5分,程序中对延伸的处理使用得延伸出的高级别中枢与次级别中枢在同一位置开始,结束位置不一样)
FOR a=m TO nlast
if (vbxian(a)<>0) then
'(a)是分型时处理
if (zhshxing=0) then
'(b)是否已形成了5分中枢
if (zhshbeginci=0) then
'(c)是否已形成了1分中枢
if (vbzhsh(a) = 1) then
'(d)是1分中枢开始位置;以1分中枢的数据为基础形成5分的中枢数据,要先判断1分的数据
if (vbzhsh5(a) = 1) then
'(e)是5分中枢开始位置
zhshxing=1
zhshbegin=a
zhshbeginci=0
zhshendci=0
yanshen=0
yanshenbi=0
qushi=0
zhshbeginci=0
zhshendci=0
zhshbeginci1=0
zhshendci1=0
zg=vbzhshg5(zhshbegin)
gg=vbzhshgg5(zhshbegin)
zd=vbzhshd5(zhshbegin)
dd=vbzhshdd5(zhshbegin)
else
'(e)
zhshxing=0
zhshbegin=a
zhshbeginci=a
ygg=vbzhshgg(zhshbeginci)
ydd=vbzhshdd(zhshbeginci)
end if
'(e)
end if
'(d)
else
'(c)
if (vbxian(a)=1 and vbxiang(a)=ygg ) then
x1=a
end if
if (vbxian(a)=-1 and vbxiand(a)=ydd ) then
x2=a
end if
if (vbzhsh(a) = 2) then
zhshendci=a
exit for
end if
end if
'(c)
else
'(b)
if (vbzhsh5(a) = 2) then
zhshend=a
exit for
end if
end if
'(b)
end if
'(a)
next
a=a+1
m=a
end if
end if
'(7)结束
'else
'(5)else中枢后的双数笔要判断中枢否结束,中枢结束的标志是中枢后的双数笔不回到中枢区间内(可能是震荡或趋势),中枢后的双数笔回到中枢区间内则为中枢延伸
'双数笔回到波动区间内则为中枢振荡,不回中枢区间也不回到波动区间则要看下面走势的发展若其后走势仍不回到波动区间则构成趋势,若其后走势回到波动区间是中枢振荡.
'此处与教材一致 ,新中枢自当下M的分型开始,原中枢自zhshend(上一个M)处结束
'end if
'(5)结束
end if
'(0)结束
else
'(4)else 是单独的一笔,此种情况出现在两个1分中枢间以两笔或两笔以上连接的情况,此时要判断是不是1分的趋势若是趋势则此点为第一类买卖点,若与其它买卖点重合则相当重要
if (qushi=1) then
'() begin ,vbzhshmm5(m)的值为1,-1为五分的三类买卖点,为2,-2为五分的二类买卖点,为3,-3为五分的一类买卖点,
'为4,-4为五分的零类买卖点,它是在趋势后又创新高或创新低(不完全是)的笔的端点,创新高或创新低的判断标准再考虑
if (vbxian(m)=1) then
if (vbxiangg(m)>gg) then
vbzhshmm5(m)=4
end if
else
if (vbxiandd(m)<dd) then
vbzhshmm5(m)=-4
end if
end if
else
'() else不是趋势返回
end if
'() 结束
end if
'(4)结束
end if
'(3)结束
end if
'(2)结束
next
'(1)结束
if (zhshxing=1) then
vbzhsh5(nlast)=2
vbzhshg5(nlast)=zg
vbzhshd5(nlast)=zd
vbzhshgg5(nlast)=gg
vbzhshdd5(nlast)=dd
end if
a=0
FOR m=0 TO nlast
if (vbzhsh5(m)>0) then
if (vbzhsh5(m)=2) then
if (a>0) then
vbzhsh5(a)=0
end if
a=m
else
a=0
end if
end if
next
a=0
ygg=0
ydd=0
FOR m=0 TO nlast
if (vbxian(m)<>0 ) then
'1 begin
if (vbzhsh5(m)=1) then
'2 BEGIN
gg=vbzhshgg5(m)
dd=vbzhshdd5(m)
a=1
end if
'2 END
if (a=1) then
'3 BEGIN
if (vbxian(m)=1 ) then
if (vbxiang(m)=gg and ygg=0) then
vbzhshgg5(m)=gg
ygg=1
end if
else
if (vbxiand(m)=dd and ydd=0) then
vbzhshdd5(m)=dd
ydd=1
end if
end if
end if
'3 END
if (vbzhsh5(m)=2) then
a=0
ygg=0
ydd=0
end if
end if
'1 end
next
vbzhsh5(0)=0
'将本级别vbzhsh5高高点和低低点的数据也计算出来,后面要用到
FOR m=0 TO nlast
'延伸成高级别中枢的情况应先分成三个连续的三段每段取最高点和最低点然后再按高点中的低者,低点中的高者的规则计算高级中枢的中枢区间及高高点和低低点
if (vbxian(m)<>0) then
if (vbzhsh15(m)=1) then
zhshbegin=m
x1=1
x2=0
x3=1000000
x4=0
x5=1000000
x6=0
x7=1000000
end if
if (x1>=1 ) then
x1=x1+1
if (x1<=3) then
x2=max(x2,vbxiang(m))
x3=min(x3,vbxiand(m))
else
if (x1<=6) then
x4=max(x4,vbxiang(m))
x5=min(x5,vbxiand(m))
else
x6=max(x6,vbxiang(m))
x7=min(x7,vbxiand(m))
end if
end if
if (vbzhsh15(m)=2) then
zg=min(x2,x4)
zg=min(zg,x6)
gg=max(x2,x4)
gg=max(gg,x6)
zd=max(x3,x5)
zd=max(zd,x7)
dd=min(x3,x5)
dd=min(dd,x7)
vbzhshg15(zhshbegin)=zg
vbzhshd15(zhshbegin)=zd
vbzhshgg15(zhshbegin)=gg
vbzhshdd15(zhshbegin)=dd
vbzhshg15(m)=zg
vbzhshd15(m)=zd
vbzhshgg15(m)=gg
vbzhshdd15(m)=dd
x1=0
end if
end if
end if
next
'计算5分即:本级中枢延伸柢成的上一级别中枢(15分中枢)的数据
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("foxzhsh") = vbzhsh
FFL.VarData("foxzhshg") = vbzhshg
FFL.VarData("foxzhshd") = vbzhshd
FFL.VarData("foxzhshgg") = vbzhshgg
FFL.VarData("foxzhshdd") = vbzhshdd
FFL.VarData("foxzhsh5") = vbzhsh5
FFL.VarData("foxzhshg5") = vbzhshg5
FFL.VarData("foxzhshd5") = vbzhshd5
FFL.VarData("foxzhshgg5") = vbzhshgg5
FFL.VarData("foxzhshdd5") = vbzhshdd5
FFL.VarData("foxzhsh15") = vbzhsh15
FFL.VarData("foxzhshg15") = vbzhshg15
FFL.VarData("foxzhshd15") = vbzhshd15
FFL.VarData("foxzhshgg15") = vbzhshgg15
FFL.VarData("foxzhshdd15") = vbzhshdd15
FFL.VarData("foxzhsh30") = vbzhsh30
FFL.VarData("foxzhshg30") = vbzhshg30
FFL.VarData("foxzhshd30") = vbzhshd30
FFL.VarData("foxzhshgg30") = vbzhshgg30
FFL.VarData("foxzhshdd30") = vbzhshdd30
FFL.VarData("foxzhsh60") = vbzhsh60
FFL.VarData("foxzhshg60") = vbzhshg60
FFL.VarData("foxzhshd60") = vbzhshd60
FFL.VarData("foxzhshgg60") = vbzhshgg60
FFL.VarData("foxzhshdd60") = vbzhshdd60
FFL.VarData("foxzhshr") = vbzhshr
FFL.VarData("foxzhshgr") = vbzhshgr
FFL.VarData("foxzhshdr") = vbzhshdr
FFL.VarData("foxzhshggr") = vbzhshggr
FFL.VarData("foxzhshddr") = vbzhshddr
FFL.VarData("foxzhshz") = vbzhshz
FFL.VarData("foxzhshgz") = vbzhshgz
FFL.VarData("foxzhshdz") = vbzhshdz
FFL.VarData("foxzhshggz") = vbzhshggz
FFL.VarData("foxzhshddz") = vbzhshddz
FFL.VarData("foxzhshy") = vbzhshy
FFL.VarData("foxzhshgy") = vbzhshgy
FFL.VarData("foxzhshdy") = vbzhshdy
FFL.VarData("foxzhshggy") = vbzhshggy
FFL.VarData("foxzhshddy") = vbzhshddy
FFL.VarData("foxzhshn") = vbzhshn
FFL.VarData("foxzhshgn") = vbzhshgn
FFL.VarData("foxzhshdn") = vbzhshdn
FFL.VarData("foxzhshggn") = vbzhshggn
FFL.VarData("foxzhshddn") = vbzhshddn
FFL.VarData("foxzhshmm")= vbzhshmm
FFL.VarData("foxzhshmm5")= vbzhshmm5
FFL.VarData("foxzhshmm15")= vbzhshmm15
FFL.VarData("foxzhshmm30")= vbzhshmm30
FFL.VarData("foxzhshmm60")= vbzhshmm60
FFL.VarData("foxzhshmmr")= vbzhshmmr
FFL.VarData("foxzhshmmz")= vbzhshmmz
FFL.VarData("foxzhshmmy")= vbzhshmmy
FFL.VarData("foxzhshmmn")= vbzhshmmn
FFL.VarData("datanumber3") =maxbi
FFL.Vardata("foxyanwei")=vbyanwei
FFL.VarData("datanumber4") =maxyanbi
FFL.Vardata("foxyanbicount")=vbyanbicount
%>
DRAWTEXT(FOXZHSH5=1 AND FOXZHSHDD5>0,FOXZHSHGG5,'/n上/n级'),colorFFFFFF;
DRAWICON(FOXZHSHMM5>=1 AND FOXZHSHDD5>0,IF(FOXL<LOW,FOXL,LOW),1);
DRAWICON(FOXZHSHMM5<=-1 AND FOXZHSHDD5>0,IF(FOXH>HIGH,FOXH,HIGH),2),ALIGN2;
DRAWTEXT(FOXZHSHMM5>=1 AND FOXZHSHDD5>0,IF(FOXL<LOW,FOXL,LOW),' 上级三买'),colorFFFFFF;
DRAWTEXT(FOXZHSHMM5<=-1 AND FOXZHSHDD5>0,IF(FOXH>HIGH,FOXH,HIGH),' 上级三卖'),colorFFFFFF;
DRAWTEXT(FOXZHSHMM5>=2 AND FOXZHSHDD5>0,IF(FOXL<LOW,FOXL,LOW),' 上级二买'),colorFFFFFF;
DRAWTEXT(FOXZHSHMM5<=-2 AND FOXZHSHDD5>0,IF(FOXH>HIGH,FOXH,HIGH),' 上级二卖'),colorFFFFFF;
DRAWTEXT(FOXZHSHMM5>=3 AND FOXZHSHDD5>0,IF(FOXL<LOW,FOXL,LOW),' 上级一买'),colorFFFFFF;
DRAWTEXT(FOXZHSHMM5<=-3 AND FOXZHSHDD5>0,IF(FOXH>HIGH,FOXH,HIGH),' 上级一卖'),colorFFFFFF;
DRAWTEXT(FOXZHSHMM5>=4 AND FOXZHSHDD5>0,IF(FOXL<LOW,FOXL,LOW),' 上级00买'),colorFFFFFF;
DRAWTEXT(FOXZHSHMM5<=-4 AND FOXZHSHDD5>0,IF(FOXH>HIGH,FOXH,HIGH),' 上级00卖'),colorFFFFFF;
<%
vbquekou=FFL.VarData("foxquekou")
vbfennumber=FFL.VarData("foxfennumber")
vbh = FFL.VarData("foxh")
vbL = FFL.VarData("foxl")
vbh1 = FFL.VarData("foxh")
vbL1 = FFL.VarData("foxl")
vbbaohan = FFL.VarData("foxbaohan")
vbbaohan1 = FFL.VarData("foxbaohan1")
vbguanxi = FFL.VarData("foxguanxi")
vbfenxing = FFL.VarData("foxfenxing")
vbfenxing1 = FFL.VarData("foxfenxing1")
vbbuysell=FFL.VarData("foxbuysell")
vbwei=FFL.Vardata("foxwei")
vbxian=FFL.Vardata("foxxian")
vbxiang=FFL.Vardata("foxxiang")
vbxiand=FFL.Vardata("foxxiand")
vbzhsh = FFL.VarData("foxzhsh")
vbzhshg = FFL.VarData("foxzhshg")
vbzhshd = FFL.VarData("foxzhshd")
vbzhshgg = FFL.VarData("foxzhshgg")
vbzhshdd = FFL.VarData("foxzhshdd")
vbzhsh5 = FFL.VarData("foxzhsh5")
vbzhshg5 = FFL.VarData("foxzhshg5")
vbzhshd5 = FFL.VarData("foxzhshd5")
vbzhshgg5 = FFL.VarData("foxzhshgg5")
vbzhshdd5 = FFL.VarData("foxzhshdd5")
vbzhsh15 = FFL.VarData("foxzhsh15")
vbzhshg15 = FFL.VarData("foxzhshg15")
vbzhshd15 = FFL.VarData("foxzhshd15")
vbzhshgg15 = FFL.VarData("foxzhshgg15")
vbzhshdd15 = FFL.VarData("foxzhshdd15")
vbzhsh30 = FFL.VarData("foxzhsh30")
vbzhshg30 = FFL.VarData("foxzhshg30")
vbzhshd30 = FFL.VarData("foxzhshd30")
vbzhshgg30 = FFL.VarData("foxzhshgg30")
vbzhshdd30 = FFL.VarData("foxzhshdd30")
vbzhsh60 = FFL.VarData("foxzhsh60")
vbzhshg60 = FFL.VarData("foxzhshg60")
vbzhshd60 = FFL.VarData("foxzhshd60")
vbzhshgg60 = FFL.VarData("foxzhshgg60")
vbzhshdd60 = FFL.VarData("foxzhshdd60")
vbzhshr = FFL.VarData("foxzhshr")
vbzhshgr = FFL.VarData("foxzhshgr")
vbzhshdr = FFL.VarData("foxzhshdr")
vbzhshggr = FFL.VarData("foxzhshggr")
vbzhshddr = FFL.VarData("foxzhshddr")
vbzhshz = FFL.VarData("foxzhshz")
vbzhshgz = FFL.VarData("foxzhshgz")
vbzhshdz = FFL.VarData("foxzhshdz")
vbzhshggz = FFL.VarData("foxzhshggz")
vbzhshddz = FFL.VarData("foxzhshddz")
vbzhshy = FFL.VarData("foxzhshy")
vbzhshgy = FFL.VarData("foxzhshgy")
vbzhshdy = FFL.VarData("foxzhshdy")
vbzhshggy = FFL.VarData("foxzhshggy")
vbzhshddy = FFL.VarData("foxzhshddy")
vbzhshn = FFL.VarData("foxzhshn")
vbzhshgn = FFL.VarData("foxzhshgn")
vbzhshdn = FFL.VarData("foxzhshdn")
vbzhshggn = FFL.VarData("foxzhshggn")
vbzhshddn = FFL.VarData("foxzhshddn")
vbzhshmm=FFL.VarData("foxzhshmm")
vbzhshmm5=FFL.VarData("foxzhshmm5")
vbzhshmm15=FFL.VarData("foxzhshmm15")
vbzhshmm30=FFL.VarData("foxzhshmm30")
vbzhshmm60=FFL.VarData("foxzhshmm60")
vbzhshmmr=FFL.VarData("foxzhshmmr")
vbzhshmmz=FFL.VarData("foxzhshmmz")
vbzhshmmy=FFL.VarData("foxzhshmmy")
vbzhshmmn=FFL.VarData("foxzhshmmn")
vbyanwei=FFL.Vardata("foxyanwei")
maxyanbi=FFL.VarData("datanumber4")
vbyanbicount=FFL.Vardata("foxyanbicount")
nlast = UBound( vbh )
foxbicount=0
x1=0
x2=0
x3=0
x4=0
x5=0
x6=0
x7=0
'先取三个分型数据,然后进入循环处理
'要逐分型判断,取第一个5分中枢的高高和低低位置及信息,zhshxingci为次级别中枢形成标志,qushi为次级别趋势标志0为无趋势1为上上升-1为下降
a=0
x0=0
zhshhoubi=0
zhshxing=0
zhshbegin=0
zhshend=0
yanshen=0
yanshenbi=0
qushi=0
zhshbeginci=0
zhshendci=0
zhshbeginci1=0
zhshendci1=0
'找第一个5分中枢,找到后检查5分中枢开始位置是否也是15分中枢的开始位置(指是不是15分延伸出的5分,程序中对延伸的处理使用得延伸出的高级别中枢与次级别中枢在同一位置开始,结束位置不一样)
FOR a=a TO nlast
if (vbxian(a)<>0) then
'(a)是分型时处理
if (zhshxing=0) then
'(b)是否已形成了15分中枢
if (zhshbeginci=0) then
'(c)是否已形成了5分中枢
if (vbzhsh5(a) = 1) then
'(d)是5分中枢开始位置;以5分中枢的数据为基础形成5分的中枢数据,要先判断5分的数据
if (vbzhsh15(a) = 1) then
'(e)同时也是15分中枢开始位置
zhshxing=1
zhshbegin=a
zhshbeginci=0
zhshendci=0
yanshen=0
yanshenbi=0
qushi=0
zhshbeginci=0
zhshendci=0
zhshbeginci1=0
zhshendci1=0
zg=vbzhshg15(zhshbegin)
gg=vbzhshgg15(zhshbegin)
zd=vbzhshd15(zhshbegin)
dd=vbzhshdd15(zhshbegin)
else
'(e)
zhshxing=0
zhshbegin=a
zhshbeginci=a
ygg=vbzhshgg15(zhshbeginci)
ydd=vbzhshdd15(zhshbeginci)
end if
'(e)
end if
'(d)
else
'(c)
if (vbxian(a)=1 and vbxiang(a)=ygg ) then
x1=a
end if
if (vbxian(a)=-1 and vbxiand(a)=ydd ) then
x2=a
end if
if (vbzhsh5(a) = 2) then
zhshendci=a
exit for
end if
end if
'(c)
else
'(b)
if (vbzhsh15(a) = 2) then
zhshend=a
exit for
end if
end if
'(b)
end if
'(a)
next
a=a+1
FOR m=a TO nlast
'(1)开始,此时m为第1个5分或第1个15分中枢结束位置加上1,zhshxing=1为15分0为5分,其下一个分型有可能为15分开始或5分开始或只是5分以下三种情况
if ( vbxian(m)<>0 ) then
'(2)开始 分型时处理,先判断是不是15分中枢再判断是不是5分中枢最后才是是不是5分以下三种
if (vbzhsh15(m)=1 ) then
'(3)开始 是5分中枢开始,不论上一个m位置是15分5分还是单独的一笔均结束要取新5分的数据后返回,要判断此时zhshxing的值为1时要结束上一个15分中枢
if (zhshxing=1) then
vbzhsh15(zhshbegin)=1
vbzhsh15(zhshend)=2
vbzhshg15(zhshbegin)=zg
vbzhshgg15(zhshbegin)=gg
vbzhshd15(zhshbegin)=zd
vbzhshdd15(zhshbegin)=dd
vbzhshg15(zhshend)=zg
vbzhshgg15(zhshend)=gg
vbzhshd15(zhshend)=zd
vbzhshdd15(zhshend)=dd
end if
zhshxing=1
zhshbegin=m
qushi=0
a=m
'if (a <= nlast) then
'Do While ( vbzhsh15(a) < 2 and a <= nlast)
'a = a + 1
'if (a = nlast) then
'exit do
'end if
'Loop
'end if
Do While (a < nlast)
if (vbzhsh15(a) = 2 ) then
exit do
end if
a = a + 1
Loop
zhshend=a
'5分中枢结束位置为zhshend,开始位置为zhshbegin即x0(值为当下m)
zg=vbzhshg15(zhshbegin)
gg=vbzhshgg15(zhshbegin)
zd=vbzhshd15(zhshbegin)
dd=vbzhshdd15(zhshbegin)
m = a + 1
else
'(3)else 不是15分中枢开始判断是否为5分的开始
if (vbzhsh5(m)=1 ) then
'(4)开始 是5分中枢开始,要先取新5分的数据,要据zhshxing的值判断是否已有15分还5分中枢存在,已有5分高高点及低低点位置保存在x1,x2中,5分开始位置置为当下M
if (zhshbegin=0) then
'zhshbegin=m
end if
FOR a=m TO nlast
if (vbxian(a)<>0) then
if (vbzhsh5(a) = 1) then
zhshbeginci1=a
ygg1=vbzhshgg5(zhshbeginci1)
ydd1=vbzhshdd5(zhshbeginci1)
end if
if (vbxian(a)=1 and vbxiang(a)=ygg1 ) then
x3=a
end if
if (vbxian(a)=-1 and vbxiand(a)=ydd1 ) then
x4=a
end if
if (vbzhsh5(a) = 2) then
zhshendci1=a
exit for
end if
end if
next
'此时a为5分中枢结束位置,开始位置此时只记录了第一个5分中枢的高高点和低低点即: x3和x4它们是构成5分中枢的点位
a = a + 1
m=a
if (zhshxing=0) then
'(0)开始 无15分即有5分存在,有5分存在(不是15分延伸后的5分要是15分破坏后的5分)要判断是构成5分的趋势还是5分的振荡,若是5分的振荡就构成了5分中枢,要计算新5分数据并返回
'先取本5分的高高点低低点,还要判断是否构成二类买卖点应取高高点低低点的位置保存到x3,x4
if (ygg<ydd1) then
qushi1=1
else
if (ydd>ygg1) then
qushi1=-1
else
qushi1=0
end if
end if
if (qushi1<>0 ) then
zhshendci=zhshendci1
zhshbeginci=zhshbeginci1
ygg=ygg1
ydd=ydd1
if ( qushi<>qushi1 and qushi<>0 ) then
'5分趋势被破坏形成15分中枢,记录位置及信息并返回,形成5分的1类买卖点要记录并区分出类型,上升趋势被破坏形成1类卖点,下降趋势被破坏形成1类买点,1类买卖点要滞后与教材相反,要在趋势被破坏后才能判断出来;
zhshxing=1
'zhshbegin=zhshbeginci
qushi=0
zhshend=zhshendci1
'5分中枢结束位置为zhshendci1
vbzhsh15(zhshbegin)=1
vbzhsh15(zhshend)=2
zg=min(ygg,ygg1)
gg=max(ygg,ygg1)
zd=max(ydd,ydd1)
dd=min(ydd,ydd1)
vbzhshg15(zhshbegin)=zg
vbzhshgg15(zhshbegin)=gg
vbzhshd15(zhshbegin)=zd
vbzhshdd15(zhshbegin)=dd
vbzhshg15(zhshend)=zg
vbzhshgg15(zhshend)=gg
vbzhshd15(zhshend)=zd
vbzhshdd15(zhshend)=dd
if (qushi=1) then
if (ydd=dd) then
vbzhshmm15(x2)=3
else
vbzhshmm15(x4)=3
end if
else
if (ygg=gg) then
vbzhshmm15(x1)=-3
else
vbzhshmm15(x3)=-3
end if
end if
qushi=0
else
' 5分趋势未破坏没有形成5分中枢,将ygg换成ygg1的值
ygg=ygg1
ydd=ydd1
zhshbeginci=zhshbeginci1
zhshendci=zhshendci1
x3=x1
x4=x2
end if
else
if (qushi1<>0) then
'形成趋势
qushi=qushi1
zhshendci=zhshendci1
zhshbeginci=zhshbeginci1
else
'趋势为0,即是形成了高级中枢要记录并返回
zhshxing=1
'zhshbegin=zhshbeginci
qushi=0
zhshend=zhshendci1
'5分中枢结束位置为zhshendci1,开始位置为zhshbeginc1
vbzhsh15(zhshbegin)=1
vbzhsh15(zhshend)=2
zg=min(ygg,ygg1)
gg=max(ygg,ygg1)
zd=max(ydd,ydd1)
dd=min(ydd,ydd1)
vbzhshg15(zhshbegin)=zg
vbzhshgg15(zhshbegin)=gg
vbzhshd15(zhshbegin)=zd
vbzhshdd15(zhshbegin)=dd
vbzhshg15(zhshend)=zg
vbzhshgg15(zhshend)=gg
vbzhshd15(zhshend)=zd
vbzhshdd15(zhshend)=dd
m = a
end if
end if
else
'(0)else 有5分存在要判断是否枢成5分的延伸,还是5分中枢的破坏,5分中枢的破坏就构成二类买卖点,二类买卖点是一分中枢的高高或低低点若此点也是三类买卖点,则二/三类买卖点重合,要特别注意
'5分中枢破坏的标准为:5分中枢后的5分中枢的高高点或低低点不回到5分内即:不是延伸就是破坏 ,为与教材一致此处仍分单数与双数进行处理并要处理延伸的数量不超过6为5分中枢等于6即形成15分中枢要返回处理
'要先取5分中枢的高高点和低低点的位置及数值
if (zhshxing=1) then
zhshhoubi=zhshhoubi+1
end if
'if (zhshhoubi Mod 2 =1) then
'(5)begin中枢后的单数笔要判断中枢否结束,中枢结束的标志是中枢后的单数笔不回到中枢区间内(可能是震荡或趋势).此处与教材不同,比教材要早确认一个分型
if (ygg1<zd or ydd1>zg ) then
'(7) begin 未回到5分中枢内,判断条件为5分的低低点大于5分的高点或5分的高高点小于5分的低点
',应标记出来,同时5分中枢结束新5分中枢开始,老5分中枢在zhshend处结束,新5分中枢在zhshbeginci1处开始在zhshendci1处结束
'此时要判断买卖点,若5分低低点大于5分高点则5分低低点为5分二买,若5分高高点小于5分低点则5分高高点为5分二卖
if (ygg1<zd ) then
vbzhshmm5(x4)=2
else
vbzhshmm5(x3)=-2
end if
yanshen=0
yanshenbi=0
zhshxing=0
vbzhsh15(zhshend)=2
vbzhshg15(zhshend)=zg
vbzhshd15(zhshend)=zd
vbzhshgg15(zhshend)=gg
vbzhshdd15(zhshend)=dd
vbzhsh15(zhshbegin)=1
vbzhshg15(zhshbegin)=zg
vbzhshd15(zhshbegin)=zd
vbzhshgg15(zhshbegin)=gg
vbzhshdd15(zhshbegin)=dd
zhshend=zhshendci1
zhshbegin=zhshbeginci1
ygg=ygg1
ydd=ydd1
zhshbeginci=zhshbeginci1
zhshendci=zhshendci1
x1=x3
x2=x4
'取下一个5分或5分中枢的位置
zhshhoubi=0
zhshxing=0
'zhshbegin=0
'zhshend=0
yanshen=0
yanshenbi=0
qushi=0
'zhshbeginci=0
'zhshendci=0
zhshbeginci1=0
zhshendci1=0
a=a+1
m=a
else
'(7) else 单数笔回到中枢区间内,不形成买卖点,要记录下来,5分中枢结束标志zhshend更新为zhshendci1
yanshen=1
yanshenbi=yanshenbi+1
maxyanbi=max(maxyanbi,yanshenbi)
'vbyanwei(m)=m
'vbyanbicount(m)=yanshenbi
zhshend=zhshendci1
if (yanshenbi<6) then
vbzhsh15(zhshend)=2
vbzhshg15(zhshend)=zg
vbzhshd15(zhshend)=zd
vbzhshgg15(zhshend)=gg
vbzhshdd15(zhshend)=dd
else
'延伸超过6笔构成级别扩展,上一级别中枢结束,新的本级别中枢开始
yanshen=0
yanshenbi=0
zhshxing=0
vbzhsh15(zhshend)=2
vbzhsh15(zhshbegin)=1
vbzhshg15(zhshend)=zg
vbzhshd15(zhshend)=zd
vbzhshgg15(zhshend)=gg
vbzhshdd15(zhshend)=dd
vbzhshg15(zhshbegin)=zg
vbzhshd15(zhshbegin)=zd
vbzhshgg15(zhshbegin)=gg
vbzhshdd15(zhshbegin)=dd
vbzhsh30(zhshendci1)=2
vbzhsh30(zhshbegin)=1
zhshhoubi=0
'取下一个5分或5分中枢的位置
zhshhoubi=0
zhshxing=0
zhshbegin=0
zhshend=0
yanshen=0
yanshenbi=0
qushi=0
zhshbeginci=0
zhshendci=0
zhshbeginci1=0
zhshendci1=0
'找第一个5分中枢,找到后检查5分中枢开始位置是否也是5分中枢的开始位置(指是不是5分延伸出的5分,程序中对延伸的处理使用得延伸出的高级别中枢与次级别中枢在同一位置开始,结束位置不一样)
FOR a=m TO nlast
if (vbxian(a)<>0) then
'(a)是分型时处理
if (zhshxing=0) then
'(b)是否已形成了5分中枢
if (zhshbeginci=0) then
'(c)是否已形成了5分中枢
if (vbzhsh5(a) = 1) then
'(d)是5分中枢开始位置;以5分中枢的数据为基础形成5分的中枢数据,要先判断5分的数据
if (vbzhsh15(a) = 1) then
'(e)是5分中枢开始位置
zhshxing=1
zhshbegin=a
zhshbeginci=0
zhshendci=0
yanshen=0
yanshenbi=0
qushi=0
zhshbeginci=0
zhshendci=0
zhshbeginci1=0
zhshendci1=0
zg=vbzhshg15(zhshbegin)
gg=vbzhshgg15(zhshbegin)
zd=vbzhshd15(zhshbegin)
dd=vbzhshdd15(zhshbegin)
else
'(e)
zhshxing=0
zhshbegin=a
zhshbeginci=a
ygg=vbzhshgg5(zhshbeginci)
ydd=vbzhshdd5(zhshbeginci)
end if
'(e)
end if
'(d)
else
'(c)
if (vbxian(a)=1 and vbxiang(a)=ygg ) then
x1=a
end if
if (vbxian(a)=-1 and vbxiand(a)=ydd ) then
x2=a
end if
if (vbzhsh5(a) = 2) then
zhshendci=a
exit for
end if
end if
'(c)
else
'(b)
if (vbzhsh15(a) = 2) then
zhshend=a
exit for
end if
end if
'(b)
end if
'(a)
next
a=a+1
m=a
end if
end if
'(7)结束
'else
'(5)else中枢后的双数笔要判断中枢否结束,中枢结束的标志是中枢后的双数笔不回到中枢区间内(可能是震荡或趋势),中枢后的双数笔回到中枢区间内则为中枢延伸
'双数笔回到波动区间内则为中枢振荡,不回中枢区间也不回到波动区间则要看下面走势的发展若其后走势仍不回到波动区间则构成趋势,若其后走势回到波动区间是中枢振荡.
'此处与教材一致 ,新中枢自当下M的分型开始,原中枢自zhshend(上一个M)处结束
'end if
'(5)结束
end if
'(0)结束
else
'(4)else 是单独的一笔,此种情况出现在两个5分中枢间以两笔或两笔以上连接的情况,此时要判断是不是5分的趋势若是趋势则此点为第一类买卖点,若与其它买卖点重合则相当重要
if (qushi=1) then
'() begin ,vbzhshmm5(m)的值为1,-1为五分的三类买卖点,为2,-2为五分的二类买卖点,为3,-3为五分的一类买卖点,
'为4,-4为五分的零类买卖点,它是在趋势后又创新高或创新低(不完全是)的笔的端点,创新高或创新低的判断标准再考虑
if (vbxian(m)=1) then
if (vbxiangg(m)>gg) then
vbzhshmm15(m)=4
end if
else
if (vbxiandd(m)<dd) then
vbzhshmm15(m)=-4
end if
end if
else
'() else不是趋势返回
end if
'() 结束
end if
'(4)结束
end if
'(3)结束
end if
'(2)结束
next
'(1)结束
if (zhshxing=1) then
vbzhsh15(nlast)=2
vbzhshg15(nlast)=zg
vbzhshd15(nlast)=zd
vbzhshgg15(nlast)=gg
vbzhshdd15(nlast)=dd
end if
a=0
FOR m=0 TO nlast
if (vbzhsh15(m)>0) then
if (vbzhsh15(m)=2) then
if (a>0) then
vbzhsh15(a)=0
end if
a=m
else
a=0
end if
end if
next
a=0
ygg=0
ydd=0
FOR m=0 TO nlast
if (vbxian(m)<>0 ) then
'1 begin
if (vbzhsh15(m)=1) then
'2 BEGIN
gg=vbzhshgg15(m)
dd=vbzhshdd15(m)
a=1
end if
'2 END
if (a=1) then
'3 BEGIN
if (vbxian(m)=1 ) then
if (vbxiang(m)=gg and ygg=0) then
vbzhshgg15(m)=gg
ygg=1
end if
else
if (vbxiand(m)=dd and ydd=0) then
vbzhshdd15(m)=dd
ydd=1
end if
end if
end if
'3 END
if (vbzhsh15(m)=2) then
a=0
ygg=0
ydd=0
end if
end if
'1 end
next
'将本级别vbzhsh5高高点和低低点的数据也计算出来,后面要用到
FOR m=0 TO nlast
'延伸成高级别中枢的情况应先分成三个连续的三段每段取最高点和最低点然后再按高点中的低者,低点中的高者的规则计算高级中枢的中枢区间及高高点和低低点
if (vbxian(m)<>0) then
if (vbzhsh30(m)=1) then
zhshbegin=m
x1=1
x2=0
x3=1000000
x4=0
x5=1000000
x6=0
x7=1000000
end if
if (x1>=1 ) then
x1=x1+1
if (x1<=3) then
x2=max(x2,vbxiang(m))
x3=min(x3,vbxiand(m))
else
if (x1<=6) then
x4=max(x4,vbxiang(m))
x5=min(x5,vbxiand(m))
else
x6=max(x6,vbxiang(m))
x7=min(x7,vbxiand(m))
end if
end if
if (vbzhsh30(m)=2) then
zg=min(x2,x4)
zg=min(zg,x6)
gg=max(x2,x4)
gg=max(gg,x6)
zd=max(x3,x5)
zd=max(zd,x7)
dd=min(x3,x5)
dd=min(dd,x7)
vbzhshg30(zhshbegin)=zg
vbzhshd30(zhshbegin)=zd
vbzhshgg30(zhshbegin)=gg
vbzhshdd30(zhshbegin)=dd
vbzhshg30(m)=zg
vbzhshd30(m)=zd
vbzhshgg30(m)=gg
vbzhshdd30(m)=dd
x1=0
end if
end if
end if
next
'计算30分即:本级中枢延伸柢成的上一级别中枢(30分中枢)的数据
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("foxzhsh") = vbzhsh
FFL.VarData("foxzhshg") = vbzhshg
FFL.VarData("foxzhshd") = vbzhshd
FFL.VarData("foxzhshgg") = vbzhshgg
FFL.VarData("foxzhshdd") = vbzhshdd
FFL.VarData("foxzhsh5") = vbzhsh5
FFL.VarData("foxzhshg5") = vbzhshg5
FFL.VarData("foxzhshd5") = vbzhshd5
FFL.VarData("foxzhshgg5") = vbzhshgg5
FFL.VarData("foxzhshdd5") = vbzhshdd5
FFL.VarData("foxzhsh15") = vbzhsh15
FFL.VarData("foxzhshg15") = vbzhshg15
FFL.VarData("foxzhshd15") = vbzhshd15
FFL.VarData("foxzhshgg15") = vbzhshgg15
FFL.VarData("foxzhshdd15") = vbzhshdd15
FFL.VarData("foxzhsh30") = vbzhsh30
FFL.VarData("foxzhshg30") = vbzhshg30
FFL.VarData("foxzhshd30") = vbzhshd30
FFL.VarData("foxzhshgg30") = vbzhshgg30
FFL.VarData("foxzhshdd30") = vbzhshdd30
FFL.VarData("foxzhsh60") = vbzhsh60
FFL.VarData("foxzhshg60") = vbzhshg60
FFL.VarData("foxzhshd60") = vbzhshd60
FFL.VarData("foxzhshgg60") = vbzhshgg60
FFL.VarData("foxzhshdd60") = vbzhshdd60
FFL.VarData("foxzhshr") = vbzhshr
FFL.VarData("foxzhshgr") = vbzhshgr
FFL.VarData("foxzhshdr") = vbzhshdr
FFL.VarData("foxzhshggr") = vbzhshggr
FFL.VarData("foxzhshddr") = vbzhshddr
FFL.VarData("foxzhshz") = vbzhshz
FFL.VarData("foxzhshgz") = vbzhshgz
FFL.VarData("foxzhshdz") = vbzhshdz
FFL.VarData("foxzhshggz") = vbzhshggz
FFL.VarData("foxzhshddz") = vbzhshddz
FFL.VarData("foxzhshy") = vbzhshy
FFL.VarData("foxzhshgy") = vbzhshgy
FFL.VarData("foxzhshdy") = vbzhshdy
FFL.VarData("foxzhshggy") = vbzhshggy
FFL.VarData("foxzhshddy") = vbzhshddy
FFL.VarData("foxzhshn") = vbzhshn
FFL.VarData("foxzhshgn") = vbzhshgn
FFL.VarData("foxzhshdn") = vbzhshdn
FFL.VarData("foxzhshggn") = vbzhshggn
FFL.VarData("foxzhshddn") = vbzhshddn
FFL.VarData("foxzhshmm")= vbzhshmm
FFL.VarData("foxzhshmm5")= vbzhshmm5
FFL.VarData("foxzhshmm15")= vbzhshmm15
FFL.VarData("foxzhshmm30")= vbzhshmm30
FFL.VarData("foxzhshmm60")= vbzhshmm60
FFL.VarData("foxzhshmmr")= vbzhshmmr
FFL.VarData("foxzhshmmz")= vbzhshmmz
FFL.VarData("foxzhshmmy")= vbzhshmmy
FFL.VarData("foxzhshmmn")= vbzhshmmn
FFL.VarData("datanumber3") =maxbi
FFL.Vardata("foxyanwei")=vbyanwei
FFL.VarData("datanumber4") =maxyanbi
FFL.Vardata("foxyanbicount")=vbyanbicount
%>
FOXMACDWEI:=LING;
FOXZHSHMACD:=LING;
DATATYPEGG:=DATATYPE;
DATATYPEDD:=DATATYPE;
BEICHI:=LING;
BIBEICHI:=LING;
FH:=HIGH;
FL:=LOW;
FOXBIMACDWEI:=LING;
FOXBIMACD:=LING;
<%
vbfenxing=FFL.VarData("foxfenxing")
vbbimacdwei=FFL.VarData("foxbimacdwei")
vbbimacd=FFL.VarData("foxbimacd")
vbfh = FFL.VarData("fh")
vbfL = FFL.VarData("fl")
vbbeichi=FFL.VarData("beichi")
vbbibeichi=FFL.VarData("bibeichi")
vbxian=FFL.VarData("foxxian")
vbxiang=FFL.Vardata("foxxiang")
vbxiand=FFL.Vardata("foxxiand")
vbzhshgg=FFL.VarData("foxzhshgg")
vbzhshdd =FFL.VarData("foxzhshdd")
vbmacdwei=FFL.VarData("foxmacdwei")
vbzhsh =FFL.VarData("foxzhsh")
vbzhshmacd=FFL.VarData("foxzhshmacd")
vbmacd=FFL.VarData("macd")
nlast=ubound(vbfh)
a=nlast
Do While (vbxian(a)=0)
a=a-1
if (a<0) then
exit do
end if
loop
vbxian(nlast)=-vbxian(a)
vbxiang(nlast)=vbfh(nlast)
vbxiand(nlast)=vbfl(nlast)
'FOR a=0 TO nlast
'vbzhshmacd(a)=0
'vbbeichi(a)=0
'vbmacdwei(a)=0
'next
'a=nlast
m=0
mnumber=0
'FOR a=0 TO nlast
'if (vbzhsh(a) = 1) then
'mnumber=m
'm = a
'end if
'next
mnum=0
mnumber=0
FOR a=mnumber TO nlast
mnum=mnum+abs(vbmacd(a))*1000
if (vbxian(a)<>0) then
vbzhshmacd(a)=mnum
mnum=0
else
if (a=nlast) then
vbzhshmacd(a)=mnum
end if
end if
next
beforeweig=0
beforeweid=0
FOR a=mnumber TO nlast
if (vbxian(a)<>0) then
if (beforeweig>0 ) then
if (vbxian(a)>0) then
if( vbzhshmacd(a)<vbzhshmacd(beforeweig) and vbfh(a)>vbfh(beforeweig)) then
vbbeichi(a)=1
end if
else
if( vbzhshmacd(a)<vbzhshmacd(beforeweid) and vbfl(a)<vbfl(beforeweid)) then
vbbeichi(a)=-1
end if
end if
end if
if (beforeweid>0 ) then
if (vbxian(a)>0) then
if( vbzhshmacd(a)<vbzhshmacd(beforeweig) and vbfh(a)>vbfh(beforeweig)) then
vbbeichi(a)=1
end if
else
if( vbzhshmacd(a)<vbzhshmacd(beforeweid) and vbfl(a)<vbfl(beforeweid)) then
vbbeichi(a)=-1
end if
end if
end if
if (vbxian(a)>0) then
beforeweig=a
else
beforeweid=a
end if
beforewei=a
end if
next
mnum=0
'FOR a=beforewei TO nlast
'mnum=mnum+abs(vbmacd(a))*1000
'next
'vbzhshmacd(beforewei)=mnum
vbmacdwei(nlast)=vbzhshmacd(nlast)
if (vbxian(beforewei)>0) then
if( vbzhshmacd(nlast)<vbzhshmacd(beforeweig) and vbfh(nlast)>vbfh(beforeweig)) then
vbbeichi(nlast)=1
end if
else
if( vbzhshmacd(nlast)<vbzhshmacd(beforeweid) and vbfl(nlast)<vbfl(beforeweid)) then
vbbeichi(nlast)=-1
end if
end if
mnum=0
m=0
mnumber=0
'FOR a=0 TO nlast -1
'if (vbxian(a) <> 0) then
'mnumber=m
'm = a
'end if
'next
a=nlast
Do While (vbfenxing(a)=0)
a=a-1
if (a<0) then
exit do
end if
loop
vbfenxing(nlast)=-vbfenxing(a)
FOR a=mnumber TO nlast
mnum=mnum+abs(vbmacd(a))*1000
if (vbfenxing(a)<>0) then
vbbimacd(a)=mnum
mnum=0
else
if (a=nlast) then
vbbimacd(a)=mnum
end if
end if
next
beforeweig=0
beforeweid=0
FOR a=mnumber TO nlast
if (vbfenxing(a)<>0) then
if (beforeweig>0 ) then
if (vbfenxing(a)>0) then
if( vbbimacd(a)<vbbimacd(beforeweig) and vbfh(a)>vbfh(beforeweig)) then
vbbibeichi(a)=1
end if
else
if( vbbimacd(a)<vbbimacd(beforeweid) and vbfl(a)<vbfl(beforeweid)) then
vbbibeichi(a)=-1
end if
end if
end if
if (beforeweid>0 ) then
if (vbfenxing(a)>0) then
if( vbbimacd(a)<vbbimacd(beforeweig) and vbfh(a)>vbfh(beforeweig)) then
vbbibeichi(a)=1
end if
else
if( vbbimacd(a)<vbbimacd(beforeweid) and vbfl(a)<vbfl(beforeweid)) then
vbbibeichi(a)=-1
end if
end if
end if
if (vbfenxing(a)>0) then
beforeweig=a
else
beforeweid=a
end if
beforewei=a
end if
next
mnum=0
'FOR a=beforewei TO nlast
'mnum=mnum+abs(vbmacd(a))*1000
'next
'vbbimacd(beforewei)=mnum
vbmacdwei(nlast)=vbbimacd(nlast)
if (vbfenxing(beforewei)>0) then
if( vbbimacd(nlast)<vbbimacd(beforeweig) and vbfh(nlast)>vbfh(beforeweig)) then
vbbibeichi(nlast)=1
end if
else
if( vbbimacd(nlast)<vbbimacd(beforeweid) and vbfl(nlast)<vbfl(beforeweid)) then
vbbibeichi(nlast)=-1
end if
end if
FFL.VarData("foxbimacdwei")=vbbimacdwei
FFL.VarData("foxbimacd")=vbbimacd
FFL.Vardata("foxxiang")=vbxiang
FFL.Vardata("foxxiand")=vbxiand
vbdatatypegg =FFL.VarData("datatypegg")
vbdatatypedd =FFL.VarData("datatypedd")
vbdatatypegg =vbzhshgg(nlast)
vbdatatypedd =vbzhshdd(nlast)
FFL.VarData("foxmacdwei")=vbmacdwei
FFL.VarData("beichi")=vbbeichi
FFL.VarData("datatypegg") = vbdatatypegg
FFL.VarData("datatypedd") = vbdatatypedd
FFL.VarData("foxzhshmacd") = vbzhshmacd
FFL.VarData("foxfenxing") =vbfenxing
FFL.VarData("foxxian") =vbxian
FFL.VarData("bibeichi") =vbbibeichi
%>
DRAWLINE(FOXXIAN<0,FOXXIAND,FOXXIAN>0,FOXXIANG,0),colorFF;
DRAWLINE(FOXXIAN>0,FOXXIANG,FOXXIAN<0,FOXXIAND,0),colorFF00;
DRAWNUMBER(FOXXIAN<0 AND FOXFENNUMXIAN>0,IF(FOXL<LOW,FOXL,LOW),FOXFENNUMXIAN,0),ALIGN5,colorFFFFFF;
DRAWLINE(FOXFENXING<0,FOXL,FOXFENXING>0,FOXH,0),LINEDASH,colorFFFFFF;
DRAWLINE(FOXFENXING>0,FOXH,FOXFENXING<0,FOXL,0),LINEDASH,colorFFFF;
DRAWTEXT(BEICHI=1,IF(FOXL<LOW,FOXL,LOW),'顶/n背/n驰'),ALIGN4,colorFFFF;
DRAWTEXT(BEICHI=-1,IF(FOXL<LOW,FOXL,LOW),'/n /n底背驰'),colorFFFF;
DRAWTEXT(BIBEICHI=1,IF(FOXL<LOW,FOXL,LOW),'笔/n顶'),ALIGN4,colorFF00;
DRAWTEXT(BIBEICHI=-1,IF(FOXL<LOW,FOXL,LOW),' 笔底'),colorFF;
DRAWLINE(FOXWEIBI=1 AND FOXFENXING<0,FOXL,FOXWEIBI=2 AND FOXFENXING>0,FOXH,0),POINTDOT,LINETHICK2,colorFFFFFF;
DRAWLINE(FOXWEIBI=1 AND FOXFENXING>0,FOXH,FOXWEIBI=2 AND FOXFENXING<0,FOXL,0),POINTDOT,LINETHICK2,colorFFFF;
DRAWLINE(FOXWEI=1 AND FOXXIAN<0,FOXXIAND,FOXWEI=2 AND FOXXIAN>0,FOXXIANG,0),LINETHICK4,colorFF;
DRAWLINE(FOXWEI=1 AND FOXXIAN>0,FOXXIANG,FOXWEI=2 AND FOXXIAN<0,FOXXIAND,0),LINETHICK4,colorFF00;
DRAWNUMBER(FOXZHSH=2,FOXZHSHG,FOXZHSHG,FOXXIAOSHU),colorFF;
DRAWNUMBER(FOXZHSH=2,FOXZHSHD,FOXZHSHD,FOXXIAOSHU),colorFF;
飞狐缠中说禅主图指标公式

本文来自网络,不代表公式指标立场,转载请注明出处:https://www.gszb.top/20526.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: admin@gszb.top

关注微信
微信扫一扫关注我们

微信扫一扫关注公众号

加入QQ群
   
微信扫一扫关注我们

QQ扫一扫加入公式群

返回顶部