2015-01-07 01:26:14 +08:00
|
|
|
|
/*
|
|
|
|
|
* Performance.h
|
|
|
|
|
*
|
|
|
|
|
* Created on: 2013-4-23
|
|
|
|
|
* Author: fasiondog
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef PERFORMANCE_H_
|
|
|
|
|
#define PERFORMANCE_H_
|
|
|
|
|
|
2016-07-09 22:37:42 +08:00
|
|
|
|
#include <boost/function.hpp>
|
2015-01-07 01:26:14 +08:00
|
|
|
|
#include "TradeManager.h"
|
|
|
|
|
|
|
|
|
|
namespace hku {
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 简单绩效统计
|
|
|
|
|
*/
|
|
|
|
|
class HKU_API Performance {
|
|
|
|
|
public:
|
|
|
|
|
Performance();
|
|
|
|
|
virtual ~Performance();
|
|
|
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
2016-04-03 00:08:31 +08:00
|
|
|
|
string report(const TradeManagerPtr& tm,
|
2015-01-07 01:26:14 +08:00
|
|
|
|
const Datetime& datetime = Datetime::now());
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 根据交易记录,统计截至某一日期的系统绩效, datetime必须大于等于lastDatetime,
|
|
|
|
|
* 以便用于计算当前市值
|
|
|
|
|
*/
|
|
|
|
|
void statistics(const TradeManagerPtr& tm, const Datetime& datetime);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef map<string, double> map_type;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
list<string> m_name_list; //保存指标顺序
|
|
|
|
|
map_type m_result;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} /* namespace hku */
|
|
|
|
|
#endif /* PERFORMANCE_H_ */
|