hikyuu2/hikyuu_pywrap/_StockManager.cpp

59 lines
2.4 KiB
C++
Raw Normal View History

2015-01-07 01:26:14 +08:00
/*
* _StockManager.cpp
*
* Created on: 2011-12-4
* Author: fasiondog
*/
#include <boost/python.hpp>
#include <hikyuu/StockManager.h>
using namespace boost::python;
using namespace hku;
2016-04-03 00:08:31 +08:00
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getTradingCalendar_overloads,
getTradingCalendar, 1, 2)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(addTempCsvStock_overloads,
addTempCsvStock, 3, 8)
2016-04-03 00:08:31 +08:00
BlockList (StockManager::*getBlockList_1)(const string&) = &StockManager::getBlockList;
BlockList (StockManager::*getBlockList_2)() = &StockManager::getBlockList;
2015-01-07 01:26:14 +08:00
void export_StockManager(){
2017-09-28 01:59:12 +08:00
docstring_options doc_options(false);
2015-01-07 01:26:14 +08:00
class_<StockManager>("StockManager", no_init)
.def("instance", &StockManager::instance,
return_value_policy<reference_existing_object>())
.staticmethod("instance")
2017-10-20 02:11:57 +08:00
.def("init", &StockManager::init)
.def("setKDataDriver", &StockManager::setKDataDriver)
2015-01-07 01:26:14 +08:00
.def("tmpdir", &StockManager::tmpdir)
.def("getBaseInfoDriverParameter", &StockManager::getBaseInfoDriverParameter)
.def("getBlockDriverParameter", &StockManager::getBlockDriverParameter)
.def("getKDataDriverParameter", &StockManager::getKDataDriverParameter)
.def("getPreloadParameter", &StockManager::getPreloadParameter)
.def("getHikyuuParameter", &StockManager::getHikyuuParameter)
2017-09-28 01:59:12 +08:00
.def("getAllMarket", &StockManager::getAllMarket)
2015-01-07 01:26:14 +08:00
.def("getMarketInfo", &StockManager::getMarketInfo)
.def("getStockTypeInfo", &StockManager::getStockTypeInfo)
.def("size", &StockManager::size)
.def("getStock", &StockManager::getStock)
2016-04-03 00:08:31 +08:00
.def("getBlock", &StockManager::getBlock)
.def("getBlockList", getBlockList_1)
.def("getBlockList", getBlockList_2)
//.def("getTradingCalendar", &StockManager::getTradingCalendar,
2017-09-28 01:59:12 +08:00
// getTradingCalendar_overloads())
.def("getTradingCalendar", &StockManager::getTradingCalendar,
(arg("query"), arg("market")="SH"))
.def("addTempCsvStock", &StockManager::addTempCsvStock,
addTempCsvStock_overloads())
.def("removeTempCsvStock", &StockManager::removeTempCsvStock)
2016-04-03 00:08:31 +08:00
2015-01-07 01:26:14 +08:00
.def("__len__", &StockManager::size)
.def("__getitem__", &StockManager::getStock)
2016-04-03 00:08:31 +08:00
.def("__iter__", iterator<const StockManager>())
2015-01-07 01:26:14 +08:00
;
}