2015-01-07 01:26:14 +08:00
|
|
|
/*
|
|
|
|
* ZeroTradeCost.h
|
|
|
|
*
|
|
|
|
* Created on: 2013-3-3
|
|
|
|
* Author: fasiondog
|
|
|
|
*/
|
|
|
|
|
2019-08-03 21:53:24 +08:00
|
|
|
#pragma once
|
2015-01-07 01:26:14 +08:00
|
|
|
#ifndef ZEROTRADECOST_H_
|
|
|
|
#define ZEROTRADECOST_H_
|
|
|
|
|
|
|
|
#include "../TradeCostBase.h"
|
|
|
|
|
|
|
|
namespace hku {
|
|
|
|
|
|
|
|
class HKU_API ZeroTradeCost: public TradeCostBase {
|
|
|
|
TRADE_COST_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
|
|
|
|
|
|
public:
|
|
|
|
ZeroTradeCost();
|
|
|
|
virtual ~ZeroTradeCost();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 计算买入成本
|
|
|
|
* @param datetime 交易日期
|
|
|
|
* @param stock 交易的证券对象
|
|
|
|
* @param price 买入价格
|
|
|
|
* @param num 买入数量
|
|
|
|
* @return CostRecord 交易成本记录
|
|
|
|
*/
|
|
|
|
virtual CostRecord getBuyCost(const Datetime& datetime,
|
|
|
|
const Stock& stock, price_t price, size_t num) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 计算卖出成本
|
|
|
|
* @param datetime 交易日期
|
|
|
|
* @param stock 交易的证券对象
|
|
|
|
* @param price 卖出价格
|
|
|
|
* @param num 卖出数量
|
|
|
|
* @return CostRecord 交易成本记录
|
|
|
|
*/
|
|
|
|
virtual CostRecord getSellCost(const Datetime& datetime,
|
|
|
|
const Stock& stock, price_t price, size_t num) const;
|
|
|
|
|
|
|
|
/** 子类私有变量克隆接口 */
|
|
|
|
virtual TradeCostPtr _clone();
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace hku */
|
|
|
|
#endif /* ZEROTRADECOST_H_ */
|