Hikyuu
|
盈利目标策略基类 更多...
#include <ProfitGoalBase.h>
Public 类型 | |
typedef shared_ptr< ProfitGoalBase > | ProfitGoalPtr |
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 |
盈利目标策略基类
交易前确定盈利目标,用于系统在价格达到盈利目标时执行卖出
typedef shared_ptr<ProfitGoalBase> hku::ProfitGoalBase::ProfitGoalPtr |
hku::ProfitGoalBase::ProfitGoalBase | ( | ) |
hku::ProfitGoalBase::ProfitGoalBase | ( | const string & | name | ) |
|
virtual |
|
pure virtual |
子类计算接口,由setTO调用
|
pure virtual |
子类克隆接口
|
inlinevirtual |
子类复位接口
|
inlinevirtual |
接收实际交易变化情况
ProfitGoalPtr hku::ProfitGoalBase::clone | ( | ) |
克隆接口
|
pure virtual |
买入时计算目标价格
datetime | 买入时间 |
price | 买入价格 |
返回0,表示未设目标
|
inline |
获取账户
|
inline |
获取交易对象
|
inline |
获取名称
|
inline |
设置名称
|
inline |
复位操作
|
inlinevirtual |
接收实际交易变化情况
|
inline |
设置账户
void hku::ProfitGoalBase::setTO | ( | const KData & | kdata | ) |
设置交易对象
|
friend |
|
protected |
|
protected |
|
protected |