Slick Trader
0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
Loading...
Searching...
No Matches
ladder_subscription_event.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
slick-trader/events/event.hpp
>
4
#include <cstdint>
5
#include <type_traits>
6
7
namespace
slick::trader
{
8
9
// The feeds MANUAL holds of an instrument for a ladder, as bits: its level 2 book, and its trades
10
// for the LTQ column. The WebServer skips any feed a strategy already streams.
11
enum
LadderFeed
: uint8_t {
12
LADDER_BOOK
= 1,
13
LADDER_TRADES
= 2,
14
LADDER_ALL
=
LADDER_BOOK
|
LADDER_TRADES
,
15
};
16
17
// Sent by the WebServer over the event bus. MANUAL holds the `feeds` of the event's instrument at
18
// its broker while a ladder shows it (`subscribe`), and releases what it held otherwise.
19
#pragma pack(push, 1)
20
struct
LadderSubscriptionEvent
:
public
Event
{
21
bool
subscribe
;
22
uint8_t
feeds
;
// LadderFeed bits, read only on a hold
23
24
LadderSubscriptionEvent
() :
Event
(
EventType
::
LADDER_SUBSCRIPTION
),
subscribe
(true),
feeds
(
LADDER_ALL
) {}
25
};
26
#pragma pack(pop)
27
28
static_assert
(std::is_trivially_copyable_v<LadderSubscriptionEvent>,
"LadderSubscriptionEvent must be trivially copyable"
);
29
30
}
// namespace slick::trader
event.hpp
slick::trader
Definition
coinbase_broker.hpp:11
slick::trader::EventType
EventType
Definition
event.hpp:26
slick::trader::EventType::LADDER_SUBSCRIPTION
@ LADDER_SUBSCRIPTION
Definition
event.hpp:51
slick::trader::LadderFeed
LadderFeed
Definition
ladder_subscription_event.hpp:11
slick::trader::LADDER_ALL
@ LADDER_ALL
Definition
ladder_subscription_event.hpp:14
slick::trader::LADDER_TRADES
@ LADDER_TRADES
Definition
ladder_subscription_event.hpp:13
slick::trader::LADDER_BOOK
@ LADDER_BOOK
Definition
ladder_subscription_event.hpp:12
slick::trader::Event::Event
Event(EventType t=EventType::TRADE)
Definition
event.hpp:63
slick::trader::LadderSubscriptionEvent::subscribe
bool subscribe
Definition
ladder_subscription_event.hpp:21
slick::trader::LadderSubscriptionEvent::feeds
uint8_t feeds
Definition
ladder_subscription_event.hpp:22
slick::trader::LadderSubscriptionEvent::LadderSubscriptionEvent
LadderSubscriptionEvent()
Definition
ladder_subscription_event.hpp:24
slick-trader
events
ladder_subscription_event.hpp
Generated by
1.15.0