|
BetaTrader
A HFT Eco-System
|
Aggregates trade updates into OHLC candles and persists them. More...
#include <CandleAggregator.h>

Classes | |
| struct | Aggregate |
Public Types | |
| using | CandleCallback = std::function< void(int interval, const Candle &)> |
Public Member Functions | |
| CandleAggregator (MarketHistoryRepository &repo) | |
| ~CandleAggregator ()=default | |
| void | onTrade (const std::string &symbol, double price, uint64_t qty, int64_t timestampNs) |
| void | setCandleCallback (CandleCallback cb) |
Private Member Functions | |
| void | updateAggregate (Aggregate &agg, int interval, const std::string &symbol, double price, uint64_t qty, int64_t timestampNs) |
Private Attributes | |
| std::map< std::string, std::map< int, Aggregate > > | mAggregates |
| CandleCallback | mCallback |
| std::mutex | mMutex |
| MarketHistoryRepository & | mRepo |
Aggregates trade updates into OHLC candles and persists them.
| using ohlc::CandleAggregator::CandleCallback = std::function<void(int interval, const Candle&)> |
| ohlc::CandleAggregator::CandleAggregator | ( | MarketHistoryRepository & | repo | ) |
|
default |
| void ohlc::CandleAggregator::onTrade | ( | const std::string & | symbol, |
| double | price, | ||
| uint64_t | qty, | ||
| int64_t | timestampNs | ||
| ) |

|
inline |
|
private |


|
private |
|
private |
|
private |
|
private |