improvement: Refactor mdgw/ftx to use SecurityCriteria
So we can subscribe to depth for "FTX Options" or "FTX BTC Futures", rather than having to list each security explicitly. This commit also unhooks binance from MarketDataGateway. A new paradigm is emerging with the FTX impl, and it'll be easier to redo Binance than try to make the existing impl fit the new mold. Unfortunately, ccapi doesn't provide all the security metadata we need, such as the security type and expiration date/time, so we get the list of FTX securities directly from the exchange.
This commit is contained in:
1 parent
556e2ab99e
commit
abf0d45784
64 files changed
+4180
-536
No files matched your search
@@ -190,7 +190,13 @@ std::string iso_date_time_string(PTime const &t) {
|
||||
PTime parse_iso_date_time_tz(const std::string &date) {
|
||||
// example 1) 2022-10-27T09:30-5:00
|
||||
// example 2) 2022-10-27T09:30+5:00
|
||||
|
||||
#ifdef _WIN32
|
||||
struct tm tt = {0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
#else
|
||||
struct tm tt = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
#endif
|
||||
|
||||
int tz_hours;
|
||||
int tz_minutes;
|
||||
int num_scanned = sscanf(
|
||||
@@ -213,7 +219,8 @@ PTime parse_iso_date_time_string(std::string const &t) {
|
||||
constexpr const std::size_t time_idx = sizeof("YYYY-MM-DD") - 1;
|
||||
auto actual_time_idx = t.find('T', time_idx);
|
||||
if (actual_time_idx != std::string::npos) {
|
||||
constexpr const std::size_t time_zone_idx = time_idx + sizeof("HH:MM") - 1;
|
||||
constexpr const std::size_t time_zone_idx =
|
||||
time_idx + sizeof("HH:MM") - 1;
|
||||
// time zone must be after time
|
||||
bts_assert(actual_time_idx < time_zone_idx);
|
||||
if (t.find('+', time_zone_idx) != std::string::npos ||
|
||||
|
||||
Reference in new issue
Block a user