hikyuu2/libs/hikyuu/trade_manage/Performance.h

48 lines
969 B
C++
Raw Normal View History

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();
double get(const string& name) const;
double operator[](const string& name) const { return get(name); }
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_ */