请教一下CTP取期货数据的问题

yxlovemoney 2017-03-24 11:04:20
某站上提供的一个CTP行情项目,www.diyq.cn/thread-3-1-1.html
这两项目在CSDN上也有,但这个项目不知道该怎么取详细的数据,
现在程序跑通后,他只能出来这一串数据

都是些无关痛痒的数据,
而我需要的是,深度行情数据


而这个CTP提供的API里面,似乎有提供深度行情的一个方法,但是根本不知道他是怎么使用的


我尝试在订阅了行情 之后直接去调用,但没什么卵用。

void CMdSpi::SubscribeMarketData()
{
int iResult = pUserApi->SubscribeMarketData(ppInstrumentID, iInstrumentID);
cerr << "--->>> 发送行情订阅请求: " << ((iResult == 0) ? "成功" : "失败") << endl;


///////////yx//////////////////
CThostFtdcDepthMarketDataField dataField;
memset(&dataField, 0, sizeof(dataField));
OnRtnDepthMarketData(&dataField);
}


网站上的文档,也只是提到这方法的作用,并没说怎么使用。
所以希望对CTP有经验的,能指点一二。
...全文
1390 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Bill.W.J 2020-06-06
  • 打赏
  • 举报
回复
这程序应该只是一个demo吧。。。
yxlovemoney 2017-03-24
  • 打赏
  • 举报
回复
引用 1 楼 ipqtjmqj 的回复:
继承然后重写OnRtnDepthMarketData方法就可以了
能否演示一下
ipqtjmqj 2017-03-24
  • 打赏
  • 举报
回复
继承然后重写OnRtnDepthMarketData方法就可以了
Chin__Lee 2017-03-24
  • 打赏
  • 举报
回复
onRtnDepth****这个函数是回调函数,不是让你自己调用的,这里的CMDSPI这个类应该就已经继承了CTP,所以你只需要改写CMDSPI::onRtnDepth****这个函数的内部就好。 这个机制就是,你先用 pUserApi->SubscribeMarketData(ppInstrumentID, iInstrumentID);订阅你的行情,如果订阅成功,行情来的时候会有行情线程主动调用刚才你写的函数。比如你想行情到达的时候输出一个什么值,直接写在那个回调函数里就好了。
ipqtjmqj 2017-03-24
  • 打赏
  • 举报
回复
ipqtjmqj 2017-03-24
  • 打赏
  • 举报
回复
引用 5 楼 yxlovemoney 的回复:
[quote=引用 3 楼 ipqtjmqj 的回复:] [quote=引用 2 楼 yxlovemoney 的回复:] [quote=引用 1 楼 ipqtjmqj 的回复:] 继承然后重写OnRtnDepthMarketData方法就可以了
能否演示一下[/quote] 继承不会吗,自己看书去[/quote] 而且你真有弄过吗[/quote] 读过来有申买bid价,申卖ask价,申买量,申买量,持仓量,最新价. 开仓,平仓,平今,做多,做空,手续费,保证金,锁仓....
yxlovemoney 2017-03-24
  • 打赏
  • 举报
回复
引用 3 楼 ipqtjmqj 的回复:
[quote=引用 2 楼 yxlovemoney 的回复:] [quote=引用 1 楼 ipqtjmqj 的回复:] 继承然后重写OnRtnDepthMarketData方法就可以了
能否演示一下[/quote] 继承不会吗,自己看书去[/quote] 而且你真有弄过吗
yxlovemoney 2017-03-24
  • 打赏
  • 举报
回复
引用 3 楼 ipqtjmqj 的回复:
[quote=引用 2 楼 yxlovemoney 的回复:] [quote=引用 1 楼 ipqtjmqj 的回复:] 继承然后重写OnRtnDepthMarketData方法就可以了
能否演示一下[/quote] 继承不会吗,自己看书去[/quote] 问题是你说的继承是多此一举啊,你到底怎么用的
ipqtjmqj 2017-03-24
  • 打赏
  • 举报
回复
引用 2 楼 yxlovemoney 的回复:
[quote=引用 1 楼 ipqtjmqj 的回复:] 继承然后重写OnRtnDepthMarketData方法就可以了
能否演示一下[/quote] 继承不会吗,自己看书去
CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序 CTP期货数据收集与中转程序

3,882

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧