淘宝上的大智慧L2数据,月卡最便宜是8元钱,这个也可以获取BBD、DDX等数据!
Want:从顶牛股网上下载DDX数据。
1、下载历史DDE数据:获取最近120个交易日的DDE数据
#define SFURL_DNG_SINGLEL"http://www.dingniugu.com/ddedata/gegu_ddedata.php?&code="
strUrl.Format(L"%s%06d", SFURL_DNG_SINGLE, iStockCode);
OpenURL获取的数据如下:
var data=new Array(
[55.16,60.68,66.75,73.43,80.77,87,88.16,84.79,93.27,102.6,108.99,119.89,113.9,116.3,104.67,104.8,105.8,98.86,99.77,104.6,98.4,98.05,102,92.24,92.18,93.88,96.5,102.7,112.97,105.88,109.6,98.64,94,92.68,87.19,87],[2720,20378,28466,26158,43471,46255,33398,30534,9707,57219,47797,37917,64825,44135,39158,32326,31746,34983,19440,34521,24065,18375,20442,38770,17194,20324,17993,36975,47697,30685,27241,24062,25480,11137,17151,14465],[0,9496.15,3045.86,837.06,-652.07,-2127.73,-367.38,-305.34,1795.79,1945.45,-812.55,1592.51,-2268.88,1015.1,-1096.42,-64.65,-698.41,-489.76,136.08,-586.86,-457.24,147,102.21,-4032.08,223.52,-101.62,305.88,1442.03,476.97,-828.5,-326.89,-1179.04,-687.96,-200.47,-428.78,0],[0,15.268,4.208,2.732,1.951,-2.558,-0.208,-0.861,2.143,1.738,-0.457,2.089,-2.941,1.318,-2.254,0.023,-0.814,-0.388,0.124,0.088,-0.932,0.417,0.388,-4.556,0.145,0.148,0.472,1.916,0.892,-0.891,-0.233,-1.272,-0.89,-0.369,-0.627,0.239],[1,3.504,1.198,1.211,1.142,0.911,0.991,0.964,2.371,1.066,0.983,1.133,0.915,1.055,0.892,1.001,0.954,0.982,1.01,1.004,0.937,1.035,1.031,0.804,1.012,1.012,1.045,1.117,1.041,0.946,0.985,0.91,0.939,0.949,0.942,1.027],[0,-50.2,-13.1,-4,3.3,2.2,1,1.5,-8.2,-0.7,1,-1.8,2.5,-1.3,2.8,0.6,1.1,1.4,-0.3,0.3,2.6,-0.7,-0.5,6.5,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],['2014-01-29','2014-01-30','2014-02-07','2014-02-10','2014-02-13','2014-02-14','2014-02-17','2014-02-18','2014-02-19','2014-02-20','2014-02-21','2014-02-24','2014-02-25','2014-02-26','2014-02-27','2014-02-28','2014-03-03','2014-03-04','2014-03-05','2014-03-06','2014-03-07','2014-03-10','2014-03-11','2014-03-12','2014-03-13','2014-03-14','2014-03-17','2014-03-18','2014-03-19','2014-03-20','2014-03-21','2014-03-24','2014-03-25','2014-03-26','2014-03-27','2014-03-28'],[45.96,60.68,60.48,71.50,80.77,80.00,87.02,87.50,93.27,96.27,100.01,112.90,121.70,111.10,116.00,102.75,103.00,103.80,98.99,99.41,101.95,95.92,99.50,102.90,91.00,90.80,95.10,96.00,103.00,111.00,104.21,107.01,95.01,92.89,92.00,85.99],[55.16,60.68,66.75,73.43,80.77,88.85,89.97,89.20,93.27,102.60,112.18,119.89,127.94,119.69,116.00,105.50,107.37,106.90,102.50,106.98,103.40,103.19,102.66,104.66,92.70,95.44,97.32,106.15,112.97,113.45,113.00,108.10,96.00,94.88,92.68,90.58],[45.96,60.68,59.46,70.00,79.00,78.98,84.93,83.88,93.27,94.50,100.01,111.00,108.11,109.90,104.67,98.86,100.83,96.98,97.51,95.03,97.00,95.00,96.03,91.80,89.66,90.77,93.80,95.53,102.00,105.88,102.00,98.64,90.92,92.58,86.67,85.00],[0,46.6,10.7,3.2,-1.5,-4.6,-1.1,-1,18.5,3.4,-1.7,4.2,-3.5,2.3,-2.8,-0.2,-2.2,-1.4,0.7,-1.7,-1.9,0.8,0.5,-10.4,1.3,-0.5,1.7,3.9,1,-2.7,-1.2,-4.9,-2.7,-1.8,-2.5,0]);
var area=new Array([55.16,119.89],[0,64825],[-4032.08,9496.15],[-4.556,15.268],[0,3.504],[-50.2,6.5],[-10.3,3.9],[-24.3,11.6],[-8.7,42.8],[45.96,121.70],[55.16,127.94],[45.96,111.00]);
解释:
最开始的var data=new Array(下面有20个[]字符串组,将他们分割出来。
他们依次是:收盘价、成交额、BBD金额、DDY、单数比、小单差、中单差、大单差、特大单差、涨跌幅、DDX、保留1、保留2、保留3、保留4、日期、开盘价、最高价、最低价、通吃率。
第二个var area=new Array(里面的[]对应的是出了价格、日期,其它项的Range。
2、下载今日实时DDE数据(值,非波形)
#define SFURL_DNG_ALLDATA L"http://www.dingniugu.com/sydata/ddxxgdata26.php?orderby=0&page=" enum enumDNG_ALLDATA_INDEX
{
DNG_ALLDATA_INDEX_StockCode,
DNG_ALLDATA_INDEX_CurrentPrice,
DNG_ALLDATA_INDEX_RisePercent,
DNG_ALLDATA_INDEX_HuanShouLv,
DNG_ALLDATA_INDEX_LiangBi,
DNG_ALLDATA_INDEX_DDX1,
DNG_ALLDATA_INDEX_DDY1,
DNG_ALLDATA_INDEX_DDZ,
DNG_ALLDATA_INDEX_DDX3,
DNG_ALLDATA_INDEX_DDX5,
DNG_ALLDATA_INDEX_DDX10,
DNG_ALLDATA_INDEX_DDX60,
DNG_ALLDATA_INDEX_DDX5Red,
DNG_ALLDATA_INDEX_DDX10Red,
DNG_ALLDATA_INDEX_DDXContinueRed,
DNG_ALLDATA_INDEX_DDXContinueUp,
DNG_ALLDATA_INDEX_Rise3,
DNG_ALLDATA_INDEX_Rise5,
DNG_ALLDATA_INDEX_Rise10,
DNG_ALLDATA_INDEX_DDY3,
DNG_ALLDATA_INDEX_DDY5,
DNG_ALLDATA_INDEX_DDY10,
DNG_ALLDATA_INDEX_DDY60,
DNG_ALLDATA_INDEX_Turnover,
DNG_ALLDATA_INDEX_BBD,
DNG_ALLDATA_INDEX_TCL1,
DNG_ALLDATA_INDEX_TCL5,
DNG_ALLDATA_INDEX_TCL10,
DNG_ALLDATA_INDEX_TCL20,
DNG_ALLDATA_INDEX_DSB,
DNG_ALLDATA_INDEX_TDDC,
DNG_ALLDATA_INDEX_DDC,
DNG_ALLDATA_INDEX_ZDC,
DNG_ALLDATA_INDEX_XDC,
DNG_ALLDATA_INDEX_ZDL1,
DNG_ALLDATA_INDEX_ZDL5,
DNG_ALLDATA_INDEX_ZDL10,
DNG_ALLDATA_INDEX_LTA, DNG_ALLDATA_INDEX_Max
}; bool CSF_DNGDataReader::GetAllStockDDEData(StockDngDataMap& dngMap)
{
static int s_iMaxPage = ; bool bRet = false;
CString strUrl;
CSF_HttpDataReader httpReader; int i,idx1,idx2,len;
int nPage,nItem;
string sRead; int iDate = ; //only get 20 items in one page, and the data is about 4.5KB
char* buf = new char[*]; if (s_iMaxPage == )
{
strUrl.Format(L"%s%d",SFURL_DNG_ALLDATA, );
len = httpReader.GetHttpData(strUrl, buf, *);
if (len > )
{
buf[len] = ; sRead = "";
sRead.append(buf); // "total":2351,
idx1 = sRead.find("total");
idx2 = sRead.find(",", idx1);
if ((idx1 != -) && (idx2 != -))
{
int iMaxItem = atoi(sRead.substr(idx1+, idx2-idx1-).c_str());
s_iMaxPage = iMaxItem/ DNG_ITEM_InOnePage; //20 Item In One Page
if ((iMaxItem%DNG_ITEM_InOnePage) != )
{
s_iMaxPage++;
}
}
}
} if (s_iMaxPage)
{
for (nPage=; nPage<=s_iMaxPage; nPage++)
{
strUrl.Format(L"%s%d",SFURL_DNG_ALLDATA, nPage);
len = httpReader.GetHttpData(strUrl, buf, *);
if (len > )
{
buf[len] = ; sRead = "";
sRead.append(buf); //Parse date
// "updatetime":"2014-03-07
idx1 = sRead.find("updatetime");
if (idx1 != -)
{
string sdate = sRead.substr(idx1+, ); iDate = atoi(sdate.substr(,).c_str())*
+ atoi(sdate.substr(,).c_str())* + atoi(sdate.substr(,).c_str());
} idx1 = sRead.find("[[");
idx2 = sRead.rfind("]]");
if ((idx1 != -) && (idx2 != -))
{
sRead = sRead.substr(idx1+, idx2-idx1-); vector<string> vecItems;
TF_SplitString(sRead, "\\],\\[", vecItems);
if (vecItems.size())
{
for (nItem=; nItem<vecItems.size(); nItem++)
{
vector<string> vecDetail;
TF_SplitString(vecItems[nItem], ",", vecDetail);
if (vecDetail.size() == DNG_ALLDATA_INDEX_Max)
{
int iStockCode;
DNG_DATA objData; iStockCode = atoi(vecDetail[DNG_ALLDATA_INDEX_StockCode].c_str());
objData.dde[DDE_ITEM_INDEX_BBD] = atof(vecDetail[DNG_ALLDATA_INDEX_BBD].c_str());
objData.dde[DDE_ITEM_INDEX_DDX] = atof(vecDetail[DNG_ALLDATA_INDEX_DDX1].c_str());
objData.dde[DDE_ITEM_INDEX_DDY] = atof(vecDetail[DNG_ALLDATA_INDEX_DDY1].c_str());
objData.dde[DDE_ITEM_INDEX_DDZ] = atof(vecDetail[DNG_ALLDATA_INDEX_DDZ].c_str());
objData.dde[DDE_ITEM_INDEX_DSB] = atof(vecDetail[DNG_ALLDATA_INDEX_DSB].c_str());
objData.dde[DDE_ITEM_INDEX_XDC] = atof(vecDetail[DNG_ALLDATA_INDEX_XDC].c_str());
objData.dde[DDE_ITEM_INDEX_ZDC] = atof(vecDetail[DNG_ALLDATA_INDEX_ZDC].c_str());
objData.dde[DDE_ITEM_INDEX_DDC] = atof(vecDetail[DNG_ALLDATA_INDEX_DDC].c_str());
objData.dde[DDE_ITEM_INDEX_TDDC] = atof(vecDetail[DNG_ALLDATA_INDEX_TDDC].c_str());
objData.dde[DDE_ITEM_INDEX_TCL] = atof(vecDetail[DNG_ALLDATA_INDEX_TCL1].c_str());
objData.date = iDate; StockDngDataMapIter it = dngMap.find(iStockCode);
if (it != dngMap.end())
{
it->second = objData;
}
else
{
dngMap.insert(make_pair<int, DNG_DATA>(iStockCode, objData));
}
}
}
}
}
}
} bRet = (dngMap.size() > );
} delete[] buf; return bRet;
}
只能一个Page一个Page去获取,初始根据"total":2343这个值,去计算有多少页吧,每页20项,起始Page为1。
老办法,分割,具体Item意义,见enum。
参考网页:http://www.dingniugu.com/ddxxg.html
淘宝上的大智慧L2数据,月卡最便宜是8元钱,这个也可以获取BBD、DDX等数据!的更多相关文章
- 淘宝上倒卖新浪微盘事件来龙去脉——谈谈巧用IMEI
这是一个老黄历的事件,曾记得淘宝上的卖家卖10元卖50g网络硬盘,并且卖的相当的火,一个月就卖了500个账号.由于我也是那个事件的亲身经历者之一,这里就看到了IMEI号在项目中防止作弊是何其的重要. ...
- 魅族MX四核手机转让,二手淘宝上+hi-pda论坛结合使用成功已出
2013-3-14 内容存档在evernote,笔记名"魅族MX四核手机转让,二手淘宝上+hi-pda论坛结合使用成功已出"
- 【Python3 爬虫】14_爬取淘宝上的手机图片
现在我们想要使用爬虫爬取淘宝上的手机图片,那么该如何爬取呢?该做些什么准备工作呢? 首先,我们需要分析网页,先看看网页有哪些规律 打开淘宝网站http://www.taobao.com/ 我们可以看到 ...
- 转::iOS 仿淘宝,上拉进入详情页面
今天做的主要是一个模仿淘宝,上拉进入商品详情的功能,主要是通过 tableView 与 webView 一起来实现的,当然也可根据自己的需要把 webView 替换成你想要的 // // ViewCo ...
- TP5+阿里云OSS上传文件第三节,实现淘宝上传商品图片
**TP5+阿里云OSS上传文件第三节,实现淘宝上传商品图片首先我们来看看淘宝的功能和样式:** 之后看看制作完成的演示:(由于全部功能弄成GIF有点大,限制上传大小好像在1M之内,压缩之后也有1.9 ...
- 甜咸粽子党大战,Python爬取淘宝上的粽子数据并进行分析
前言 本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 爬虫 爬取淘宝数据,本次采用的方法是:Selenium控制Chrome浏览 ...
- Python 002- 爬虫爬取淘宝上耳机的信息
参照:https://mp.weixin.qq.com/s/gwzym3Za-qQAiEnVP2eYjQ 一般看源码就可以解决问题啦 #-*- coding:utf-8 -*- import re i ...
- SSL 证书申请(居然还可以在淘宝上购买)
免费的目前有 2 个国内的:免费SSL证书申请国外的:StartSSL™ Certificates & Public Key Infrastructure 备注:其实,国内的这家的根证书,也是 ...
- 利用PHP从淘宝采集评论和成交数据
如果不想通过淘宝开放平台API获取数据,那么另外一个很好的办法就是采集了.一般来说,采集一个网页上的内容,只需要用CURL获取源代码,然后用正则表达式取出需要的内容就可以,不过如果这样载入一个淘宝的页 ...
随机推荐
- 《Mysql - Count(*) 的优化》
一:Count(*) 的实现方式? - 要明确的是,在不同的 MySQL 引擎中,count(*) 有不同的实现方式. - MyISAM 引擎把一个表的总行数存在了磁盘上,因此执行 count(*) ...
- FZU2018级算法第五次作业 m_sort(归并排序或线段树求逆序对)
首先对某人在未经冰少允许情况下登录冰少账号原模原样复制其代码并且直接提交的赤裸裸剽窃行为,并且最终被评为优秀作业提出抗议! 题目大意: 给一个数组含n个数(1<=n<=5e5),求使用冒泡 ...
- zblog常用到的几个标签介绍
文章归档 <divclass="function"id="divArchives"> <h3><#ZC_MSG028#>&l ...
- Django基础十一之认证系统
一 auth模块 我们在开发一个网站的时候,无可避免的需要设计实现网站的用户系统.此时我们需要实现包括用户注册.用户登录.用户认证.注销.修改密码等功能,这还真是个麻烦的事情呢. Django作为一个 ...
- 第二章 Python基础语法
2.1 环境的安装 解释器:py2 / py3 (环境变量) 开发工具:pycharm 2.2 编码 编码基础 ascii ,英文.符号,8位为一个东西,2**8 unicode ,万国码,可以表示所 ...
- hadoop 完全分布式搭建总结
完全分布式--------------- 1.配置文件 [core-site.xml] hdfs 地址 fs.defaultFS=hdfs://s129:8020/ [hdfs-site.xml] 副 ...
- Spring Cloud Alibaba学习笔记(4) - Feign配置与使用
什么是Feign Feign是一个声明式Web Service客户端. 使用Feign能让编写Web Service客户端更加简单, 它的使用方法是定义一个接口,然后在上面添加注解,同时也支持JAX- ...
- 在论坛中出现的比较难的sql问题:14(存储过程问题 存储过程参数、存储过程内的参数)
原文:在论坛中出现的比较难的sql问题:14(存储过程问题 存储过程参数.存储过程内的参数) 最近,在论坛中,遇到了不少比较难的sql问题,虽然自己都能解决,但发现过几天后,就记不起来了,也忘记解决的 ...
- processon使用教程
原文地址:https://www.cnblogs.com/yangliheng/p/6082250.html 一.引言 作为一名IT从业者,不仅要有扎实的知识储备,出色的业务能力,还需要具备一定的软实 ...
- VBA Do...While循环
一个Do...while循环用于只要条件为真就重复一组语句.该条件可以在循环开始时或循环结束时检查. 语法 以下是VBA中的一个Do...While循环的语法. Do While condition ...