欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件高级功能研发区 → VBA求助

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有4636人关注过本帖树形打印复制链接

主题:VBA求助

帅哥哟,离线,有人找我吗?
Leon
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:金字塔养老院 帖子:509 积分:2425 威望:0 精华:0 注册:2012/3/2 12:50:05
VBA求助  发帖心情 Post By:2012/6/11 12:47:24 [显示全部帖子]

不知道什么原因,总提示语法错误,将前两行的定义 数据类型去掉,仍然报语法错误,希望高手解答啊~

public InpMinihub as Integer
 public hubnum as Integer

 public hubid()
 public hubopen()
 public hubclose()
 public hubbas()
 public hublast()

 private history
 private grd 

Sub Init(gridobj as grid)
 grd=gridobj
 history=grd.getHistoryData()
 InpMiniHub=3
End Sub

Sub getHub()
 hubnum=0
 barpos=0
 do
  barpos=dupHub(barpos)
 loop while barpos<history.count-1

End Sub


Function dupHub(pos as integer)
 dim curopen,curclose,curbas,curlast
 dim wide as integer
 
 curopen=history.High(pos)
 curclose=history.Low(pos)
 curbas=pos
 wide=1
 
 for idx=pos+1 to history.datacount-1
  if (history.high(idx)<curclose or history.low(idx)>curopen) then
   if (wide<InpMiniHub) then
    dupHub=idx
    exit function
   else
    hubopen(hubnum)=curopen
    hubclose(hubnum)=curclose
    hubbas(hubnum)=curbas
    hublast(hubnum)=idx-1
    hubwide(hubnum)=getHubLevel(hublast-hubbas+1)
    hubid(hubnum)="0_"+hubbas(hubnum)+"_"+hublast(hubnum) 
    dupHub=idx
    hubnum++
    exit function
   end if
  else
   wide++
   curopen=(curopen*wide+history.high(idx))/(wide+1)
   curclose=(curclose*wide+history.low(idx))/(wide+1)
  end if
 next
 
End Function


 回到顶部