Hikyuu
| 类型定义 | 枚举 | 函数 | 变量
hku 命名空间参考

Hikyuu核心命名空间,包含股票数据的管理、指标实现、交易系统框架等 更多...

class  AllocateFundsBase
 
class  Ama
 
class  Atr
 
class  BaseInfoDriver
 基本信息数据获取驱动基类 更多...
 
class  Block
 板块类,可视为证券的容器 更多...
 
class  BlockInfoDriver
 
class  BoolSignal
 
class  BorrowRecord
 记录当前借入的股票信息 更多...
 
class  ConditionBase
 系统有效条件基类 更多...
 
class  ConstantValue
 
class  CostRecord
 成本记录 更多...
 
class  CrossGoldSignal
 
class  CrossSignal
 
class  DataDriverFactory
 数据驱动工厂类 更多...
 
class  Datetime
 日期类型 更多...
 
class  Diff
 
class  Ema
 
class  EnvironmentBase
 环境判定策略基类 更多...
 
class  EqualWeightAllocateFunds
 
class  FixedA2015TradeCost
 
class  FixedA2017TradeCost
 
class  FixedATradeCost
 沪深A股交易成本算法,计算每次买入或卖出的成本 更多...
 
class  FixedCapitalMoneyManager
 
class  FixedCountMoneyManager
 固定交易数量资金管理策略 更多...
 
class  FixedHoldDays
 
class  FixedPercentMoneyManager
 
class  FixedPercentProfitGoal
 
class  FixedPercentSlippage
 
class  FixedPercentStoploss
 固定百分比止损策略,即当价格低于买入价格的某一百分比时止损 更多...
 
class  FixedRatioMoneyManager
 
class  FixedRiskMoneyManager
 
class  FixedSelector
 
class  FixedUnitsMoneyManager
 
class  FixedValueSlippage
 
class  FundsRecord
 当前资产情况记录,由TradeManager::getFunds返回 更多...
 
struct  H5IndexRecord
 
class  H5KDataDriver
 
struct  H5Record
 
struct  H5TimeLineRecord
 
struct  H5TransRecord
 
class  HighLine
 
class  IKData
 
class  Indicator
 指标类,具体由IndicatorImp实现,实现新指标时应继承IndicatorImp 更多...
 
class  IndicatorImp
 指标实现类,定义新指标时,应从此类继承 更多...
 
class  IndicatorStoploss
 
class  IniParser
 支持简单的ini格式文件的读取
更多...
 
class  IPriceList
 
class  KData
 K线数据 更多...
 
class  KDataBufferImp
 
class  KDataDriver
 K线数据驱动基类 更多...
 
class  KDataImp
 
class  KDataTempCsvDriver
 获取临时载入的CSV文件 更多...
 
class  KQuery
 按索引方式查询K线数据条件 更多...
 
class  KRecord
 K线数据记录 更多...
 
class  LoanRecord
 借款记录(融资记录) 更多...
 
class  LowLine
 
class  Macd
 
class  MarketInfo
 市场信息记录 更多...
 
class  MoneyManagerBase
 资金管理基类 更多...
 
class  MySQLBaseInfoDriver
 
class  MySQLKDataDriver
 
class  NoGoalProfitGoal
 
class  NotMoneyManager
 
class  Null
 提供指定给定类型的Null值 更多...
 
class  Null< double >
 提供double的Null值 更多...
 
class  Null< int >
 提供int的Null值 更多...
 
class  Null< KQuery >
 提供KQuery的Null值 更多...
 
class  Null< long long >
 提供long long(64位整型)的Null值 更多...
 
class  Null< size_t >
 提供size_t的Null值 更多...
 
class  Null< unsigned int >
 提供unsigned int的Null值 更多...
 
class  Null< unsigned long long >
 提供unsigned long long(无符号64位整型)的Null值 更多...
 
class  Operand
 
class  OperandNode
 
class  OPLineCondition
 
class  OrderBrokerBase
 订单代理基类,实现实际的订单操作及程序化的订单。 更多...
 
class  Parameter
 供需要命名参数设定的类使用 更多...
 
class  Performance
 简单绩效统计 更多...
 
class  Portfolio
 
class  PositionRecord
 持仓记录 更多...
 
class  ProfitGoalBase
 盈利目标策略基类 更多...
 
class  QLBlockInfoDriver
 
class  RightShift
 
class  SaftyLoss
 
class  SelectorBase
 交易对象选择模块 更多...
 
class  SignalBase
 信号指示器基类 更多...
 
class  SingleSignal
 
class  SingleSignal2
 
class  SlippageBase
 移滑价差算法基类 更多...
 
class  Sma
 
class  SQLiteBaseInfoDriver
 
class  StdDeviation
 
struct  Stock
 Stock基类,Application中一般使用StockPtr进行操作 更多...
 
class  StockManager
 证券信息统一管理类 更多...
 
class  StockMapIterator
 
class  StockTypeInfo
 证券类型信息 更多...
 
class  StockWeight
 权息数据结构 更多...
 
class  StoplossBase
 止损/止赢策略基类 更多...
 
class  System
 交易系统基类 更多...
 
class  SystemWeight
 
class  TdxKDataDriver
 
class  TimeLineRecord
 分时线记录 更多...
 
class  TradeCostBase
 交易成本算法接口基类 更多...
 
class  TradeCostStub
 
class  TradeManager
 账户交易管理模块,管理帐户的交易记录及资金使用情况 更多...
 
class  TradeRecord
 交易记录 更多...
 
class  TradeRequest
 交易请求记录 更多...
 
class  TransRecord
 分笔成交记录 更多...
 
class  TwoLineEnvironment
 
class  Vigor
 
class  Weave
 
class  WilliamsFixedRiskMoneyManager
 
class  ZeroTradeCost
 

类型定义

typedef vector< BlockBlockList
 
typedef shared_ptr< BaseInfoDriverBaseInfoDriverPtr
 
typedef shared_ptr< BlockInfoDriverBlockInfoDriverPtr
 
typedef shared_ptr< H5::H5File > H5FilePtr
 
typedef shared_ptr< KDataDriverKDataDriverPtr
 
typedef std::vector< DatetimeDatetimeList
 日期列表 更多...
 
typedef shared_ptr< IndicatorImpIndicatorImpPtr
 
typedef Operand OP
 
typedef shared_ptr< OperandNodeOperandNodePtr
 
typedef shared_ptr< KDataImpKDataImpPtr
 
typedef vector< KRecordKRecordList
 
typedef shared_ptr< KRecordListKRecordListPtr
 
typedef vector< StockStockList
 
typedef vector< stringMarketList
 
typedef vector< StockWeightStockWeightList
 
typedef vector< TimeLineRecordTimeLineList
 分时线 更多...
 
typedef shared_ptr< TimeLineListTimeLineListPtr
 
typedef vector< BorrowRecordBorrowRecordList
 
typedef vector< LoanRecordLoanRecordList
 
typedef shared_ptr< OrderBrokerBaseOrderBrokerPtr
 客户程序应使用此类型进行实际操作 更多...
 
typedef vector< PositionRecordPositionRecordList
 
typedef shared_ptr< TradeCostBaseTradeCostPtr
 交易成本算法指针 更多...
 
typedef shared_ptr< TradeManagerTradeManagerPtr
 客户程序应使用此类型进行实际操作 更多...
 
typedef shared_ptr< TradeManagerTMPtr
 
typedef vector< TradeRecordTradeRecordList
 
typedef shared_ptr< AllocateFundsBaseAllocateFundsPtr
 
typedef shared_ptr< AllocateFundsBaseAFPtr
 
typedef vector< SystemWeightSystemWeightList
 
typedef shared_ptr< ConditionBaseConditionPtr
 客户程序都应使用该指针类型 更多...
 
typedef shared_ptr< ConditionBaseCNPtr
 
typedef shared_ptr< EnvironmentBaseEnvironmentPtr
 客户程序都应使用该指针类型 更多...
 
typedef shared_ptr< EnvironmentBaseEVPtr
 
typedef shared_ptr< MoneyManagerBaseMoneyManagerPtr
 客户程序都应使用该指针类型 更多...
 
typedef shared_ptr< MoneyManagerBaseMMPtr
 
typedef shared_ptr< PortfolioPortfolioPtr
 客户程序都应使用该指针类型 更多...
 
typedef shared_ptr< PortfolioPFPtr
 
typedef shared_ptr< ProfitGoalBaseProfitGoalPtr
 客户程序都应使用该指针类型 更多...
 
typedef shared_ptr< ProfitGoalBasePGPtr
 
typedef shared_ptr< SelectorBaseSelectorPtr
 客户程序都应使用该指针类型 更多...
 
typedef shared_ptr< SelectorBaseSEPtr
 
typedef shared_ptr< SignalBaseSignalPtr
 客户程序都应使用该指针类型,操作信号指示器 更多...
 
typedef shared_ptr< SignalBaseSGPtr
 
typedef shared_ptr< SlippageBaseSlippagePtr
 客户程序都应使用该指针类型,操作移滑价差算法 更多...
 
typedef shared_ptr< SlippageBaseSPPtr
 
typedef shared_ptr< StoplossBaseStoplossPtr
 客户程序都应使用该指针类型,操作止损策略实例 更多...
 
typedef shared_ptr< StoplossBaseSTPtr
 
typedef shared_ptr< StoplossBaseTakeProfitPtr
 
typedef shared_ptr< StoplossBaseTPPtr
 
typedef shared_ptr< SystemSystemPtr
 客户程序应使用该指针进行操作 更多...
 
typedef shared_ptr< SystemSYSPtr
 
typedef vector< SystemPtrSystemList
 
typedef vector< TransRecordTransList
 分时线 更多...
 
typedef vector< TransRecordTransRecordList
 
typedef shared_ptr< TransListTransListPtr
 
typedef shared_ptr< TransListTransRecordListPtr
 
typedef long long hku_int64
 
typedef unsigned long long hku_uint64
 
typedef int hku_int32
 
typedef unsigned hku_uint32
 
typedef char hku_int8
 
typedef unsigned char hku_uint8
 
typedef double price_t
 
typedef std::string string
 
typedef vector< price_tPriceList
 
typedef vector< stringStringList
 

枚举

函数

HKU_API std::ostream & operator<< (std::ostream &os, const Block &blk)
 
HKU_API std::ostream & operator<< (std::ostream &os, const BaseInfoDriver &driver)
 
HKU_API std::ostream & operator<< (std::ostream &os, const BaseInfoDriverPtr &driver)
 
HKU_API std::ostream & operator<< (std::ostream &os, const BlockInfoDriver &driver)
 
HKU_API std::ostream & operator<< (std::ostream &os, const BlockInfoDriverPtr &driver)
 
map< string, BaseInfoDriverPtrdefault_baseinfo_driver ()
 
map< string, BlockInfoDriverPtrdefault_block_driver ()
 
map< string, KDataDriverPtrdefault_kdata_driver ()
 
HKU_API std::ostream & operator<< (std::ostream &os, const KDataDriver &driver)
 
HKU_API std::ostream & operator<< (std::ostream &os, const KDataDriverPtr &driver)
 
HKU_API std::ostream & operator<< (std::ostream &out, const Datetime &d)
 
DatetimeList HKU_API getDateRange (const Datetime &start, const Datetime &end)
 获取指定范围的日历日期列表[start, end),仅仅是日,不含时分秒 更多...
 
bool operator== (const Datetime &, const Datetime &)
 
bool operator!= (const Datetime &, const Datetime &)
 
bool operator> (const Datetime &, const Datetime &)
 
bool operator< (const Datetime &, const Datetime &)
 
bool operator>= (const Datetime &, const Datetime &)
 
bool operator<= (const Datetime &, const Datetime &)
 
void hikyuu_init (const string &config_file_name)
 Hikyuu核心初始化,客户端必须在程序入口处调用 更多...
 
Stock getStock (const string &querystr)
 获取Stock,目的是封装StockManager,客户端不直接使用StockManager对象 更多...
 
string getVersion ()
 获取Hikyuu当前版本号 更多...
 
Indicator HKU_API AMA (int n=10, int fast_n=2, int slow_n=30)
 佩里.J 考夫曼(Perry J.Kaufman)自适应移动平均,参见《精明交易者》(2006年 广东经济出版社) 更多...
 
Indicator HKU_API AMA (const Indicator &indicator, int n=10, int fast_n=2, int slow_n=30)
 佩里.J 考夫曼(Perry J.Kaufman)自适应移动平均,参见《精明交易者》(2006年 广东经济出版社) 更多...
 
Indicator HKU_API ATR (int n=14)
 平均真实波幅(Average True Range) 更多...
 
Indicator HKU_API ATR (const Indicator &data, int n=14)
 平均真实波幅(Average True Range) 更多...
 
Indicator HKU_API CVAL (double value=0.0, size_t len=0, size_t discard=0)
 创建一个指定长度的常数指标 更多...
 
Indicator HKU_API CVAL (const Indicator &ind, double value=0.0)
 创建一个常数指标,其长度和输入的ind相同,其值固定为指定value 更多...
 
Indicator HKU_API DIFF ()
 差分指标,即data[i] - data[i-1] 更多...
 
Indicator HKU_API DIFF (const Indicator &data)
 差分指标,即data[i] - data[i-1] 更多...
 
Indicator HKU_API EMA (int n=22)
 指数移动平均线(Exponential Moving Average) 更多...
 
Indicator HKU_API EMA (const Indicator &data, int n=22)
 指数移动平均线(Exponential Moving Average) 更多...
 
Indicator HKU_API HHV (int n=20)
 N日内最高价 更多...
 
Indicator HKU_API HHV (const Indicator &ind, int n=20)
 N日内最高价 更多...
 
HKU_API Indicator IND_AND (const Indicator &, const Indicator &)
 对两个Indicator执行与操作 更多...
 
HKU_API Indicator IND_AND (const Indicator &ind, price_t val)
 
HKU_API Indicator IND_AND (price_t val, const Indicator &ind)
 
HKU_API Indicator IND_OR (const Indicator &, const Indicator &)
 对两个Indicator执行或操作 更多...
 
HKU_API Indicator IND_OR (const Indicator &ind, price_t val)
 
HKU_API Indicator IND_OR (price_t val, const Indicator &ind)
 
Indicator HKU_API KDATA ()
 包装KData成Indicator,用于其他指标计算 更多...
 
Indicator HKU_API KDATA (const KData &)
 
Indicator HKU_API KDATA (const Indicator &)
 
Indicator HKU_API OPEN ()
 包装KData的开盘价成Indicator,用于其他指标计算 更多...
 
Indicator HKU_API OPEN (const KData &)
 
Indicator HKU_API OPEN (const Indicator &)
 
Indicator HKU_API HIGH ()
 包装KData的最高价成Indicator,用于其他指标计算 更多...
 
Indicator HKU_API HIGH (const KData &)
 
Indicator HKU_API HIGH (const Indicator &)
 
Indicator HKU_API LOW ()
 包装KData的最低价成Indicator,用于其他指标计算 更多...
 
Indicator HKU_API LOW (const KData &)
 
Indicator HKU_API LOW (const Indicator &)
 
Indicator HKU_API CLOSE ()
 包装KData的收盘价成Indicator,用于其他指标计算 更多...
 
Indicator HKU_API CLOSE (const KData &)
 
Indicator HKU_API CLOSE (const Indicator &)
 
Indicator HKU_API AMO ()
 包装KData的成交金额成Indicator,用于其他指标计算 更多...
 
Indicator HKU_API AMO (const KData &)
 
Indicator HKU_API AMO (const Indicator &)
 
Indicator HKU_API VOL ()
 包装KData的成交量成Indicator,用于其他指标计算 更多...
 
Indicator HKU_API VOL (const KData &)
 
Indicator HKU_API VOL (const Indicator &)
 
Indicator HKU_API KDATA_PART (const string &kpart)
 根据字符串选择返回KDATA/OPEN/HIGH/LOW/CLOSE/AMO/VOL 更多...
 
Indicator HKU_API KDATA_PART (const KData &kdata, const string &kpart)
 
Indicator HKU_API KDATA_PART (const Indicator &kdata, const string &kpart)
 
Indicator HKU_API LLV (int n=20)
 N日内最低价 更多...
 
Indicator HKU_API LLV (const Indicator &ind, int n=20)
 N日内最低价 更多...
 
Indicator HKU_API MA (const Indicator &data, int n=22, const string &type="SMA")
 移动平均 更多...
 
Indicator HKU_API MA (int n, const string &type)
 
Indicator HKU_API MACD (int n1=12, int n2=26, int n3=9)
 MACD平滑异同移动平均线 更多...
 
Indicator HKU_API MACD (const Indicator &data, int n1=12, int n2=26, int n3=9)
 MACD平滑异同移动平均线 更多...
 
Indicator HKU_API POS (const Block &block, KQuery query, SignalPtr sg)
 
Indicator HKU_API PRICELIST (const PriceList &, int discard=0)
 包装PriceList成Indicator 更多...
 
Indicator HKU_API PRICELIST (const Indicator &ind, int result_index=0)
 将某指标转化为PRICELIST 更多...
 
Indicator HKU_API PRICELIST (int result_index=0)
 将某指标转化为PRICELIST 更多...
 
Indicator HKU_API PRICELIST (price_t *data, size_t total)
 包装 price_t 数组成Indicator,用于计算其他指标 更多...
 
Indicator HKU_API REF (int n)
 REF 向前引用 (即右移) 引用若干周期前的数据。 用法: REF(X,A) 引用A周期前的X值。 更多...
 
Indicator HKU_API REF (const Indicator &ind, int n)
 REF 向前引用 (即右移) 引用若干周期前的数据。 用法: REF(X,A) 引用A周期前的X值。 更多...
 
Indicator HKU_API SAFTYLOSS (const Indicator &data, int n1=10, int n2=3, double p=2.0)
 亚历山大 艾尔德安全地带止损 更多...
 
Indicator HKU_API SAFTYLOSS (int n1=10, int n2=3, double p=2.0)
 亚历山大 艾尔德安全地带止损 更多...
 
Indicator HKU_API SMA (const Indicator &data, int n=22)
 简单移动平均 更多...
 
Indicator HKU_API SMA (int n=22)
 
Indicator HKU_API STDEV (int n=10)
 计算N周期内样本标准差 更多...
 
Indicator HKU_API STDEV (const Indicator &data, int n=10)
 计算N周期内样本标准差 更多...
 
Indicator HKU_API VIGOR (const KData &kdata, int n=2)
 亚历山大 艾尔德力度指数 更多...
 
Indicator HKU_API VIGOR (const Indicator &ind, int n=2)
 
Indicator HKU_API VIGOR (int n=2)
 
Indicator HKU_API WEAVE (const Indicator &ind)
 将ind的结果组合在一起放在一个Indicator中。如ind = WEAVE(ind1); ind=ind(ind2)。 则此时ind包含两个结果,result1为ind1的数据,result2为ind2的数据 更多...
 
Indicator HKU_API WEAVE ()
 
HKU_API std::ostream & operator<< (std::ostream &os, const Indicator &indicator)
 
HKU_API Indicator operator+ (const Indicator &, const Indicator &)
 Indicator实例相加,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator+ (const Indicator &ind, price_t val)
 
HKU_API Indicator operator+ (price_t val, const Indicator &ind)
 
HKU_API Indicator operator- (const Indicator &, const Indicator &)
 Indicator实例相减,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator- (const Indicator &ind, price_t val)
 
HKU_API Indicator operator- (price_t val, const Indicator &ind)
 
HKU_API Indicator operator* (const Indicator &, const Indicator &)
 Indicator实例相乘,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator* (const Indicator &ind, price_t val)
 
HKU_API Indicator operator* (price_t val, const Indicator &ind)
 
HKU_API Indicator operator/ (const Indicator &, const Indicator &)
 Indicator实例相除,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator/ (const Indicator &ind, price_t val)
 
HKU_API Indicator operator/ (price_t val, const Indicator &ind)
 
HKU_API Indicator operator== (const Indicator &, const Indicator &)
 Indicator实例相等,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator== (const Indicator &ind, price_t val)
 
HKU_API Indicator operator== (price_t val, const Indicator &ind)
 
HKU_API Indicator operator!= (const Indicator &, const Indicator &)
 Indicator实例不相等,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator!= (const Indicator &ind, price_t val)
 
HKU_API Indicator operator!= (price_t val, const Indicator &ind)
 
HKU_API Indicator operator> (const Indicator &, const Indicator &)
 Indicator实例大于操作,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator> (const Indicator &ind, price_t val)
 
HKU_API Indicator operator> (price_t val, const Indicator &ind)
 
HKU_API Indicator operator< (const Indicator &, const Indicator &)
 Indicator实例小于操作,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator< (const Indicator &ind, price_t val)
 
HKU_API Indicator operator< (price_t val, const Indicator &ind)
 
HKU_API Indicator operator>= (const Indicator &, const Indicator &)
 Indicator实例大于操作,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator>= (const Indicator &ind, price_t val)
 
HKU_API Indicator operator>= (price_t val, const Indicator &ind)
 
HKU_API Indicator operator<= (const Indicator &, const Indicator &)
 Indicator实例小于操作,两者的size必须相等,否在返回空 更多...
 
HKU_API Indicator operator<= (const Indicator &ind, price_t val)
 
HKU_API Indicator operator<= (price_t val, const Indicator &ind)
 
HKU_API std::ostream & operator<< (std::ostream &os, const IndicatorImp &imp)
 
HKU_API std::ostream & operator<< (std::ostream &os, const IndicatorImpPtr &imp)
 
HKU_API std::ostream & operator<< (std::ostream &os, const Operand &op)
 
HKU_API Operand operator+ (const Operand &op, price_t val)
 
HKU_API Operand operator+ (price_t val, const Operand &op)
 
HKU_API Operand operator- (const Operand &op, price_t val)
 
HKU_API Operand operator- (price_t val, const Operand &op)
 
HKU_API Operand operator* (const Operand &op, price_t val)
 
HKU_API Operand operator* (price_t val, const Operand &op)
 
HKU_API Operand operator/ (const Operand &op, price_t val)
 
HKU_API Operand operator/ (price_t val, const Operand &op)
 
HKU_API Operand operator> (const Operand &op, price_t val)
 
HKU_API Operand operator> (price_t val, const Operand &op)
 
HKU_API Operand operator< (const Operand &op, price_t val)
 
HKU_API Operand operator< (price_t val, const Operand &op)
 
HKU_API Operand operator>= (const Operand &op, price_t val)
 
HKU_API Operand operator>= (price_t val, const Operand &op)
 
HKU_API Operand operator<= (const Operand &op, price_t val)
 
HKU_API Operand operator<= (price_t val, const Operand &op)
 
HKU_API Operand operator== (const Operand &op, price_t val)
 
HKU_API Operand operator== (price_t val, const Operand &op)
 
HKU_API Operand operator!= (const Operand &op, price_t val)
 
HKU_API Operand operator!= (price_t val, const Operand &op)
 
HKU_API Operand OP_AND (const Operand &op1, const Operand &op2)
 
HKU_API Operand OP_AND (const Operand &op, price_t val)
 
HKU_API Operand OP_AND (price_t val, const Operand &op)
 
HKU_API Operand OP_OR (const Operand &op1, const Operand &op2)
 
HKU_API Operand OP_OR (const Operand &op, price_t val)
 
HKU_API Operand OP_OR (price_t val, const Operand &op)
 
HKU_API std::ostream & operator<< (std::ostream &os, const KData &kdata)
 输出KData信息 更多...
 
KQuery KQueryByIndex (hku_int64 start=0, hku_int64 end=Null< hku_int64 >(), KQuery::KType dataType=KQuery::DAY, KQuery::RecoverType recoverType=KQuery::NO_RECOVER)
 构造按索引方式K线查询,范围[start, end) 更多...
 
KQuery KQueryByDate (const Datetime &start=Datetime::min(), const Datetime &end=Null< Datetime >(), KQuery::KType dataType=KQuery::DAY, KQuery::RecoverType recoverType=KQuery::NO_RECOVER)
 构造按日期方式K线查询,范围[startDatetime, endDatetime) 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const KQuery &query)
 输出KQuery信息,如:KQuery(start, end, queryType, kType, recoverType) 更多...
 
bool operator== (const KQuery &, const KQuery &)
 
bool operator!= (const KQuery &, const KQuery &)
 
HKU_API std::ostream & operator<< (std::ostream &, const KRecord &)
 输出KRecord信息,如:KRecord(datetime, open, high, low, close, transAmount, count) 更多...
 
bool HKU_API operator== (const KRecord &d1, const KRecord &d2)
 比较两个KRecord是否相等,一般仅测试时使用 更多...
 
LOG_LEVEL get_log_level ()
 获取当前日志级别 更多...
 
void set_log_level (LOG_LEVEL)
 设置日志级别 更多...
 
void init_logger (const std::string &configue_name)
 初始化 LOGGER 更多...
 
HKU_API std::ostream & operator<< (std::ostream &, const MarketInfo &)
 输出市场信息,如: MarketInfo(SH, 上海证劵交易所, 上海市场, 000001, 2011-Dec-06 00:00:00) 更多...
 
bool operator== (const MarketInfo &m1, const MarketInfo &m2)
 相等比较 更多...
 
bool operator!= (const MarketInfo &m1, const MarketInfo &m2)
 不等比较 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const Stock &stock)
 输出Stock信息,如:Stock(market, code, name, type, valid, startDatetime, lastDatetime) 更多...
 
bool operator< (const Stock &s1, const Stock &s2)
 
Parameter default_preload_param ()
 
Parameter default_other_param ()
 
HKU_API std::ostream & operator<< (std::ostream &, const StockTypeInfo &)
 输出证券类型信息,如:StockTypeInfo(type, description, tick, precision, minTradeNumber, maxTradeNumber) 更多...
 
bool operator== (const StockTypeInfo &m1, const StockTypeInfo &m2)
 相等比较 更多...
 
bool operator!= (const StockTypeInfo &m1, const StockTypeInfo &m2)
 不等比较 更多...
 
HKU_API std::ostream & operator<< (std::ostream &, const StockWeight &)
 输出权息信息,如:Weight(datetime, countAsGift, countForSell, priceForSell, bonus, increasement, totalCount, freeCount) 更多...
 
bool operator== (const StockWeight &, const StockWeight &)
 
bool operator!= (const StockWeight &, const StockWeight &)
 
bool operator> (const StockWeight &, const StockWeight &)
 
bool operator< (const StockWeight &, const StockWeight &)
 
bool operator>= (const StockWeight &, const StockWeight &)
 
bool operator<= (const StockWeight &, const StockWeight &)
 
HKU_API std::ostream & operator<< (std::ostream &, const TimeLineRecord &)
 输出TimeLineRecord信息,如:TimeSharingRecord(datetime, price, vol) 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const TimeLineList &)
 输出TimeLine信息 更多...
 
bool HKU_API operator== (const TimeLineRecord &d1, const TimeLineRecord &d2)
 比较两个TimeLineRecord是否相等,一般仅测试时使用 更多...
 
Indicator HKU_API AmaSpecial (const Block &block, KQuery query, Indicator ama)
 
HKU_API std::ostream & operator<< (std::ostream &os, const BorrowRecord &bor)
 
HKU_API std::ostream & operator<< (std::ostream &os, const CostRecord &)
 输出成本信息 更多...
 
bool HKU_API operator== (const CostRecord &d1, const CostRecord &d2)
 
TradeManagerPtr HKU_API crtTM (const Datetime &datetime=Datetime(199001010000LL), price_t initcash=100000.0, const TradeCostPtr &costfunc=TC_Zero(), const string &name="SYS")
 创建交易管理模块,管理帐户的交易记录及资金使用情况 更多...
 
TradeCostPtr HKU_API TC_FixedA (price_t commission=0.0018, price_t lowestCommission=5.0, price_t stamptax=0.001, price_t transferfee=0.001, price_t lowestTransferfee=1.0)
 沪深A股交易成本算法,计算每次买入或卖出的成本 更多...
 
TradeCostPtr HKU_API TC_FixedA2015 (price_t commission=0.0018, price_t lowestCommission=5.0, price_t stamptax=0.001, price_t transferfee=0.00002)
 2015年8月1日后沪深A股交易成本算法,计算每次买入或卖出的成本 更多...
 
TradeCostPtr HKU_API TC_FixedA2017 (price_t commission=0.0018, price_t lowestCommission=5.0, price_t stamptax=0.001, price_t transferfee=0.00002)
 2015年8月1日后沪深A股交易成本算法,计算每次买入或卖出的成本 2017年1月1日后深市也开始收取过户费 更多...
 
HKU_API TradeCostPtr TC_TestStub ()
 
TradeCostPtr HKU_API TC_Zero ()
 创建零成本算法实例 更多...
 
HKU_API std::ostream & operator<< (std::ostream &, const FundsRecord &)
 输出TradeRecord信息 更多...
 
bool HKU_API operator== (const FundsRecord &d1, const FundsRecord &d2)
 
HKU_API std::ostream & operator<< (std::ostream &os, const LoanRecord &record)
 
HKU_API std::ostream & operator<< (std::ostream &os, const OrderBrokerBase &)
 
HKU_API std::ostream & operator<< (std::ostream &os, const OrderBrokerPtr &)
 
HKU_API std::ostream & operator<< (std::ostream &, const PositionRecord &)
 输出持仓记录信息 更多...
 
bool HKU_API operator== (const PositionRecord &d1, const PositionRecord &d2)
 
HKU_API std::ostream & operator<< (std::ostream &os, const TradeCostBase &tc)
 
HKU_API std::ostream & operator<< (std::ostream &os, const TradeCostPtr &tc)
 
HKU_API std::ostream & operator<< (std::ostream &os, const TradeManager &tm)
 
HKU_API std::ostream & operator<< (std::ostream &os, const TradeManagerPtr &ptm)
 
string HKU_API getBusinessName (BUSINESS)
 获取业务名称,用于打印输出 更多...
 
BUSINESS HKU_API getBusinessEnum (const string &)
 根据字符串获取相应的BUSINESS枚举值 更多...
 
HKU_API std::ostream & operator<< (std::ostream &, const TradeRecord &)
 输出TradeRecord信息 更多...
 
bool HKU_API operator== (const TradeRecord &d1, const TradeRecord &d2)
 
HKU_API std::ostream & operator<< (std::ostream &os, const AllocateFundsBase &af)
 
HKU_API std::ostream & operator<< (std::ostream &os, const AFPtr &af)
 
AFPtr HKU_API AF_EqualWeight ()
 
HKU_API std::ostream & operator<< (std::ostream &os, const SystemWeight &sw)
 
HKU_API std::ostream & operator<< (std::ostream &os, const ConditionBase &cn)
 
HKU_API std::ostream & operator<< (std::ostream &os, const ConditionPtr &cn)
 
CNPtr HKU_API CN_OPLine (const Operand &op)
 固定使用股票最小交易量进行交易,计算权益曲线的op值,当权益曲线高于op时,系统有效,否则无效。 更多...
 
EVPtr HKU_API EV_TwoLine (const Operand &fast, const Operand &slow, const string &market)
 快慢线判断策略,市场指数的快线大于慢线时,市场有效,否则无效。 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const EnvironmentBase &en)
 
HKU_API std::ostream & operator<< (std::ostream &os, const EnvironmentPtr &)
 输出Environment信息,如:Environment(name, params[...]) 更多...
 
MoneyManagerPtr HKU_API MM_FixedCapital (double capital=10000.00)
 
MoneyManagerPtr HKU_API MM_FixedCount (int n=100)
 固定交易数量资金管理策略 更多...
 
MoneyManagerPtr HKU_API MM_FixedPercent (double p)
 百分比风险模型 更多...
 
MoneyManagerPtr HKU_API MM_FixedRisk (double risk=1000.00)
 
MoneyManagerPtr HKU_API MM_FixedUnits (int n=33)
 
MoneyManagerPtr HKU_API MM_Nothing ()
 不做资金管理,有多少钱买多少 更多...
 
MoneyManagerPtr HKU_API MM_WilliamsFixedRisk (double p=0.1, price_t max_loss=1000.0)
 
HKU_API std::ostream & operator<< (std::ostream &os, const MoneyManagerBase &mm)
 
HKU_API std::ostream & operator<< (std::ostream &os, const MoneyManagerPtr &mm)
 
PortfolioPtr HKU_API PF_Simple (const TMPtr &tm=TradeManagerPtr(), const SEPtr &st=SE_Fixed(), const AFPtr &af=AF_EqualWeight())
 
HKU_API std::ostream & operator<< (std::ostream &os, const Portfolio &pf)
 
HKU_API std::ostream & operator<< (std::ostream &os, const PortfolioPtr &pf)
 
ProfitGoalPtr HKU_API PG_FixedHoldDays (int days=5)
 固定持仓天数盈利目标策略 更多...
 
ProfitGoalPtr HKU_API PG_FixedPercent (double p=0.2)
 固定百分比盈利目标,目标价格 = 买入价格 * (1 + p) 更多...
 
ProfitGoalPtr HKU_API PG_NoGoal ()
 无盈利目标策略,通常为了进行测试或对比 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const ProfitGoalBase &pg)
 
HKU_API std::ostream & operator<< (std::ostream &os, const ProfitGoalPtr &pg)
 
SelectorPtr HKU_API SE_Fixed ()
 
SelectorPtr HKU_API SE_Fixed (const StockList &stock_list, const SystemPtr &sys)
 
HKU_API std::ostream & operator<< (std::ostream &os, const SelectorBase &st)
 
HKU_API std::ostream & operator<< (std::ostream &os, const SelectorPtr &st)
 
SignalPtr HKU_API SG_Bool (const Operand &buy, const Operand &sell, const string &kpart="CLOSE")
 布尔信号指示器 更多...
 
SignalPtr HKU_API SG_Cross (const Operand &fast, const Operand &slow, const string &kpart="CLOSE")
 双线交叉指示器,当快线从下向上穿越慢线时,买入;当快线从上向下穿越慢线时,卖出。 更多...
 
SignalPtr HKU_API SG_CrossGold (const Operand &fast, const Operand &slow, const string &kpart="CLOSE")
 金叉指示器,当快线从下向上穿越慢线且快线和慢线的方向都是向上时为金叉,买入; 当快线从上向下穿越慢线且快线和慢线的方向都是向下时死叉,卖出。 更多...
 
SignalPtr HKU_API SG_Flex (const Operand &op, int slow_n, const string &kpart="CLOSE")
 自交叉单线拐点指示器。 使用自身的EMA(slow_n)作为慢线,自身作为快线,快线向上穿越慢线买入,快线向下穿越慢线卖出。 更多...
 
SignalPtr HKU_API SG_Single (const Operand &ind, int filter_n=20, double filter_p=0.1, const string &kpart="CLOSE")
 单线拐点信号指示器 更多...
 
SignalPtr HKU_API SG_Single2 (const Operand &ind, int filter_n=20, double filter_p=0.1, const string &kpart="CLOSE")
 单线拐点信号指示器2 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const SignalBase &sg)
 
HKU_API std::ostream & operator<< (std::ostream &os, const SignalPtr &sg)
 
SlippagePtr HKU_API SP_FixedPercent (double p=0.001)
 固定百分比移滑价差算法 更多...
 
SlippagePtr HKU_API SP_FixedValue (double value=0.01)
 固定价格移滑价差算法 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const SlippageBase &sp)
 
HKU_API std::ostream & operator<< (std::ostream &os, const SlippagePtr &sp)
 
StoplossPtr HKU_API ST_FixedPercent (double p=0.03)
 固定百分比止损策略,即当价格低于买入价格的某一百分比时止损 更多...
 
StoplossPtr HKU_API ST_Indicator (const Operand &op, const string &kpart="CLOSE")
 
StoplossPtr HKU_API ST_Saftyloss (int n1=10, int n2=3, double p=2.0)
 亚历山大 艾尔德安全地带止损 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const StoplossBase &sl)
 
HKU_API std::ostream & operator<< (std::ostream &os, const StoplossPtr &sl)
 
SystemPtr HKU_API SYS_Simple (const TradeManagerPtr &tm=TradeManagerPtr(), const MoneyManagerPtr &mm=MoneyManagerPtr(), const EnvironmentPtr &ev=EnvironmentPtr(), const ConditionPtr &cn=ConditionPtr(), const SignalPtr &sg=SignalPtr(), const StoplossPtr &sl=StoplossPtr(), const StoplossPtr &tp=StoplossPtr(), const ProfitGoalPtr &pg=ProfitGoalPtr(), const SlippagePtr &sp=SlippagePtr())
 生成简单系统实例 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const System &sys)
 
HKU_API std::ostream & operator<< (std::ostream &os, const SystemPtr &sys)
 
string HKU_API getSystemPartName (int part)
 获取SystemPart枚举值的字符串名称 更多...
 
SystemPart HKU_API getSystemPartEnum (const string &name)
 通过字符串名称获取SystemPart枚举值 更多...
 
HKU_API std::ostream & operator<< (std::ostream &, const TransRecord &)
 输出 TransRecord 信息,如:TimeSharingRecord(datetime, price, vol) 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const TransList &)
 输出 TransList 信息 更多...
 
bool HKU_API operator== (const TransRecord &d1, const TransRecord &d2)
 比较两个 TransRecord 是否相等,一般仅测试时使用 更多...
 
HKU_API std::ostream & operator<< (std::ostream &os, const Parameter &param)
 
HKU_API bool operator== (const Parameter &p1, const Parameter &p2)
 
HKU_API bool operator!= (const Parameter &p1, const Parameter &p2)
 
HKU_API bool operator< (const Parameter &p1, const Parameter &p2)
 
double HKU_API roundEx (double number, int ndigits=0)
 四舍五入,和python中的round行为一样 更多...
 
double HKU_API roundUp (double number, int ndigits=0)
 向上截取,如10.1截取后为11 更多...
 
double HKU_API roundDown (double number, int ndigits=0)
 向下截取,如10.1截取后为10 更多...
 
string HKU_API utf8_to_gb (const string &szinput)
 
string HKU_API gb_to_utf8 (const string &szinput)
 

变量

class HKU_API Indicator
 
class HKU_API StockManager
 
class HKU_API KData
 

详细描述

Hikyuu核心命名空间,包含股票数据的管理、指标实现、交易系统框架等

类型定义说明

typedef shared_ptr<AllocateFundsBase> hku::AFPtr
typedef shared_ptr<ConditionBase> hku::CNPtr
typedef shared_ptr<EnvironmentBase> hku::EVPtr
typedef shared_ptr<H5::H5File> hku::H5FilePtr
typedef shared_ptr<IndicatorImp> hku::IndicatorImpPtr
typedef shared_ptr< KDataDriver > hku::KDataDriverPtr
typedef shared_ptr<KDataImp> hku::KDataImpPtr
typedef vector<string> hku::MarketList
typedef shared_ptr<MoneyManagerBase> hku::MMPtr
typedef Operand hku::OP
typedef shared_ptr<OperandNode> hku::OperandNodePtr
typedef shared_ptr<Portfolio> hku::PFPtr
typedef shared_ptr<ProfitGoalBase> hku::PGPtr
typedef shared_ptr<SelectorBase> hku::SEPtr
typedef shared_ptr<SignalBase> hku::SGPtr
typedef shared_ptr<SlippageBase> hku::SPPtr
typedef shared_ptr<StoplossBase> hku::StoplossPtr

客户程序都应使用该指针类型,操作止损策略实例

typedef shared_ptr<StoplossBase> hku::STPtr
typedef shared_ptr<System> hku::SYSPtr
typedef vector<SystemPtr> hku::SystemList
typedef shared_ptr<StoplossBase> hku::TakeProfitPtr
typedef shared_ptr<TradeManager> hku::TMPtr
typedef shared_ptr<StoplossBase> hku::TPPtr
typedef shared_ptr<TransList> hku::TransRecordListPtr

枚举类型说明

枚举值
DEBUG 
TRACE 
INFO 
WARN 
ERROR 
FATAL 
NO_PRINT 

函数说明

AFPtr HKU_API hku::AF_EqualWeight ( )
Indicator HKU_API hku::AmaSpecial ( const Block block,
KQuery  query,
Indicator  ama 
)
Indicator HKU_API hku::AMO ( const KData kdata)
Indicator HKU_API hku::AMO ( const Indicator kdata)
Indicator HKU_API hku::CLOSE ( const KData kdata)
Indicator HKU_API hku::CLOSE ( const Indicator kdata)
CNPtr HKU_API hku::CN_OPLine ( const Operand op)

固定使用股票最小交易量进行交易,计算权益曲线的op值,当权益曲线高于op时,系统有效,否则无效。

参数
op
返回
map<string, BaseInfoDriverPtr> hku::default_baseinfo_driver ( )
map<string, BlockInfoDriverPtr> hku::default_block_driver ( )
map<string, KDataDriverPtr> hku::default_kdata_driver ( )
Parameter hku::default_other_param ( )
Parameter hku::default_preload_param ( )
EVPtr HKU_API hku::EV_TwoLine ( const Operand fast,
const Operand slow,
const string market 
)

快慢线判断策略,市场指数的快线大于慢线时,市场有效,否则无效。

参数
快线指标
慢线指标
market市场名称,默认为"SH"
返回
string HKU_API hku::gb_to_utf8 ( const string szinput)
LOG_LEVEL HKU_API hku::get_log_level ( )

获取当前日志级别

返回
BUSINESS HKU_API hku::getBusinessEnum ( const string arg)

根据字符串获取相应的BUSINESS枚举值

DatetimeList HKU_API hku::getDateRange ( const Datetime start,
const Datetime end 
)

获取指定范围的日历日期列表[start, end),仅仅是日,不含时分秒

参数
start起始日期
end结束日期
返回
[start, end)范围内的日历日期
Stock HKU_API hku::getStock ( const string querystr)

获取Stock,目的是封装StockManager,客户端不直接使用StockManager对象

参数
querystr格式:“市场简称证券代码”,如"sh000001"
返回
对应的证券实例,如果实例不存在,则Null<Stock>(),不抛出异常
string HKU_API hku::getVersion ( )

获取Hikyuu当前版本号

返回
版本号
Indicator HKU_API hku::HHV ( int  n = 20)

N日内最高价

参数
nN日时间窗口
Indicator HKU_API hku::HHV ( const Indicator ind,
int  n = 20 
)

N日内最高价

参数
ind待计算的数据
nN日时间窗口
Indicator HKU_API hku::HIGH ( const KData kdata)
Indicator HKU_API hku::HIGH ( const Indicator kdata)
HKU_API Indicator hku::IND_AND ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::IND_AND ( price_t  val,
const Indicator ind 
)
HKU_API Indicator hku::IND_OR ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::IND_OR ( price_t  val,
const Indicator ind 
)
void HKU_API hku::init_logger ( const std::string &  configue_name)

初始化 LOGGER

参数
configue_name配置文件名称
Indicator HKU_API hku::KDATA ( const KData kdata)
Indicator HKU_API hku::KDATA ( const Indicator kdata)
Indicator HKU_API hku::KDATA_PART ( const KData kdata,
const string kpart 
)
Indicator HKU_API hku::KDATA_PART ( const Indicator kdata,
const string kpart 
)
Indicator HKU_API hku::LLV ( int  n = 20)

N日内最低价

参数
nN日时间窗口
Indicator HKU_API hku::LLV ( const Indicator ind,
int  n = 20 
)

N日内最低价

参数
ind待计算的数据
nN日时间窗口
Indicator HKU_API hku::LOW ( const KData kdata)
Indicator HKU_API hku::LOW ( const Indicator kdata)
Indicator HKU_API hku::MA ( int  n,
const string type 
)
MoneyManagerPtr HKU_API hku::MM_FixedCapital ( double  capital = 10000.00)
MoneyManagerPtr HKU_API hku::MM_FixedRisk ( double  risk = 1000.00)
MoneyManagerPtr HKU_API hku::MM_FixedUnits ( int  n = 33)
MoneyManagerPtr HKU_API hku::MM_WilliamsFixedRisk ( double  p = 0.1,
price_t  max_loss = 1000.0 
)
HKU_API Operand hku::OP_AND ( const Operand op1,
const Operand op2 
)
HKU_API Operand hku::OP_AND ( const Operand op,
price_t  val 
)
HKU_API Operand hku::OP_AND ( price_t  val,
const Operand op 
)
HKU_API Operand hku::OP_OR ( const Operand op1,
const Operand op2 
)
HKU_API Operand hku::OP_OR ( const Operand op,
price_t  val 
)
HKU_API Operand hku::OP_OR ( price_t  val,
const Operand op 
)
Indicator HKU_API hku::OPEN ( const KData kdata)
Indicator HKU_API hku::OPEN ( const Indicator kdata)
bool hku::operator!= ( const MarketInfo m1,
const MarketInfo m2 
)
inline

不等比较

bool hku::operator!= ( const StockWeight m1,
const StockWeight m2 
)
inline
bool hku::operator!= ( const StockTypeInfo m1,
const StockTypeInfo m2 
)
inline

不等比较

HKU_API bool hku::operator!= ( const Parameter p1,
const Parameter p2 
)
bool hku::operator!= ( const Datetime d1,
const Datetime d2 
)
inline
bool hku::operator!= ( const KQuery q1,
const KQuery q2 
)
inline
HKU_API Operand hku::operator!= ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator!= ( price_t  val,
const Operand op 
)
HKU_API Indicator hku::operator!= ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator!= ( price_t  val,
const Indicator ind 
)
HKU_API Operand hku::operator* ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator* ( price_t  val,
const Operand op 
)
HKU_API Indicator hku::operator* ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator* ( price_t  val,
const Indicator ind 
)
HKU_API Indicator hku::operator+ ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator+ ( price_t  val,
const Indicator ind 
)
HKU_API Operand hku::operator+ ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator+ ( price_t  val,
const Operand op 
)
HKU_API Operand hku::operator- ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator- ( price_t  val,
const Operand op 
)
HKU_API Indicator hku::operator- ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator- ( price_t  val,
const Indicator ind 
)
HKU_API Operand hku::operator/ ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator/ ( price_t  val,
const Operand op 
)
HKU_API Indicator hku::operator/ ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator/ ( price_t  val,
const Indicator ind 
)
bool hku::operator< ( const StockWeight m1,
const StockWeight m2 
)
inline
HKU_API bool hku::operator< ( const Parameter p1,
const Parameter p2 
)
bool hku::operator< ( const Datetime d1,
const Datetime d2 
)
inline
HKU_API Operand hku::operator< ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator< ( price_t  val,
const Operand op 
)
bool hku::operator< ( const Stock s1,
const Stock s2 
)
inline
HKU_API Indicator hku::operator< ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator< ( price_t  val,
const Indicator ind 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const EnvironmentBase en 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const StoplossBase sl 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const System sys 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const MoneyManagerBase mm 
)
HKU_API std::ostream& hku::operator<< ( std::ostream &  os,
const Indicator indicator 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const LoanRecord record 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const TradeCostBase tc 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const SystemWeight sw 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const ProfitGoalBase pg 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const SelectorBase st 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const SignalBase sg 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const SlippageBase sp 
)
HKU_API std::ostream& hku::operator<< ( std::ostream &  os,
const Parameter param 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const KDataDriver driver 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  out,
const Datetime d 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const BaseInfoDriver driver 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const BorrowRecord bor 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const BlockInfoDriver driver 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const AllocateFundsBase af 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const ConditionBase cn 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const Block blk 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const IndicatorImp imp 
)
HKU_API std::ostream& hku::operator<< ( std::ostream &  os,
const Operand op 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const Portfolio pf 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const SignalPtr sg 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const MoneyManagerPtr mm 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const StoplossPtr sl 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const ProfitGoalPtr pg 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const SelectorPtr st 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const TradeCostPtr tc 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const SlippagePtr sp 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const KDataDriverPtr driver 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const BaseInfoDriverPtr driver 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const AFPtr af 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const ConditionPtr cn 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const BlockInfoDriverPtr driver 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const IndicatorImpPtr imp 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const TradeManager tm 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const PortfolioPtr pf 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const SystemPtr sys 
)
HKU_API std::ostream & hku::operator<< ( std::ostream &  os,
const TradeManagerPtr ptm 
)
bool hku::operator<= ( const StockWeight m1,
const StockWeight m2 
)
inline
bool hku::operator<= ( const Datetime d1,
const Datetime d2 
)
inline
HKU_API Operand hku::operator<= ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator<= ( price_t  val,
const Operand op 
)
HKU_API Indicator hku::operator<= ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator<= ( price_t  val,
const Indicator ind 
)
bool HKU_API hku::operator== ( const CostRecord d1,
const CostRecord d2 
)
bool HKU_API hku::operator== ( const FundsRecord d1,
const FundsRecord d2 
)
bool hku::operator== ( const MarketInfo m1,
const MarketInfo m2 
)
inline

相等比较

bool hku::operator== ( const StockWeight m1,
const StockWeight m2 
)
inline
bool hku::operator== ( const StockTypeInfo m1,
const StockTypeInfo m2 
)
inline

相等比较

bool HKU_API hku::operator== ( const PositionRecord d1,
const PositionRecord d2 
)
HKU_API bool hku::operator== ( const Parameter p1,
const Parameter p2 
)
bool HKU_API hku::operator== ( const TradeRecord d1,
const TradeRecord d2 
)
bool hku::operator== ( const Datetime d1,
const Datetime d2 
)
inline
bool hku::operator== ( const KQuery q1,
const KQuery q2 
)
inline
HKU_API Operand hku::operator== ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator== ( price_t  val,
const Operand op 
)
HKU_API Indicator hku::operator== ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator== ( price_t  val,
const Indicator ind 
)
bool hku::operator> ( const StockWeight m1,
const StockWeight m2 
)
inline
HKU_API Operand hku::operator> ( const Operand op,
price_t  val 
)
bool hku::operator> ( const Datetime d1,
const Datetime d2 
)
inline
HKU_API Operand hku::operator> ( price_t  val,
const Operand op 
)
HKU_API Indicator hku::operator> ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator> ( price_t  val,
const Indicator ind 
)
bool hku::operator>= ( const StockWeight m1,
const StockWeight m2 
)
inline
bool hku::operator>= ( const Datetime d1,
const Datetime d2 
)
inline
HKU_API Operand hku::operator>= ( const Operand op,
price_t  val 
)
HKU_API Operand hku::operator>= ( price_t  val,
const Operand op 
)
HKU_API Indicator hku::operator>= ( const Indicator ind,
price_t  val 
)
HKU_API Indicator hku::operator>= ( price_t  val,
const Indicator ind 
)
PortfolioPtr HKU_API hku::PF_Simple ( const TMPtr tm = TradeManagerPtr(),
const SEPtr st = SE_Fixed(),
const AFPtr af = AF_EqualWeight() 
)
ProfitGoalPtr HKU_API hku::PG_FixedPercent ( double  p = 0.2)

固定百分比盈利目标,目标价格 = 买入价格 * (1 + p)

参数
p百分比
返回
PGPtr
ProfitGoalPtr HKU_API hku::PG_NoGoal ( )

无盈利目标策略,通常为了进行测试或对比

返回
PGPtr
Indicator HKU_API hku::POS ( const Block block,
KQuery  query,
SignalPtr  sg 
)
double HKU_API hku::roundDown ( double  number,
int  ndigits = 0 
)

向下截取,如10.1截取后为10

参数
number待处理数据
ndigits保留小数位数
返回
处理过的数据
double HKU_API hku::roundEx ( double  number,
int  ndigits = 0 
)

四舍五入,和python中的round行为一样

参数
number待四舍五入的数据
ndigits保留小数位数
返回
处理过的数据
double HKU_API hku::roundUp ( double  number,
int  ndigits = 0 
)

向上截取,如10.1截取后为11

参数
number待处理数据
ndigits保留小数位数
返回
处理过的数据
SelectorPtr HKU_API hku::SE_Fixed ( )
SelectorPtr HKU_API hku::SE_Fixed ( const StockList stock_list,
const SystemPtr sys 
)
void HKU_API hku::set_log_level ( LOG_LEVEL  )

设置日志级别

参数
指定的日志级别
Indicator HKU_API hku::SMA ( int  n = 22)
SlippagePtr HKU_API hku::SP_FixedPercent ( double  p = 0.001)

固定百分比移滑价差算法

买入实际价格 = 计划买入价格 * (1 + p),卖出实际价格 = 计划卖出价格 * (1 - p)

参数
p偏移的固定百分比
返回
SPPtr
SlippagePtr HKU_API hku::SP_FixedValue ( double  value = 0.01)

固定价格移滑价差算法

买入实际价格 = 计划买入价格 + 偏移价格,卖出实际价格 = 计划卖出价格 - 偏移价格

参数
value
返回
StoplossPtr HKU_API hku::ST_Indicator ( const Operand op,
const string kpart = "CLOSE" 
)
HKU_API TradeCostPtr hku::TC_TestStub ( )
Indicator HKU_API hku::VIGOR ( const Indicator ind,
int  n = 2 
)
Indicator HKU_API hku::VIGOR ( int  n = 2)
Indicator HKU_API hku::VOL ( const KData kdata)
Indicator HKU_API hku::VOL ( const Indicator kdata)
Indicator HKU_API hku::WEAVE ( )

变量说明