Slick Trader 0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
Loading...
Searching...
No Matches
ibroker.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <string_view>
5#include <memory>
6#include <slick/stream_buffer_multiplexer.hpp>
9
10namespace slick::trader {
11
12// Forward declarations
14class IOrderConnector;
15
16// Base broker interface
17class IBroker {
18public:
19 virtual ~IBroker() = default;
20
21 // Broker identification
22 virtual BrokerId get_broker_id() const = 0;
23 virtual const char* get_broker_name() const = 0;
24
25 virtual void register_broker() = 0;
26
27 // Lifecycle
28 virtual bool start() = 0;
29 virtual void stop() = 0;
30
31 // Called before the strategies stop, while the broker still processes their requests. A
32 // broker with a policy for what stopping cancels applies it to the cancels the strategies
33 // send as they stop. Does nothing by default.
34 virtual void begin_stop() {}
35
36 // Connector access
37 // virtual std::shared_ptr<IMarketDataConnector> get_market_data_connector() = 0;
38 // virtual std::shared_ptr<IOrderConnector> get_order_connector() = 0;
39
40 // Fee structure for this broker (symbol ignored for exchanges with uniform rates)
41 // Returns zero-rate by default for brokers that report fees directly in fill events
42 virtual FeeStructure get_fees(std::string_view symbol) const { return {}; }
43};
44
45} // namespace slick::trader
virtual void stop()=0
virtual void begin_stop()
Definition ibroker.hpp:34
virtual FeeStructure get_fees(std::string_view symbol) const
Definition ibroker.hpp:42
virtual void register_broker()=0
virtual BrokerId get_broker_id() const =0
virtual ~IBroker()=default
virtual bool start()=0
virtual const char * get_broker_name() const =0