Add: load_reference_data config for databento

This commit is contained in:
Mohammad Arham committed 2024-11-20 02:53:19 +00:00
1 parent eb8c97a1b7
commit 826bbf76a9
4 files changed
+15 -13

No files matched your search

@@ -14,4 +14,5 @@ message DatabentoMarketDataConfig {
string key = 60;
string dataset = 70;
bool filter_securities_one_year= 80;
bool load_reference_data = 90;
}
@@ -30,7 +30,8 @@ void CboeMarketDatahandler::run(
base_path + config.databento_settings().bbo_file_name(),
config.databento_settings().key(),
config.databento_settings().dataset(),
config.databento_settings().filter_securities_one_year());
config.databento_settings().filter_securities_one_year(),
config.databento_settings().load_reference_data());
}
} // namespace bts::md::cboe
@@ -25,6 +25,7 @@
#include <databento/live.hpp>
#include <optional>
#include <string>
#include <vector>
namespace bts::md::DatabentoHandler {
@@ -49,7 +50,8 @@ void DatabentoDatahandler::run(
const std::string &key,
const std::string &dataset,
const bool filter_securities,
const std::chrono::duration<long double> sleep_duration) {
const bool load_reference_data,
const std::chrono::duration<long double> sleep_duration ) {
auto sleep_duration_updated = sleep_duration;
@@ -181,19 +183,16 @@ void DatabentoDatahandler::run(
{}
};
//hardcoding for now will update later
std::vector<std::string> symbols;
switch (venue) {
case api::domain::VENUE_CBOE:
client.Subscribe({"SPX.OPT","SPXW.OPT"}, databento::Schema::Definition, databento::SType::Parent,databento::UnixNanos{});
client.Subscribe({"SPX.OPT","SPXW.OPT"}, databento::Schema::Mbp1, databento::SType::Parent);
break;
case api::domain::VENUE_GLBX:
client.Subscribe({"ES.FUT"}, databento::Schema::Definition, databento::SType::Parent);
client.Subscribe({"ES.FUT"}, databento::Schema::Mbp1, databento::SType::Parent);
break;
default:
bts_assert_msg(false, "ONLY GLBX AND CBOE SUPPORTED FOR NOW");
case api::domain::VENUE_CBOE: symbols= {"SPX.OPT","SPXW.OPT"}; break;
case api::domain::VENUE_GLBX: symbols= {"ES.FUT"}; break;
default:bts_assert_msg(false, "ONLY GLBX AND CBOE SUPPORTED FOR NOW");
}
if(load_reference_data)
client.Subscribe(symbols, databento::Schema::Definition, databento::SType::Parent,databento::UnixNanos{});
else client.Subscribe(symbols, databento::Schema::Definition, databento::SType::Parent);
client.Subscribe(symbols, databento::Schema::Mbp1, databento::SType::Parent);
client.Start();
while (true) {
try {
@@ -15,6 +15,7 @@ class DatabentoDatahandler {
const std::string &dataset="",
const std::string& key = "db-Q4eCbTQfrAHaG6sAcuFUYB9YqkF6j",
const bool filter_securities=false,
const bool load_reference_data = true,
const std::chrono::duration<long double> sleep_duration = 0.04s);
};
} // namespace bts::md::databento