-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathsymbology_resolve.cpp
More file actions
31 lines (25 loc) · 901 Bytes
/
symbology_resolve.cpp
File metadata and controls
31 lines (25 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <vector>
#include "databento/datetime.hpp"
#include "databento/enums.hpp"
#include "databento/historical.hpp"
#include "databento/symbology.hpp"
namespace db = databento;
int main(int argc, char* argv[]) {
if (argc < 6) {
std::cerr << "USAGE: symbology-resolve <DATASET> <STYPE_IN> <STYPE_OUT> "
"<DATE> <SYMBOLS...>\n";
return 1;
}
const auto stype_in = db::FromString<db::SType>(argv[2]);
const auto stype_out = db::FromString<db::SType>(argv[3]);
std::vector<std::string> symbols;
for (int i = 5; i < argc; ++i) {
symbols.emplace_back(argv[i]);
}
auto client = db::Historical::Builder().SetKeyFromEnv().Build();
const db::SymbologyResolution resolution = client.SymbologyResolve(
argv[1], symbols, stype_in, stype_out, db::DateTimeRange<std::string>{argv[4]});
std::cout << resolution << '\n';
return 0;
}