Hikyuu
Public 类型 | Public 成员函数 | Protected 属性 | 友元 | 所有成员列表

盈利目标策略基类 更多...

#include <ProfitGoalBase.h>

类 hku::ProfitGoalBase 继承关系图:
Inheritance graph
[图例]
hku::ProfitGoalBase 的协作图:
Collaboration graph
[图例]

Public 类型

typedef shared_ptr< ProfitGoalBaseProfitGoalPtr
 

Public 成员函数

 ProfitGoalBase ()
 
 ProfitGoalBase (const string &name)
 
virtual ~ProfitGoalBase ()
 
void setTM (const TradeManagerPtr &tm)
 设置账户 更多...
 
TradeManagerPtr getTM () const
 获取账户 更多...
 
void setTO (const KData &kdata)
 设置交易对象 更多...
 
KData getTO () const
 获取交易对象 更多...
 
string name () const
 获取名称 更多...
 
void name (const string &name)
 设置名称 更多...
 
virtual void buyNotify (const TradeRecord &)
 接收实际交易变化情况 更多...
 
virtual void sellNotify (const TradeRecord &)
 接收实际交易变化情况 更多...
 
void reset ()
 复位操作 更多...
 
ProfitGoalPtr clone ()
 克隆接口 更多...
 
virtual price_t getGoal (const Datetime &datetime, price_t price)=0
 买入时计算目标价格 更多...
 
virtual price_t getShortGoal (const Datetime &, price_t)
 返回0,表示未设目标 更多...
 
virtual void _reset ()
 子类复位接口 更多...
 
virtual ProfitGoalPtr _clone ()=0
 子类克隆接口 更多...
 
virtual void _calculate ()=0
 子类计算接口,由setTO调用 更多...
 

Protected 属性

string m_name
 
KData m_kdata
 
TradeManagerPtr m_tm
 

友元

class boost::serialization::access
 

详细描述

盈利目标策略基类

交易前确定盈利目标,用于系统在价格达到盈利目标时执行卖出

成员类型定义说明

构造及析构函数说明

hku::ProfitGoalBase::ProfitGoalBase ( )
hku::ProfitGoalBase::ProfitGoalBase ( const string name)
hku::ProfitGoalBase::~ProfitGoalBase ( )
virtual

成员函数说明

virtual void hku::ProfitGoalBase::_calculate ( )
pure virtual

子类计算接口,由setTO调用

virtual ProfitGoalPtr hku::ProfitGoalBase::_clone ( )
pure virtual

子类克隆接口

virtual void hku::ProfitGoalBase::_reset ( )
inlinevirtual

子类复位接口

virtual void hku::ProfitGoalBase::buyNotify ( const TradeRecord )
inlinevirtual

接收实际交易变化情况

ProfitGoalPtr hku::ProfitGoalBase::clone ( )

克隆接口

virtual price_t hku::ProfitGoalBase::getGoal ( const Datetime datetime,
price_t  price 
)
pure virtual

买入时计算目标价格

参数
datetime买入时间
price买入价格
返回
返回Null<price_t>时,表示未限定目标; 返回0,意味着需要卖出
virtual price_t hku::ProfitGoalBase::getShortGoal ( const Datetime ,
price_t   
)
inlinevirtual

返回0,表示未设目标

TradeManagerPtr hku::ProfitGoalBase::getTM ( ) const
inline

获取账户

KData hku::ProfitGoalBase::getTO ( ) const
inline

获取交易对象

string hku::ProfitGoalBase::name ( ) const
inline

获取名称

void hku::ProfitGoalBase::name ( const string name)
inline

设置名称

void hku::ProfitGoalBase::reset ( )
inline

复位操作

virtual void hku::ProfitGoalBase::sellNotify ( const TradeRecord )
inlinevirtual

接收实际交易变化情况

void hku::ProfitGoalBase::setTM ( const TradeManagerPtr tm)
inline

设置账户

void hku::ProfitGoalBase::setTO ( const KData kdata)

设置交易对象

友元及相关函数文档

friend class boost::serialization::access
friend

类成员变量说明

KData hku::ProfitGoalBase::m_kdata
protected
string hku::ProfitGoalBase::m_name
protected
TradeManagerPtr hku::ProfitGoalBase::m_tm
protected

该类的文档由以下文件生成: