Slick Trader 0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
Loading...
Searching...
No Matches
slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key > Class Template Reference

#include <slick-trader/brokers/common/order_book_publisher.hpp>

Collaboration diagram for slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >:

Classes

struct  InstrumentState

Public Types

enum class  Listing : uint8_t { LISTED , PENDING , UNKNOWN }

Public Member Functions

Listing subscribe (std::string_view symbol, SubscriptionType type)
void unsubscribe (std::string_view symbol, SubscriptionType type)
const Instrument * find (std::string_view symbol) const
bool instruments_known () const noexcept

Protected Member Functions

 OrderBookPublisher (Sink &sink, std::string who)
InstrumentState & add_instrument (Key key, Instrument instrument)
void instruments_complete ()
InstrumentState * state_of (Key key)
std::unordered_map< Key, InstrumentState > & states () noexcept
Sink & sink () noexcept
const std::string & who () const noexcept
void reserve_instruments (size_t n)
void apply_order (Key key, const BookOrderChange &u, bool publish_order=true)
void trade (Key key, int64_t wire_price, int64_t lots, Side aggressor, uint64_t event_time)
void end_of_event ()
void set_status (InstrumentState &state, TradingStatus status, bool cancel_allowed, std::string_view reason, uint64_t event_time)
void book_gap ()
void clear_books ()
void book_rebuilt ()

Detailed Description

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
class slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >

Definition at line 63 of file order_book_publisher.hpp.

Member Enumeration Documentation

◆ Listing

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
enum class slick::trader::OrderBookPublisher::Listing : uint8_t
strong
Enumerator
LISTED 
PENDING 
UNKNOWN 

Definition at line 65 of file order_book_publisher.hpp.

Constructor & Destructor Documentation

◆ OrderBookPublisher()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::OrderBookPublisher ( Sink & sink,
std::string who )
inlineprotected

Definition at line 123 of file order_book_publisher.hpp.

References sink(), and who().

Member Function Documentation

◆ add_instrument()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
InstrumentState & slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::add_instrument ( Key key,
Instrument instrument )
inlineprotected

◆ apply_order()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::apply_order ( Key key,
const BookOrderChange & u,
bool publish_order = true )
inlineprotected

◆ book_gap()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::book_gap ( )
inlineprotected

Definition at line 242 of file order_book_publisher.hpp.

References slick::trader::SharedTopOfBook::UNKNOWN.

Referenced by clear_books().

◆ book_rebuilt()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::book_rebuilt ( )
inlineprotected

Definition at line 265 of file order_book_publisher.hpp.

◆ clear_books()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::clear_books ( )
inlineprotected

Definition at line 252 of file order_book_publisher.hpp.

References book_gap().

◆ end_of_event()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::end_of_event ( )
inlineprotected

Definition at line 196 of file order_book_publisher.hpp.

◆ find()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
const Instrument * slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::find ( std::string_view symbol) const
inlinenodiscard

Definition at line 97 of file order_book_publisher.hpp.

◆ instruments_complete()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::instruments_complete ( )
inlineprotected

Definition at line 135 of file order_book_publisher.hpp.

◆ instruments_known()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
bool slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::instruments_known ( ) const
inlinenodiscardnoexcept

Definition at line 103 of file order_book_publisher.hpp.

◆ reserve_instruments()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::reserve_instruments ( size_t n)
inlineprotected

Definition at line 156 of file order_book_publisher.hpp.

◆ set_status()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::set_status ( InstrumentState & state,
TradingStatus status,
bool cancel_allowed,
std::string_view reason,
uint64_t event_time )
inlineprotected

◆ sink()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
Sink & slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::sink ( )
inlinenodiscardprotectednoexcept

Definition at line 152 of file order_book_publisher.hpp.

Referenced by OrderBookPublisher().

◆ state_of()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
InstrumentState * slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::state_of ( Key key)
inlinenodiscardprotected

Definition at line 147 of file order_book_publisher.hpp.

◆ states()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
std::unordered_map< Key, InstrumentState > & slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::states ( )
inlinenodiscardprotectednoexcept

Definition at line 151 of file order_book_publisher.hpp.

◆ subscribe()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
Listing slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::subscribe ( std::string_view symbol,
SubscriptionType type )
inline

Definition at line 71 of file order_book_publisher.hpp.

References LISTED, PENDING, and UNKNOWN.

◆ trade()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::trade ( Key key,
int64_t wire_price,
int64_t lots,
Side aggressor,
uint64_t event_time )
inlineprotected

Definition at line 181 of file order_book_publisher.hpp.

References slick::trader::lots_to_qty().

◆ unsubscribe()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
void slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::unsubscribe ( std::string_view symbol,
SubscriptionType type )
inline

Definition at line 84 of file order_book_publisher.hpp.

◆ who()

template<typename Derived, typename Instrument, typename Sink, typename Key = int32_t>
const std::string & slick::trader::OrderBookPublisher< Derived, Instrument, Sink, Key >::who ( ) const
inlinenodiscardprotectednoexcept

Definition at line 153 of file order_book_publisher.hpp.

Referenced by OrderBookPublisher().


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