algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::runner::DataEvent< T > Struct Template Reference

A record of data from outside the broker, delivered to on_data. More...

#include <algotradelib/src/strategy/event.hpp>

Public Attributes

std::chrono::system_clock::time_point known_at_ {}
 When the record became known: the earliest moment a strategy may see it, as BarEvent::period_end_ is for a bar.
T record_
 The record.

Detailed Description

template<typename T>
struct algotradelib::runner::DataEvent< T >

A record of data from outside the broker, delivered to on_data.

What the record holds is the strategy's own type: its source, the instrument it is about, the date it describes and its values are whatever the strategy decides to use. The library reads only when the record became known, to order it with the bars and to date what the strategy decides on it.

Template Parameters
TThe record type, the strategy's data_type.

Definition at line 856 of file event.hpp.

Member Data Documentation

◆ known_at_

template<typename T>
std::chrono::system_clock::time_point algotradelib::strategy::DataEvent< T >::known_at_ {}

When the record became known: the earliest moment a strategy may see it, as BarEvent::period_end_ is for a bar.

In a backtest it is the caller's statement of when the record was available; in a live run (runner::PollingLoop::set_data_poll) it is when the loop received it, never earlier.

Definition at line 864 of file event.hpp.

◆ record_

template<typename T>
T algotradelib::strategy::DataEvent< T >::record_

The record.

Definition at line 866 of file event.hpp.


The documentation for this struct was generated from the following file: