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.2,0,-0.4,-1.8,-0.8,1.7,0.8,3.7,2,2.2,2.6,-0.9],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,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等数据!的更多相关文章

  1. 淘宝上倒卖新浪微盘事件来龙去脉——谈谈巧用IMEI

    这是一个老黄历的事件,曾记得淘宝上的卖家卖10元卖50g网络硬盘,并且卖的相当的火,一个月就卖了500个账号.由于我也是那个事件的亲身经历者之一,这里就看到了IMEI号在项目中防止作弊是何其的重要. ...

  2. 魅族MX四核手机转让,二手淘宝上+hi-pda论坛结合使用成功已出

    2013-3-14 内容存档在evernote,笔记名"魅族MX四核手机转让,二手淘宝上+hi-pda论坛结合使用成功已出"

  3. 【Python3 爬虫】14_爬取淘宝上的手机图片

    现在我们想要使用爬虫爬取淘宝上的手机图片,那么该如何爬取呢?该做些什么准备工作呢? 首先,我们需要分析网页,先看看网页有哪些规律 打开淘宝网站http://www.taobao.com/ 我们可以看到 ...

  4. 转::iOS 仿淘宝,上拉进入详情页面

    今天做的主要是一个模仿淘宝,上拉进入商品详情的功能,主要是通过 tableView 与 webView 一起来实现的,当然也可根据自己的需要把 webView 替换成你想要的 // // ViewCo ...

  5. TP5+阿里云OSS上传文件第三节,实现淘宝上传商品图片

    **TP5+阿里云OSS上传文件第三节,实现淘宝上传商品图片首先我们来看看淘宝的功能和样式:** 之后看看制作完成的演示:(由于全部功能弄成GIF有点大,限制上传大小好像在1M之内,压缩之后也有1.9 ...

  6. 甜咸粽子党大战,Python爬取淘宝上的粽子数据并进行分析

    前言 本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 爬虫 爬取淘宝数据,本次采用的方法是:Selenium控制Chrome浏览 ...

  7. Python 002- 爬虫爬取淘宝上耳机的信息

    参照:https://mp.weixin.qq.com/s/gwzym3Za-qQAiEnVP2eYjQ 一般看源码就可以解决问题啦 #-*- coding:utf-8 -*- import re i ...

  8. SSL 证书申请(居然还可以在淘宝上购买)

    免费的目前有 2 个国内的:免费SSL证书申请国外的:StartSSL™ Certificates & Public Key Infrastructure 备注:其实,国内的这家的根证书,也是 ...

  9. 利用PHP从淘宝采集评论和成交数据

    如果不想通过淘宝开放平台API获取数据,那么另外一个很好的办法就是采集了.一般来说,采集一个网页上的内容,只需要用CURL获取源代码,然后用正则表达式取出需要的内容就可以,不过如果这样载入一个淘宝的页 ...

随机推荐

  1. python---pth包路径

    为依赖包添加环境变量 (这一步很关键)PYTHONPATH C:\tensorflow\models\research;C:\tensorflow\models\research\slim6.然后并没 ...

  2. 【统计与建模】R语言基本操作

    # vec <- rep( seq(1,5,by=0.5),3) # vec <- seq( 1 , 10 , by = 1 ) # min(vec) #最小值 # max(vec) #最 ...

  3. intel ipp6.0安装过程

    由于最近看到一个代码中使用了intel ipp6.0库,了解到,ipp6.0是一个很强大的图像处理库,将其与opencv联合使用,还能够加速opencv的处理,在图像处理的过程中,是一个很重要的工具. ...

  4. django.http.response中HttpResponse 子类

    HttpResponse的子类 Django包含许多处理不同类型的HTTP请求的 HttpResponse 子类.像 HttpResponse 一样,这些类在 django.http 中. HttpR ...

  5. VUE 元素拖拽、移动

    元素拖拽 作者:一粒尘土 时间:2019-10-30 使用范围:两个元素位置交换,移动元素到指定位置 涉及函数 属性 解释 draggable 是否允许元素进行拖拽 dragstart 拖拽开始触发的 ...

  6. K2 BPM_【解决方案】从“制造”到“智造”,K2推动制造业转型升级_业务流程管理系统

    近年来,中国制造业产出占全球总产品比例越来越大,是仅次于美国的全球第二大工业制造国,中国凭借巨大的制造业总量成为名副其实的“世界工厂”.然而个性化消费的兴起正在给制造企业各环节带来冲击.在现代市场环境 ...

  7. PyCharm提示ModuleNotFoundError: No module named 'pymysql'

    初学python,连接mysql时遇到了提示pymysql模块导入有问题,本人虽是window系统,解决思路是一样的 代码如下: import pymysql#打开数据库,参数依次为:主机名/IP,用 ...

  8. USB原理简单叙述

    USB简介: USB的几种版本: 1. USB 1.0:速度 1.5Mb/s 2. USB 1.1:速度 12Mb/s 3. USB 2.0:速度 60MbB/s 4. USB 3.0:速度 640M ...

  9. Leaflet 调用百度瓦片地图服务

    在使用 leaflet 调用第三方瓦片地图服务的项目,主要谷歌地图.高德地图.百度地图和 OSM 地图,与其他三种地图对比,百度地图的瓦片组织方式是不同的.百度从中心点经纬度(0,0)度开始计算瓦片, ...

  10. Nginx 安装 和 特性介绍

    一:nginx 环境搭建 四项确认 确认系统网络可通行 确认yum可用 确认关闭iptables规则 确认停用selinux 查看iptables规则 iptables -L 关闭iptables规则 ...