设为首页收藏本站

 找回密码
 注册
查看: 2882|回复: 0
打印 上一主题 下一主题

很多指数最近几天的K线和成交量都有误 [复制链接]

Rank: 2

精华
0
UID
1873
积分
105
帖子
44
主题
12
阅读权限
30
注册时间
2008-7-13
最后登录
2019-11-26
1#
发表于 2013-7-8 09:21:11 |显示全部楼层
建议大家给自己的程序里 加上数据检查的代码 以减少一些莫名其妙的困惑 。(注意 往前回溯部分,“[i]” 发帖时被自动删掉了)

if (BarStatus == 2)
{
  str1="";
  
  if (open<0 or close<0 or high<0 or low<0)
    str1=str1+"今日价格 小于0,";
  if (open>high or close>high or low>high or open<low or close<low or high<low)
    str1=str1+"今日价格数据有误"+" O"+text(open)+", C"+text(close)+", H"+text(high)+", L"+text(low);
  if (vol<0)
    str1=str1+"今日成交量 小于0,";
  if (Openint<0)
    str1=str1+"今日持仓量 小于0,";
  
  For i = 1 To Barcount-1       //从上一根k线 回溯到历史第一根k线 做上面同样的检查
  {
    if (open<0 or close<0 or high<0 or low<0)
      str1=str1+datetostring(date)+"价格 小于0,";
    if (open>high or close>high or low>high or open<low or close<low or high<low)
      str1=str1+datetostring(date)+"价格数据有误"+" O"+text(open)+", C"+text(close)+", H"+text(high)+", L"+text(low);
    if (vol<0)
      str1=str1+datetostring(date)+"成交量 小于0,";
    if (Openint<0)
      str1=str1+datetostring(date)+"持仓量 小于0,";
  }
  
  //输出 str1
}

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-14 22:54

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部