|
Slick Trader 0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
|
#include <slick-trader/web/sim_control.hpp>
Classes | |
| struct | ReplayAnswer |
Public Member Functions | |
| SimControl (ByteTransport &transport) | |
| void | on_connected (uint64_t now_ns) |
| size_t | on_data (const uint8_t *data, size_t size, uint64_t now_ns) |
| void | on_timer (uint64_t now_ns) |
| void | on_disconnected () |
| bool | ready_to_connect (uint64_t) const noexcept |
| bool | held () const noexcept |
| void | on_lost () |
| bool | connected () const noexcept |
| const std::string & | version () const noexcept |
| std::string_view | environment () const noexcept |
| const SimFeedList & | list () const noexcept |
| const std::vector< SimFeed > & | feeds () const noexcept |
| std::string | start_blocked () const |
| bool | start_replay (uint64_t now_ns) |
| bool | take_changed () noexcept |
| std::optional< ReplayAnswer > | take_replay_answer () |
| nlohmann::json | to_json () const |
Static Public Attributes | |
| static constexpr uint64_t | POLL_NS = 1'000'000'000 |
| static constexpr uint64_t | REPLY_TIMEOUT_NS = 5'000'000'000 |
| static constexpr uint64_t | STARTING_NS = 5'000'000'000 |
Definition at line 94 of file sim_control.hpp.
|
inlineexplicit |
Definition at line 107 of file sim_control.hpp.
|
inlinenoexcept |
Definition at line 124 of file sim_control.hpp.
|
inlinenoexcept |
Definition at line 130 of file sim_control.hpp.
References slick::trader::HISTORICAL_SIM_ENVIRONMENT, and slick::trader::LIVE_SIM_ENVIRONMENT.
|
inlinenoexcept |
Definition at line 135 of file sim_control.hpp.
Referenced by to_json().
|
inlinenoexcept |
Definition at line 118 of file sim_control.hpp.
|
inlinenoexcept |
Definition at line 133 of file sim_control.hpp.
| void slick::trader::SimControl::on_connected | ( | uint64_t | now_ns | ) |
Definition at line 172 of file sim_control.cpp.
References slick::trader::sim_cli::GET_VERSION.
| size_t slick::trader::SimControl::on_data | ( | const uint8_t * | data, |
| size_t | size, | ||
| uint64_t | now_ns ) |
Definition at line 178 of file sim_control.cpp.
References slick::trader::sim_cli::Reply::header, slick::trader::sim_cli::Header::length, slick::trader::sim_cli::REPLY, slick::trader::sim_cli::Reply::request_id, slick::trader::sim_cli::Reply::status, slick::trader::sim_cli::STATUS_OK, slick::trader::sim_cli::Header::type, version(), and slick::trader::sim_cli::WATCH_STATUS.
| void slick::trader::SimControl::on_disconnected | ( | ) |
Definition at line 233 of file sim_control.cpp.
References on_lost().
| void slick::trader::SimControl::on_lost | ( | ) |
Definition at line 252 of file sim_control.cpp.
Referenced by on_disconnected().
| void slick::trader::SimControl::on_timer | ( | uint64_t | now_ns | ) |
Definition at line 218 of file sim_control.cpp.
References STARTING_NS.
|
inlinenoexcept |
Definition at line 114 of file sim_control.hpp.
| std::string slick::trader::SimControl::start_blocked | ( | ) | const |
Definition at line 332 of file sim_control.cpp.
References slick::trader::FAILED, slick::trader::READY, slick::trader::REPLAYING, and slick::trader::SimFeed::state.
Referenced by start_replay(), and to_json().
| bool slick::trader::SimControl::start_replay | ( | uint64_t | now_ns | ) |
Definition at line 361 of file sim_control.cpp.
References start_blocked(), and slick::trader::sim_cli::START_REPLAY.
|
inlinenoexcept |
Definition at line 144 of file sim_control.hpp.
|
inline |
Definition at line 146 of file sim_control.hpp.
| nlohmann::json slick::trader::SimControl::to_json | ( | ) | const |
Definition at line 371 of file sim_control.cpp.
References feeds(), start_blocked(), and slick::trader::to_string().
|
inlinenoexcept |
Definition at line 127 of file sim_control.hpp.
Referenced by on_data().
|
staticconstexpr |
Definition at line 96 of file sim_control.hpp.
|
staticconstexpr |
Definition at line 98 of file sim_control.hpp.
|
staticconstexpr |
Definition at line 100 of file sim_control.hpp.
Referenced by on_timer().