algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
bind.hpp File Reference

Factories that bind a strategy to a broker session in one call: bind, bind_journaled and bind_observer. More...

#include "./session_executor.hpp"
#include "../runner/journal.hpp"
#include "../runner/runner.hpp"
#include <cstddef>
#include <utility>
Include dependency graph for bind.hpp:

Go to the source code of this file.

Namespaces

namespace  algotradelib
 The library: broker-neutral types (core), and the modules below.
namespace  algotradelib::live
 Connects a runner to a broker session for live trading.

Typedefs

template<typename Strategy, typename Session>
using algotradelib::live::BoundRunner
 The runner type bind returns.
template<typename Strategy, typename Session>
using algotradelib::live::ObservingRunner
 The runner type bind_observer returns: the same capabilities and tag, sending nowhere.
template<typename Strategy, typename Session, typename Journal, typename Clock = runner::SteadyClock>
using algotradelib::live::JournaledRunner
 The runner type bind_journaled returns: the same pipeline, journaling before it sends.

Functions

template<typename Strategy, typename Session>
BoundRunner< Strategy, Session > algotradelib::live::bind (Session &session, Strategy strategy, strategy::RiskLimits limits={}, std::size_t series_capacity=default_series_capacity, Venue default_route=Venue::UNSPECIFIED)
 Binds a strategy to a broker session, so its instructions are sent to the broker.
template<typename Strategy, typename Session, typename Journal, typename Clock = runner::SteadyClock>
JournaledRunner< Strategy, Session, Journal, Clock > algotradelib::live::bind_journaled (Session &session, Journal &journal, Strategy strategy, strategy::RiskLimits limits={}, std::size_t series_capacity=default_series_capacity, Venue default_route=Venue::UNSPECIFIED, Clock clock={})
 Binds a strategy to a broker session, recording every instruction in a journal before it is sent.
template<typename Strategy, typename Session>
ObservingRunner< Strategy, Session > algotradelib::live::bind_observer (Session &session, Strategy strategy, strategy::RiskLimits limits={}, std::size_t series_capacity=default_series_capacity)
 Binds a strategy for observation: the session's capabilities and broker tag, and nothing to send through.

Variables

constexpr std::size_t algotradelib::live::default_series_capacity = 512
 The number of trailing bars per instrument a bound runner keeps by default.

Detailed Description

Factories that bind a strategy to a broker session in one call: bind, bind_journaled and bind_observer.

Each reads the capabilities and broker tag off the session, so a runner cannot pair one broker's tag with another's capabilities.

Definition in file bind.hpp.