hikyuu2/tools/hikyuu/core_doc.py

556 lines
15 KiB
C++
Raw Normal View History

#!/usr/bin/python
# -*- coding: utf8 -*-
# cp936
#
# The MIT License (MIT)
#
# Copyright (c) 2010-2017 fasiondog
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
2017-09-28 01:59:12 +08:00
from hikyuu._hikyuu import *
2017-09-27 00:49:06 +08:00
#------------------------------------------------------------------
# from _DataType.cpp
#------------------------------------------------------------------
DatetimeList.__doc__ = """日期序列对应C++中的std::vector<Datetime>"""
2017-09-27 00:49:06 +08:00
PriceList.__doc__ ="""价格序列其中价格使用double表示对应C++中的std::vector<double>。"""
toPriceList.__doc__ += """\n
Python的可迭代对象如 listtuple PriceList
:param arg: Python序列
:rtype: PriceList
"""
StringList.__doc__ = """字符串列表对应C++中的std::vector<String>"""
#------------------------------------------------------------------
# from _Datetime.cpp
#------------------------------------------------------------------
Datetime.__doc__ = """日期时间类,精确到秒"""
Datetime.max.__doc__ += """
"""
Datetime.min.__doc__ += """
"""
Datetime.now.__doc__ += """
"""
getDateRange.__doc__ += """\n
[start, end)
:param Datetime start:
:param Datetime end:
:rtype: DatetimeList
"""
2017-09-27 00:49:06 +08:00
#------------------------------------------------------------------
# from _util.cpp
#------------------------------------------------------------------
roundUp.__doc__ = """
roundUp(arg1[, arg2=0])
10.111
:param float arg1:
:param int arg2:
:return:
"""
roundDown.__doc__ = """
roundDown(arg1[, arg2=0])
10.110
:param float arg1:
:param int arg2:
:return:
"""
#------------------------------------------------------------------
# from _MarketInfo.cpp
#------------------------------------------------------------------
MarketInfo.__doc__ = """
.. py:attribute:: market : SH, SZ
.. py:attribute:: name :
.. py:attribute:: description :
.. py:attribute:: code :
.. py:attribute:: lastDate : K线数据最后交易日期
"""
#------------------------------------------------------------------
# from _StockTypeInfo.cpp
#------------------------------------------------------------------
StockTypeInfo.__doc__ = """
.. py:attribute:: type :
.. py:attribute:: description :
.. py:attribute:: tick :
.. py:attribute:: tickValue : tick价格
.. py:attribute:: unit : = tickValue/tick
.. py:attribute:: precision :
.. py:attribute:: minTradeNumber :
.. py:attribute:: maxTradeNumber :
"""
#------------------------------------------------------------------
# from _StockWeight.cpp
#------------------------------------------------------------------
StockWeight.__doc__ = """
.. py:attribute:: datetime :
.. py:attribute:: countAsGift : 10X股
.. py:attribute:: countForSell : 10X股
.. py:attribute:: priceForSell :
.. py:attribute:: bonus : 10
.. py:attribute:: increasement : 10X股
.. py:attribute:: totalCount :
.. py:attribute:: freeCount :
"""
StockWeightList.__doc__ = """std::vector<StockWeight> 包装"""
#------------------------------------------------------------------
# from _StockManager.cpp
#------------------------------------------------------------------
2017-09-28 01:59:12 +08:00
StockManager.__doc__ = """证券信息管理类"""
StockManager.instance.__doc__ = """
instance()
StockManager单例实例
"""
StockManager.tmpdir.__doc__ = """
tmpdir()
m_config中的tmpdir
"""
StockManager.getAllMarket.__doc__ = """
getAllMarket()
:rtype: StringList
"""
StockManager.getMarketInfo.__doc__ = """
getMarketInfo(market)
:param string market:
:return: Null<MarketInfo>()
:rtype: MarketInfo
"""
StockManager.getStockTypeInfo.__doc__ = """
getStockTypeInfo(stk_type)
:param int stk_type: :py:data:`constant`
:return: Null<StockTypeInfo>()
:rtype: StockTypeInfo
"""
StockManager.size.__doc__ = """\n
size()
"""
StockManager.__len__.__doc__ = """\n
"""
StockManager.getStock.__doc__ = """
getStock(querystr)
"市场简称证券代码"
:param str querystr: "sh000001"
:return: Null<Stock>()
:rtype: Stock
"""
StockManager.__getitem__.__doc__ = """
getStock
"""
StockManager.getBlock.__doc__ = """
getBlock(category, name)
:param str category:
:param str name:
:return: Block
:rtype: Block
"""
StockManager.getBlockList.__doc__ = """
getBlockList([category])
:param str category:
:return:
:rtype: BlockList
"""
StockManager.getTradingCalendar.__doc__ = """
getTradingCalendar(query[, market='SH'])
:param KQuery query: Query查询条件
:param str market:
:return:
:rtype: DatetimeList
"""
StockManager.addTempCsvStock.__doc__ = """
addTempCsvStock(code, day_filename, min_filename[, tick=0.01, tickValue=0.01, precision=2, minTradeNumber = 1, maxTradeNumber=1000000])
CSV文件K线数据StockCSV格式的K线数据时
CSV文件第一行为标题 DatetimeDateOPENHIGHLOWCLOSEAMOUNTVOLUMEVOLCOUNT
:param str code: Stock相同Null<Stock>
:param str day_filename: 线CSV文件名
:param str min_filename: 线CSV文件名
:param float tick: 0.01
:param float tickValue: 0.01
:param int precision: 2
:param int minTradeNumber: 1
:param int maxTradeNumber: 1000000
:return: Stock
:rtype: Stock
"""
StockManager.removeTempCsvStock.__doc__ = """
removeTempCsvStock(code)
Stock
:param str code:
"""
#------------------------------------------------------------------
# from _KQuery.cpp
#------------------------------------------------------------------
KQueryByDate.__doc__ = """
KQueryByDate(start, end, kType, recoverType)
[start, end) K线数据条件
:param Datetime start:
:param Datetime end:
:param KQuery.KType kType: K线数据类型线线
:param KQuery.RecoverType recoverType:
:return:
:rtype: KQuery
"""
KQueryByIndex.__doc__ = """
KQueryByIndex(start, end, kType, recoverType)
[start, end) K线数据条件使 Query
:param ind start:
:param ind end:
:param KQuery.KType kType: K线数据类型线线
:param KQuery.RecoverType recoverType:
:return:
:rtype: KQuery
"""
KQuery.__doc__ = """K线数据查询条件一般在Python中使用 Query 即可,不用指明 KQuery"""
KQuery.getQueryTypeName.__doc__ = """
getQueryTypeName(queryType)
queryType名称
:param KQuery.QueryType queryType:
:rtype: str
"""
KQuery.getKTypeName.__doc__ = """
getKTypeName(kType)
KType名称
:param KQuery.KType kType: K线类型
:rtype: str
"""
KQuery.getRecoverTypeName.__doc__ = """
getRecoverTypeName(recoverType)
recoverType名称
:param KQuery.RecoverType recoverType:
:rtype: str
"""
KQuery.getQueryTypeEnum.__doc__ = """
getQueryTypeEnum(queryType)
queryType枚举值
:param str queryType: DATE
:rtype: KQuery.QueryType
"""
KQuery.getKTypeEnum.__doc__ = """
getKTypeEnum(ktype)
:param str ktype: DAY
:rtype: KQuery.KType
"""
KQuery.getRecoverTypeEnum.__doc__ = """
getRecoverTypeEnum(recoverType)
:param str recoverType: NO_RECOVER
:rtype: KQuery.RecoverType
"""
KQuery.QueryType.__doc__ = """
- DATE -
- INDEX -
"""
KQuery.KType.__doc__ = """
K线类型枚举定义
- DAY - 线
- WEEK - 线
- MONTH - 线
- QUARTER - 线
- HALFYEAR - 线
- YEAR - 线
- MIN - 1线
- MIN5 - 5线
- MIN15 - 15线
- MIN30 - 30线
- MIN60 - 60线
"""
KQuery.RecoverType.__doc__ = """
K线复权类别枚举定义
- NO_RECOVER -
- FORWARD -
- BACKWARD -
- EQUAL_FORWARD -
- EQUAL_BACKWARD -
"""
KQuery.start.__doc__ = """
constant.null_int64
"""
KQuery.end.__doc__ = """
constant.null_int64
"""
KQuery.startDatetime.__doc__ = """
constant.null_datetime
"""
KQuery.endDatetime.__doc__ = """
constant.null_datetime
"""
KQuery.queryType.__doc__ = """
"""
KQuery.kType.__doc__ = """
K线类型
"""
KQuery.recoverType.__doc__ = """
"""
#------------------------------------------------------------------
# from _KRecord.cpp
#------------------------------------------------------------------
KRecord.__doc__ = """K线记录组成K线数据属性可读写"""
KRecord.datetime.__doc__ = """日期时间"""
KRecord.openPrice.__doc__ = """开盘价"""
KRecord.highPrice.__doc__ = """最高价"""
KRecord.lowPrice.__doc__ = """最低价"""
KRecord.closePrice.__doc__ = """收盘价"""
KRecord.transAmount.__doc__ = """成交金额"""
KRecord.transCount.__doc__ = """成交量"""
KRecordList.__doc__ = """C++ std::vector<KRecord>包装"""
#------------------------------------------------------------------
# from _KData.cpp
#------------------------------------------------------------------
KData.__doc__ = """
Stock.getKData K线数据 KRecord list
"""
KData.startPos.__doc__ = """
K线记录中对应的起始位置KData为空返回0
"""
KData.endPos.__doc__ = """
K线记录中对应范围的下一条记录的位置0,lastPos + 1
"""
KData.lastPos.__doc__ = """
K线记录中对应的最后一条记录的位置0,endPos - 1
"""
KData.getDatetimeList.__doc__ = """
getDatetimeList()
:rtype: DatetimeList
"""
KData.getKRecord.__doc__ = """
getKRecord(pos)
K线记录
:param int pos:
:rtype: KRecord
"""
KData.get.__doc__ = """
get(pos)
getKRecordK线记录
:param int pos:
:rtype: KRecord
"""
KData.getKRecordByDate.__doc__ = """
getKRecordByDate(datetime)
K线记录
:param Datetime datetime:
:rtype: KRecord
"""
KData.getByDate.__doc__ = """
getByDate(datetime)
K线记录 getKRecordByDate
:param Datetime datetime:
:rtype: KRecord
"""
KData.size.__doc__ = """
size()
K线记录数量 __len__
"""
KData.empty.__doc__ = """
empty()
:rtype: bool
"""
KData.getQuery.__doc__ = """
getQuery()
:rtype: KQuery
"""
KData.getStock.__doc__ = """
getStock()
Stock
:rtype: Stock
"""
KData.tocsv.__doc__ = """
tocsv(filename)
CSV文件
:param str filename:
"""
#------------------------------------------------------------------
# from _Stock.cpp
#------------------------------------------------------------------