Slick Trader 0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
Loading...
Searching...
No Matches
slick::trader Namespace Reference

Namespaces

namespace  detail
namespace  sim_cli

Classes

class  CoinbaseBroker
class  CoinbaseMDConnector
class  CoinbaseOrderConnector
class  CoinbaseOrderStates
class  StatusLatch
class  FillJournal
class  InstrumentDirectory
struct  KillSwitchCount
class  LevelBook
struct  MdDefinition
class  MdEventWriter
struct  BookOrderChange
class  OrderBookPublisher
class  RateLimiter
class  FeeTable
class  OrderEventWriter
class  ByteTransport
class  StreamAssembler
class  GatedLine
class  PriceScale
struct  SharedTopOfBook
class  SharedTopOfBookStore
struct  SlotStoreFormat
class  SlotStore
class  HyperliquidBroker
class  HyperliquidMDConnector
class  HyperliquidOrderConnector
class  IBroker
class  IMarketDataConnector
class  IOrderConnector
class  BrokerRegistry
 Maps a broker's config name (e.g. More...
struct  BrokerStatus
class  BrokerStatusRegistry
struct  SimControlConfig
class  MdRequestQueues
struct  Order
struct  PnLSnapshot
class  PnLCalculator
struct  Position
struct  PositionLot
class  PositionStore
class  PositionTracker
struct  InstrumentRiskLimits
struct  RiskLimits
class  RiskManager
struct  StrategyConfig
class  StrategyLoader
struct  OrderBookObserverImpl
class  StrategyManager
class  TradingEngine
struct  Event
class  EventSerializer
struct  InstrumentDefinitionEvent
struct  InstrumentStatusEvent
struct  LadderSubscriptionEvent
struct  PriceLevel
struct  Level2UpdateEvent
struct  MboOrder
struct  MboUpdateEvent
struct  MDSubscription
struct  OrderBookPriceLevel
struct  OrderBookEvent
struct  OrderEventBase
struct  OrderEvent
struct  NewOrderEvent
struct  ModifyOrderEvent
struct  CancelOrderEvent
struct  OrderAckEvent
struct  OrderFillEvent
struct  OrderRejectEvent
struct  OrderCancelEvent
struct  PositionUpdateEvent
struct  PnLUpdateEvent
struct  QuoteEvent
struct  RegisterEvent
struct  OrderConnectorRegisterEvent
struct  BrokerRegisterEndEvent
struct  StatusEvent
struct  StrategyConfigEvent
struct  TradeEvent
struct  QueuePosition
class  IStrategy
class  ManualStrategy
class  StrategyBase
struct  FeeStructure
class  MappedFile
struct  StringHash
struct  SubscriptionRequest
class  FillHistory
class  Level2Book
struct  LastTrade
class  Level2Streams
struct  SimFeed
struct  SimFeedList
class  SimControl
class  WebServer
class  WorkspaceStore

Typedefs

using json = nlohmann::json
using WebSocketClient = coinbase::WebSocketClient
using producer_buffer = slick::stream_buffer_multiplexer::producer_buffer
using multiplex_record = slick::stream_buffer_multiplexer::multiplex_record
using OrderBook = slick::orderbook::OrderBookL2
using OrderBookManager = slick::orderbook::OrderBookManager<slick::orderbook::OrderBookL2>
using OrderBookObserver = slick::orderbook::IOrderBookObserver
using OrderBookSide = slick::orderbook::Side
using OrderBookPrice = slick::orderbook::Price
using OrderBookQuantity = slick::orderbook::Quantity
using TopOfBook = slick::orderbook::TopOfBook
using PriceLevelUpdate = slick::orderbook::PriceLevelUpdate
using StringSet = std::unordered_set<std::string, StringHash, std::equal_to<>>
template<typename V>
using StringMap = std::unordered_map<std::string, V, StringHash, std::equal_to<>>
using price_t = int64_t
using qty_t = int64_t
using Logger = slick::logger::Logger

Enumerations

enum class  PostOnlyPolicy : uint8_t { REJECT_IF_CROSSING , ACCEPT , REJECT , NATIVE }
enum class  BrokerId : uint8_t {
  UNKNOWN = 0 , COINBASE , ALPACA , HYPERLIQUID ,
  SIMULATED , CME , ICE , _BROKER_ID_COUNT_
}
enum class  EventType : uint8_t {
  TRADE , QUOTE , LEVEL2_UPDATE , ORDER_BOOK ,
  CANDLE , NEW_ORDER , MODIFY_ORDER , CANCEL_ORDER ,
  ORDER_ACK , ORDER_FILL , ORDER_REJECT , ORDER_CANCEL ,
  POSITION_UPDATE , PNL_UPDATE , TOB , REGISTER ,
  REGISTER_END , STATUS , SUBSCRIBE , UNSUBSCRIBE ,
  STRATEGY_CONFIG , INSTRUMENT_DEFINITION , MBO_UPDATE , INSTRUMENT_STATUS ,
  LADDER_SUBSCRIPTION
}
enum class  TradingStatus : uint8_t {
  UNKNOWN , PRE_OPEN , OPEN , HALTED ,
  CLOSED
}
enum  LadderFeed : uint8_t { LADDER_BOOK = 1 , LADDER_TRADES = 2 , LADDER_ALL = LADDER_BOOK | LADDER_TRADES }
enum class  MboAction : uint8_t { ADD , MODIFY , REMOVE }
enum class  FillScope : uint8_t { ORDER_AND_POSITION , ORDER , LEG }
enum class  ComponentType : uint8_t { UNKNOWN , MARKET_DATA , ORDER_CONNECTOR }
enum class  Status : uint8_t { STARTING , RUNNIGN , STOPING , STOPED }
enum class  FeeType : uint8_t { PERCENTAGE , FIXED_AMOUNT , PER_UNIT }
enum  Side : uint8_t { BUY = 0 , SELL = 1 , UNKNOWN = 2 }
enum class  OrderType : uint8_t {
  MARKET = 0 , LIMIT = 1 , STOP = 2 , STOP_LIMIT = 3 ,
  BRACKET = 4
}
enum class  TimeInForce : uint8_t {
  GTC , IOC , FOK , GTD ,
  DAY
}
enum class  OrderStatus : uint8_t {
  PENDING_NEW , PENDING_MODIFY , PENDING_CANCEL , ACKNOWLEDGED ,
  PARTIALLY_FILLED , FILLED , CANCELLED , REJECTED
}
enum class  SubscriptionType : uint8_t {
  TRADE , QUOTE , LEVEL2 , ORDER_BOOK ,
  MBO
}
enum class  PolicyUrl { ADDED , LISTED , FAILED }
enum class  SimFeedState : uint8_t {
  UNKNOWN , IDLE , LOADING , SYNCING ,
  READY , REPLAYING , FINISHED , FAILED
}

Functions

std::vector< MdDefinition > coinbase_definitions (const std::vector< coinbase::Product > &products)
std::string env_or (const char *name, std::string fallback)
int64_t wall_clock_offset_ns ()
uint64_t wall_clock_ns ()
template<typename Service, typename Step>
KillSwitchCount run_kill_switch (std::string_view who, size_t working, uint64_t timeout_ns, Service &&service, Step &&step, std::string_view fallback)
constexpr uint32_t md_producer_id (BrokerId broker) noexcept
constexpr uint32_t order_producer_id (BrokerId broker) noexcept
template<typename E>
void set_shm_name (E &event, const std::string &name)
template<typename F>
void for_each_part (size_t count, size_t max, F &&f)
bool publish_definition (slick::stream_buffer_multiplexer::producer_buffer &buffer, BrokerId broker, const MdDefinition &d)
template<typename Subscribe, typename Unsubscribe>
bool process_md_request (slick::queue< uint8_t > &queue, uint64_t &cursor, BrokerId broker, Subscribe &&on_subscribe, Unsubscribe &&on_unsubscribe)
PostOnlyPolicy parse_post_only_policy (const std::string &value, std::string_view native, std::string_view who)
bool rests (OrderType type, TimeInForce tif) noexcept
uint32_t whole_lots (qty_t qty) noexcept
qty_t lots_to_qty (int64_t lots) noexcept
const char * post_only_problem (PostOnlyPolicy policy, const SharedTopOfBook *top, Side side, OrderType type, TimeInForce tif, price_t price, bool &warned, std::string_view who)
OrderRejectEvent reject_of (const NewOrderEvent &request, BrokerId broker, std::string_view reason)
template<typename New, typename Modify, typename Cancel>
bool dispatch_order_request (slick::queue< uint8_t > &queue, uint64_t &cursor, BrokerId broker, New &&on_new, Modify &&on_modify, Cancel &&on_cancel)
std::vector< MdDefinition > hyperliquid_definitions (const std::unordered_map< std::string, int > &coin_to_asset, const std::unordered_map< int, int > &asset_to_sz_decimals)
bool is_request_for (const Event &request, BrokerId broker) noexcept
bool environment_is (std::string_view env, std::string_view word) noexcept
bool is_production_environment (std::string_view env) noexcept
bool is_sim_environment (std::string_view env) noexcept
bool read_environment (const nlohmann::json &config, std::string &env)
bool read_sim_control (const nlohmann::json &config, SimControlConfig &sim, std::string &error)
const char * to_string (BrokerId bid)
BrokerId to_broker_id (const std::string &broker)
const char * to_string (TradingStatus status)
std::string_view to_string (ComponentType ct)
std::optional< QueuePosition > queue_position (const slick::orderbook::OrderBookL3 &book, slick::orderbook::OrderId order_id) noexcept
std::optional< QueuePosition > queue_position (const slick::orderbook::OrderBookL3 &book, std::string_view order_id) noexcept
price_t compute_fee (price_t fill_price, qty_t fill_qty, const FeeStructure &fee)
constexpr std::string_view to_string (OrderType type)
constexpr std::string_view to_string (TimeInForce tif)
constexpr std::string_view to_string (OrderStatus status)
uint64_t get_timestamp_ns ()
price_t to_price_t (double value)
qty_t to_qty_t (double value)
double from_price_t (price_t value)
double from_qty_t (qty_t value)
constexpr bool streams_book (SubscriptionType type) noexcept
std::string dashboard_origin (std::string_view ip, int64_t port)
PolicyUrl add_policy_url (std::string_view key, std::string_view url, std::string &error)
void list_origin (const nlohmann::json &config, std::string_view setting, int64_t default_port, std::span< const std::string_view > keys)
void append_json_string (std::string &out, std::string_view text)
template<typename T>
void append_json_number (std::string &out, T value)
template<typename ForEachLevel>
void write_level2_message (std::string &out, std::string_view instrument, uint64_t event_time_ns, uint64_t sequence_num, bool is_snapshot, ForEachLevel &&for_each_level)
void write_trade_message (std::string &out, std::string_view instrument, const LastTrade &trade)
std::string_view to_string (SimFeedState state) noexcept
std::vector< SimFeed > parse_sim_feeds (std::string_view text)
SimFeedList parse_sim_feed_list (std::string_view text)
coinbase::OrderType to_coinbase_order_type (OrderType type)
coinbase::TimeInForce to_coinbase_time_in_force (TimeInForce tif)
static hyperliquid::Tif to_hl_tif (TimeInForce tif, bool post_only)
static std::string join_strings (const std::vector< std::string > &vec, const std::string &delimiter)

Variables

constexpr std::string_view PRODUCTION_ENVIRONMENT = "Production"
constexpr std::string_view LIVE_SIM_ENVIRONMENT = "Live Sim"
constexpr std::string_view HISTORICAL_SIM_ENVIRONMENT = "Historical Sim"
constexpr size_t MAX_INSTRUMENT_LENGTH = 32
constexpr size_t MAX_CURRENCY_LENGTH = 8
constexpr size_t MAX_STATUS_REASON_LENGTH = 32
constexpr size_t MAX_ORDER_BOOK_LEVELS = 10
constexpr size_t MAX_ORDER_ID_LENGTH = 64
constexpr size_t MAX_REJECT_REASON_LENGTH = 128
constexpr size_t MAX_STRATEGY_ID_LENGTH = 64
constexpr uint32_t INVALID_PRODUCER_ID = std::numeric_limits<uint32_t>::max()
constexpr size_t MAX_STRATEGY_NAME_LENGTH = 64
constexpr size_t MAX_STRATEGY_CONFIG_LENGTH = 64 * 1024
constexpr uint32_t STRATEGY_API_VERSION = 2
constexpr price_t NULL_PRICE = std::numeric_limits<price_t>::max()
constexpr int64_t PRICE_SCALE = 100'000'000
constexpr int64_t QTY_SCALE = 100'000'000
constexpr std::string_view EDGE_POPUPS_KEY = R"(Software\Policies\Microsoft\Edge\PopupsAllowedForUrls)"
constexpr std::string_view CHROME_POPUPS_KEY = R"(Software\Policies\Google\Chrome\PopupsAllowedForUrls)"
constexpr std::array< std::string_view, 2 > POPUP_POLICY_KEYS {EDGE_POPUPS_KEY, CHROME_POPUPS_KEY}
constexpr std::string_view EDGE_SECURE_KEY
constexpr std::string_view CHROME_SECURE_KEY
constexpr std::array< std::string_view, 2 > SECURE_POLICY_KEYS {EDGE_SECURE_KEY, CHROME_SECURE_KEY}
static constexpr uint32_t producer_id = static_cast<uint8_t>(BrokerId::HYPERLIQUID) * 2 - 1

Typedef Documentation

◆ json

using slick::trader::json = nlohmann::json

Definition at line 13 of file coinbase_broker.hpp.

◆ Logger

using slick::trader::Logger = slick::logger::Logger

Definition at line 23 of file trading_engine.cpp.

◆ multiplex_record

using slick::trader::multiplex_record = slick::stream_buffer_multiplexer::multiplex_record

Definition at line 46 of file strategy_manager.hpp.

◆ OrderBook

using slick::trader::OrderBook = slick::orderbook::OrderBookL2

Definition at line 14 of file order_book.hpp.

◆ OrderBookManager

using slick::trader::OrderBookManager = slick::orderbook::OrderBookManager<slick::orderbook::OrderBookL2>

Definition at line 15 of file order_book.hpp.

◆ OrderBookObserver

using slick::trader::OrderBookObserver = slick::orderbook::IOrderBookObserver

Definition at line 16 of file order_book.hpp.

◆ OrderBookPrice

using slick::trader::OrderBookPrice = slick::orderbook::Price

Definition at line 18 of file order_book.hpp.

◆ OrderBookQuantity

using slick::trader::OrderBookQuantity = slick::orderbook::Quantity

Definition at line 19 of file order_book.hpp.

◆ OrderBookSide

using slick::trader::OrderBookSide = slick::orderbook::Side

Definition at line 17 of file order_book.hpp.

◆ price_t

using slick::trader::price_t = int64_t

Definition at line 16 of file types.hpp.

◆ PriceLevelUpdate

using slick::trader::PriceLevelUpdate = slick::orderbook::PriceLevelUpdate

Definition at line 21 of file order_book.hpp.

◆ producer_buffer

using slick::trader::producer_buffer = slick::stream_buffer_multiplexer::producer_buffer

Definition at line 26 of file coinbase_md_connector.hpp.

◆ qty_t

using slick::trader::qty_t = int64_t

Definition at line 17 of file types.hpp.

◆ StringMap

template<typename V>
using slick::trader::StringMap = std::unordered_map<std::string, V, StringHash, std::equal_to<>>

Definition at line 24 of file string_hash.hpp.

◆ StringSet

using slick::trader::StringSet = std::unordered_set<std::string, StringHash, std::equal_to<>>

Definition at line 20 of file string_hash.hpp.

◆ TopOfBook

using slick::trader::TopOfBook = slick::orderbook::TopOfBook

Definition at line 20 of file order_book.hpp.

◆ WebSocketClient

using slick::trader::WebSocketClient = coinbase::WebSocketClient

Definition at line 25 of file coinbase_md_connector.hpp.

Enumeration Type Documentation

◆ BrokerId

enum class slick::trader::BrokerId : uint8_t
strong
Enumerator
UNKNOWN 
COINBASE 
ALPACA 
HYPERLIQUID 
SIMULATED 
CME 
ICE 
_BROKER_ID_COUNT_ 

Definition at line 15 of file event.hpp.

◆ ComponentType

enum class slick::trader::ComponentType : uint8_t
strong
Enumerator
UNKNOWN 
MARKET_DATA 
ORDER_CONNECTOR 

Definition at line 12 of file register_event.hpp.

◆ EventType

enum class slick::trader::EventType : uint8_t
strong
Enumerator
TRADE 
QUOTE 
LEVEL2_UPDATE 
ORDER_BOOK 
CANDLE 
NEW_ORDER 
MODIFY_ORDER 
CANCEL_ORDER 
ORDER_ACK 
ORDER_FILL 
ORDER_REJECT 
ORDER_CANCEL 
POSITION_UPDATE 
PNL_UPDATE 
TOB 
REGISTER 
REGISTER_END 
STATUS 
SUBSCRIBE 
UNSUBSCRIBE 
STRATEGY_CONFIG 
INSTRUMENT_DEFINITION 
MBO_UPDATE 
INSTRUMENT_STATUS 
LADDER_SUBSCRIPTION 

Definition at line 26 of file event.hpp.

◆ FeeType

enum class slick::trader::FeeType : uint8_t
strong
Enumerator
PERCENTAGE 
FIXED_AMOUNT 
PER_UNIT 

Definition at line 8 of file fee_structure.hpp.

◆ FillScope

enum class slick::trader::FillScope : uint8_t
strong
Enumerator
ORDER_AND_POSITION 
ORDER 
LEG 

Definition at line 118 of file order_event.hpp.

◆ LadderFeed

enum slick::trader::LadderFeed : uint8_t
Enumerator
LADDER_BOOK 
LADDER_TRADES 
LADDER_ALL 

Definition at line 11 of file ladder_subscription_event.hpp.

◆ MboAction

enum class slick::trader::MboAction : uint8_t
strong
Enumerator
ADD 
MODIFY 
REMOVE 

Definition at line 13 of file mbo_update_event.hpp.

◆ OrderStatus

enum class slick::trader::OrderStatus : uint8_t
strong
Enumerator
PENDING_NEW 
PENDING_MODIFY 
PENDING_CANCEL 
ACKNOWLEDGED 
PARTIALLY_FILLED 
FILLED 
CANCELLED 
REJECTED 

Definition at line 30 of file order_types.hpp.

◆ OrderType

enum class slick::trader::OrderType : uint8_t
strong
Enumerator
MARKET 
LIMIT 
STOP 
STOP_LIMIT 
BRACKET 

Definition at line 14 of file order_types.hpp.

◆ PolicyUrl

enum class slick::trader::PolicyUrl
strong
Enumerator
ADDED 
LISTED 
FAILED 

Definition at line 32 of file browser_policy.hpp.

◆ PostOnlyPolicy

enum class slick::trader::PostOnlyPolicy : uint8_t
strong
Enumerator
REJECT_IF_CROSSING 
ACCEPT 
REJECT 
NATIVE 

Definition at line 25 of file order_entry.hpp.

◆ Side

enum slick::trader::Side : uint8_t
Enumerator
BUY 
SELL 
UNKNOWN 

Definition at line 8 of file order_types.hpp.

◆ SimFeedState

enum class slick::trader::SimFeedState : uint8_t
strong
Enumerator
UNKNOWN 
IDLE 
LOADING 
SYNCING 
READY 
REPLAYING 
FINISHED 
FAILED 

Definition at line 60 of file sim_control.hpp.

◆ Status

enum class slick::trader::Status : uint8_t
strong
Enumerator
STARTING 
RUNNIGN 
STOPING 
STOPED 

Definition at line 7 of file status_event.hpp.

◆ SubscriptionType

enum class slick::trader::SubscriptionType : uint8_t
strong
Enumerator
TRADE 
QUOTE 
LEVEL2 
ORDER_BOOK 
MBO 

Definition at line 44 of file types.hpp.

◆ TimeInForce

enum class slick::trader::TimeInForce : uint8_t
strong
Enumerator
GTC 
IOC 
FOK 
GTD 
DAY 

Definition at line 22 of file order_types.hpp.

◆ TradingStatus

enum class slick::trader::TradingStatus : uint8_t
strong
Enumerator
UNKNOWN 
PRE_OPEN 
OPEN 
HALTED 
CLOSED 

Definition at line 14 of file instrument_status_event.hpp.

Function Documentation

◆ add_policy_url()

PolicyUrl slick::trader::add_policy_url ( std::string_view key,
std::string_view url,
std::string & error )

Definition at line 71 of file browser_policy.cpp.

References ADDED, FAILED, and LISTED.

Referenced by list_origin().

◆ append_json_number()

template<typename T>
void slick::trader::append_json_number ( std::string & out,
T value )

Definition at line 168 of file level2_book.hpp.

Referenced by write_level2_message(), and write_trade_message().

◆ append_json_string()

void slick::trader::append_json_string ( std::string & out,
std::string_view text )
inline

Definition at line 147 of file level2_book.hpp.

Referenced by write_level2_message(), and write_trade_message().

◆ coinbase_definitions()

std::vector< MdDefinition > slick::trader::coinbase_definitions ( const std::vector< coinbase::Product > & products)

Definition at line 189 of file coinbase_md_connector.cpp.

References to_price_t(), and to_qty_t().

◆ compute_fee()

price_t slick::trader::compute_fee ( price_t fill_price,
qty_t fill_qty,
const FeeStructure & fee )
inline

◆ dashboard_origin()

std::string slick::trader::dashboard_origin ( std::string_view ip,
int64_t port )

Definition at line 54 of file browser_policy.cpp.

Referenced by list_origin().

◆ dispatch_order_request()

template<typename New, typename Modify, typename Cancel>
bool slick::trader::dispatch_order_request ( slick::queue< uint8_t > & queue,
uint64_t & cursor,
BrokerId broker,
New && on_new,
Modify && on_modify,
Cancel && on_cancel )

Definition at line 81 of file order_event_writer.hpp.

References CANCEL_ORDER, is_request_for(), MODIFY_ORDER, and NEW_ORDER.

◆ env_or()

std::string slick::trader::env_or ( const char * name,
std::string fallback )
inline

Definition at line 17 of file connector_support.hpp.

◆ environment_is()

bool slick::trader::environment_is ( std::string_view env,
std::string_view word )
inlinenoexcept

Definition at line 22 of file environment.hpp.

Referenced by is_production_environment(), and is_sim_environment().

◆ for_each_part()

template<typename F>
void slick::trader::for_each_part ( size_t count,
size_t max,
F && f )

◆ from_price_t()

◆ from_qty_t()

◆ get_timestamp_ns()

◆ hyperliquid_definitions()

std::vector< MdDefinition > slick::trader::hyperliquid_definitions ( const std::unordered_map< std::string, int > & coin_to_asset,
const std::unordered_map< int, int > & asset_to_sz_decimals )

◆ is_production_environment()

bool slick::trader::is_production_environment ( std::string_view env)
inlinenoexcept

Definition at line 31 of file environment.hpp.

References environment_is().

Referenced by slick::trader::TradingEngine::initialize().

◆ is_request_for()

bool slick::trader::is_request_for ( const Event & request,
BrokerId broker )
inlinenoexcept

Definition at line 13 of file iorder_connector.hpp.

Referenced by dispatch_order_request().

◆ is_sim_environment()

bool slick::trader::is_sim_environment ( std::string_view env)
inlinenoexcept

Definition at line 36 of file environment.hpp.

References environment_is().

Referenced by slick::trader::TradingEngine::initialize().

◆ join_strings()

std::string slick::trader::join_strings ( const std::vector< std::string > & vec,
const std::string & delimiter )
static

Definition at line 26 of file trading_engine.cpp.

◆ list_origin()

void slick::trader::list_origin ( const nlohmann::json & config,
std::string_view setting,
int64_t default_port,
std::span< const std::string_view > keys )

◆ lots_to_qty()

qty_t slick::trader::lots_to_qty ( int64_t lots)
inlinenoexcept

◆ md_producer_id()

uint32_t slick::trader::md_producer_id ( BrokerId broker)
constexprnoexcept

◆ order_producer_id()

uint32_t slick::trader::order_producer_id ( BrokerId broker)
constexprnoexcept

◆ parse_post_only_policy()

PostOnlyPolicy slick::trader::parse_post_only_policy ( const std::string & value,
std::string_view native,
std::string_view who )
inline

Definition at line 38 of file order_entry.hpp.

References ACCEPT, NATIVE, REJECT, and REJECT_IF_CROSSING.

◆ parse_sim_feed_list()

SimFeedList slick::trader::parse_sim_feed_list ( std::string_view text)

◆ parse_sim_feeds()

std::vector< SimFeed > slick::trader::parse_sim_feeds ( std::string_view text)

Definition at line 106 of file sim_control.cpp.

References slick::trader::SimFeed::name, and UNKNOWN.

◆ post_only_problem()

const char * slick::trader::post_only_problem ( PostOnlyPolicy policy,
const SharedTopOfBook * top,
Side side,
OrderType type,
TimeInForce tif,
price_t price,
bool & warned,
std::string_view who )

◆ process_md_request()

template<typename Subscribe, typename Unsubscribe>
bool slick::trader::process_md_request ( slick::queue< uint8_t > & queue,
uint64_t & cursor,
BrokerId broker,
Subscribe && on_subscribe,
Unsubscribe && on_unsubscribe )

◆ publish_definition()

◆ queue_position() [1/2]

◆ queue_position() [2/2]

std::optional< QueuePosition > slick::trader::queue_position ( const slick::orderbook::OrderBookL3 & book,
std::string_view order_id )
inlinenoexcept

Definition at line 56 of file queue_position.hpp.

References queue_position().

◆ read_environment()

bool slick::trader::read_environment ( const nlohmann::json & config,
std::string & env )
inline

Definition at line 42 of file environment.hpp.

References PRODUCTION_ENVIRONMENT.

Referenced by slick::trader::TradingEngine::initialize().

◆ read_sim_control()

bool slick::trader::read_sim_control ( const nlohmann::json & config,
SimControlConfig & sim,
std::string & error )
inline

◆ reject_of()

◆ rests()

bool slick::trader::rests ( OrderType type,
TimeInForce tif )
inlinenoexcept

Definition at line 59 of file order_entry.hpp.

References FOK, IOC, and LIMIT.

Referenced by post_only_problem().

◆ run_kill_switch()

template<typename Service, typename Step>
KillSwitchCount slick::trader::run_kill_switch ( std::string_view who,
size_t working,
uint64_t timeout_ns,
Service && service,
Step && step,
std::string_view fallback )

◆ set_shm_name()

template<typename E>
void slick::trader::set_shm_name ( E & event,
const std::string & name )

◆ streams_book()

bool slick::trader::streams_book ( SubscriptionType type)
constexprnoexcept

Definition at line 54 of file types.hpp.

References LEVEL2, and ORDER_BOOK.

Referenced by slick::trader::WebServer::initialize().

◆ to_broker_id()

BrokerId slick::trader::to_broker_id ( const std::string & broker)
inline

Definition at line 97 of file event.hpp.

References ALPACA, CME, COINBASE, HYPERLIQUID, ICE, SIMULATED, and UNKNOWN.

Referenced by slick::trader::TradingEngine::initialize().

◆ to_coinbase_order_type()

coinbase::OrderType slick::trader::to_coinbase_order_type ( OrderType type)
inline

Definition at line 20 of file coinbase_order_connector.cpp.

References BRACKET, LIMIT, MARKET, STOP, and STOP_LIMIT.

◆ to_coinbase_time_in_force()

coinbase::TimeInForce slick::trader::to_coinbase_time_in_force ( TimeInForce tif)
inline

Definition at line 38 of file coinbase_order_connector.cpp.

References FOK, GTC, GTD, and IOC.

◆ to_hl_tif()

hyperliquid::Tif slick::trader::to_hl_tif ( TimeInForce tif,
bool post_only )
static

Definition at line 24 of file hyperliquid_order_connector.cpp.

References FOK, GTC, GTD, IOC, and to_string().

◆ to_price_t()

◆ to_qty_t()

◆ to_string() [1/7]

const char * slick::trader::to_string ( BrokerId bid)
inline

◆ to_string() [2/7]

std::string_view slick::trader::to_string ( ComponentType ct)
inline

Definition at line 52 of file register_event.hpp.

References MARKET_DATA, and ORDER_CONNECTOR.

◆ to_string() [3/7]

std::string_view slick::trader::to_string ( OrderStatus status)
inlineconstexpr

◆ to_string() [4/7]

std::string_view slick::trader::to_string ( OrderType type)
inlineconstexpr

Definition at line 41 of file order_types.hpp.

References BRACKET, LIMIT, MARKET, STOP, and STOP_LIMIT.

◆ to_string() [5/7]

std::string_view slick::trader::to_string ( SimFeedState state)
noexcept

Definition at line 101 of file sim_control.cpp.

◆ to_string() [6/7]

std::string_view slick::trader::to_string ( TimeInForce tif)
inlineconstexpr

Definition at line 52 of file order_types.hpp.

References DAY, FOK, GTC, GTD, and IOC.

◆ to_string() [7/7]

const char * slick::trader::to_string ( TradingStatus status)
inline

Definition at line 22 of file instrument_status_event.hpp.

References CLOSED, HALTED, OPEN, and PRE_OPEN.

◆ wall_clock_ns()

uint64_t slick::trader::wall_clock_ns ( )
inline

Definition at line 31 of file connector_support.hpp.

◆ wall_clock_offset_ns()

int64_t slick::trader::wall_clock_offset_ns ( )
inline

Definition at line 24 of file connector_support.hpp.

References get_timestamp_ns().

◆ whole_lots()

uint32_t slick::trader::whole_lots ( qty_t qty)
inlinenoexcept

Definition at line 64 of file order_entry.hpp.

References QTY_SCALE.

◆ write_level2_message()

template<typename ForEachLevel>
void slick::trader::write_level2_message ( std::string & out,
std::string_view instrument,
uint64_t event_time_ns,
uint64_t sequence_num,
bool is_snapshot,
ForEachLevel && for_each_level )

◆ write_trade_message()

void slick::trader::write_trade_message ( std::string & out,
std::string_view instrument,
const LastTrade & trade )
inline

Variable Documentation

◆ CHROME_POPUPS_KEY

std::string_view slick::trader::CHROME_POPUPS_KEY = R"(Software\Policies\Google\Chrome\PopupsAllowedForUrls)"
inlineconstexpr

Definition at line 16 of file browser_policy.hpp.

◆ CHROME_SECURE_KEY

std::string_view slick::trader::CHROME_SECURE_KEY
inlineconstexpr
Initial value:
=
R"(Software\Policies\Google\Chrome\OverrideSecurityRestrictionsOnInsecureOrigin)"

Definition at line 24 of file browser_policy.hpp.

◆ EDGE_POPUPS_KEY

std::string_view slick::trader::EDGE_POPUPS_KEY = R"(Software\Policies\Microsoft\Edge\PopupsAllowedForUrls)"
inlineconstexpr

Definition at line 15 of file browser_policy.hpp.

◆ EDGE_SECURE_KEY

std::string_view slick::trader::EDGE_SECURE_KEY
inlineconstexpr
Initial value:
=
R"(Software\Policies\Microsoft\Edge\OverrideSecurityRestrictionsOnInsecureOrigin)"

Definition at line 22 of file browser_policy.hpp.

◆ HISTORICAL_SIM_ENVIRONMENT

std::string_view slick::trader::HISTORICAL_SIM_ENVIRONMENT = "Historical Sim"
inlineconstexpr

Definition at line 19 of file environment.hpp.

Referenced by slick::trader::SimControl::environment().

◆ INVALID_PRODUCER_ID

uint32_t slick::trader::INVALID_PRODUCER_ID = std::numeric_limits<uint32_t>::max()
constexpr

Definition at line 10 of file register_event.hpp.

Referenced by slick::trader::RegisterEvent::RegisterEvent().

◆ LIVE_SIM_ENVIRONMENT

std::string_view slick::trader::LIVE_SIM_ENVIRONMENT = "Live Sim"
inlineconstexpr

Definition at line 18 of file environment.hpp.

Referenced by slick::trader::SimControl::environment().

◆ MAX_CURRENCY_LENGTH

size_t slick::trader::MAX_CURRENCY_LENGTH = 8
constexpr

◆ MAX_INSTRUMENT_LENGTH

size_t slick::trader::MAX_INSTRUMENT_LENGTH = 32
constexpr

◆ MAX_ORDER_BOOK_LEVELS

size_t slick::trader::MAX_ORDER_BOOK_LEVELS = 10
constexpr

Definition at line 9 of file order_book_event.hpp.

◆ MAX_ORDER_ID_LENGTH

size_t slick::trader::MAX_ORDER_ID_LENGTH = 64
constexpr

Definition at line 13 of file order_event.hpp.

Referenced by slick::trader::OrderFillEvent::set_fill_id().

◆ MAX_REJECT_REASON_LENGTH

size_t slick::trader::MAX_REJECT_REASON_LENGTH = 128
constexpr

◆ MAX_STATUS_REASON_LENGTH

size_t slick::trader::MAX_STATUS_REASON_LENGTH = 32
constexpr

◆ MAX_STRATEGY_CONFIG_LENGTH

size_t slick::trader::MAX_STRATEGY_CONFIG_LENGTH = 64 * 1024
constexpr

Definition at line 17 of file strategy_config_event.hpp.

◆ MAX_STRATEGY_ID_LENGTH

size_t slick::trader::MAX_STRATEGY_ID_LENGTH = 64
constexpr

◆ MAX_STRATEGY_NAME_LENGTH

size_t slick::trader::MAX_STRATEGY_NAME_LENGTH = 64
constexpr

◆ NULL_PRICE

◆ POPUP_POLICY_KEYS

std::array<std::string_view, 2> slick::trader::POPUP_POLICY_KEYS {EDGE_POPUPS_KEY, CHROME_POPUPS_KEY}
inlineconstexpr

Definition at line 17 of file browser_policy.hpp.

Referenced by slick::trader::WebServer::initialize().

◆ PRICE_SCALE

int64_t slick::trader::PRICE_SCALE = 100'000'000
constexpr

Definition at line 20 of file types.hpp.

Referenced by from_price_t(), and to_price_t().

◆ producer_id

◆ PRODUCTION_ENVIRONMENT

std::string_view slick::trader::PRODUCTION_ENVIRONMENT = "Production"
inlineconstexpr

Definition at line 14 of file environment.hpp.

Referenced by read_environment().

◆ QTY_SCALE

int64_t slick::trader::QTY_SCALE = 100'000'000
constexpr

Definition at line 21 of file types.hpp.

Referenced by from_qty_t(), lots_to_qty(), to_qty_t(), and whole_lots().

◆ SECURE_POLICY_KEYS

std::array<std::string_view, 2> slick::trader::SECURE_POLICY_KEYS {EDGE_SECURE_KEY, CHROME_SECURE_KEY}
inlineconstexpr

Definition at line 26 of file browser_policy.hpp.

Referenced by slick::trader::WebServer::initialize().

◆ STRATEGY_API_VERSION

uint32_t slick::trader::STRATEGY_API_VERSION = 2
inlineconstexpr

Definition at line 30 of file istrategy.hpp.

Referenced by slick::trader::StrategyLoader::load().