hikyuu2/hikyuu_cpp/demo/demo.cpp

27 lines
540 B
C++
Raw Normal View History

2018-08-31 02:50:06 +08:00
// demo.cpp : 定义控制台应用程序的入口点。
//
#include <hikyuu/hikyuu.h>
using namespace hku;
int main(int argc, char* argv[])
{
2018-08-31 02:50:06 +08:00
//配置文件的位置自行修改
hikyuu_init("c:\\stock\\hikyuu_win.ini");
StockManager& sm = StockManager::instance();
Stock stk = sm.getStock("sh000001");
std::cout << stk << std::endl;
2018-08-31 02:50:06 +08:00
auto k = stk.getKData(KQuery(-10));
std::cout << k << std::endl;
2018-09-07 02:06:06 +08:00
for (size_t i=0; i < k.size(); i++) {
2018-08-31 02:50:06 +08:00
std::cout << k[i] << std::endl;
}
return 0;
2018-09-07 02:06:06 +08:00
}