refactor: Rename 'STOCK' -> 'SPOT'
This commit is contained in:
1 parent
8d84355d57
commit
28e95df5c6
23 files changed
+42
-42
No files matched your search
@@ -148,7 +148,7 @@ namespace mbts.spark {
|
||||
private static bool _direct_valid_driver(SecurityExpiration driver_exp) {
|
||||
return driver_exp != null && /*driver_exp.expiration >= DateTime.Now.Date &&*/
|
||||
(driver_exp.security_tuple.security_type == SecurityType.Future ||
|
||||
driver_exp.security_tuple.security_type == SecurityType.Stock);
|
||||
driver_exp.security_tuple.security_type == SecurityType.Spot);
|
||||
}
|
||||
// returns the driver sectup (it assumes all expirations of this option sectup
|
||||
// are being driven by the same sectup)
|
||||
@@ -202,4 +202,4 @@ namespace mbts.spark {
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace mbts.spark {
|
||||
new SecurityCriteriaClause(
|
||||
exchanges: new[] { Venue.Glbx },
|
||||
security_types: new[] {
|
||||
SecurityType.Stock,
|
||||
SecurityType.Spot,
|
||||
SecurityType.Future,
|
||||
SecurityType.Spread,
|
||||
SecurityType.Option
|
||||
@@ -70,7 +70,7 @@ namespace mbts.spark {
|
||||
new SecurityCriteriaClause(
|
||||
exchanges: EnumHelper.get_values_except(Venue.Glbx, Venue.Unset).ToArray(),
|
||||
security_types: new[] {
|
||||
SecurityType.Stock,
|
||||
SecurityType.Spot,
|
||||
SecurityType.Future,
|
||||
SecurityType.Spread,
|
||||
SecurityType.Option
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace BCG {
|
||||
// return _fut_map.Select(e => Tuple.Create(e.Key.exchange, e.Key.symbol, e.Key.expiration, e.Key));
|
||||
// }
|
||||
|
||||
public IEnumerable<Tuple<Venue, string, uint>> get_stocks() { return new List<Tuple<Venue, string, uint>>(); }
|
||||
public IEnumerable<Tuple<Venue, string, uint>> get_spots() { return new List<Tuple<Venue, string, uint>>(); }
|
||||
|
||||
public Security get_o2_security(uint sec_key) {
|
||||
Security rv = _key_sec_map.TryGetValue(sec_key, out rv) ? rv : null;
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace mbts {
|
||||
if (!is_unexpired(l.Security))
|
||||
return false;
|
||||
return true;
|
||||
case bts.api.SecurityType.Stock:
|
||||
case bts.api.SecurityType.Spot:
|
||||
return true;
|
||||
case bts.api.SecurityType.Synthetic:
|
||||
foreach (var l in sec.Synthetic.Legs)
|
||||
@@ -68,4 +68,4 @@ namespace mbts {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ using MathNet.Numerics.Distributions;
|
||||
namespace BCG {
|
||||
public class ContractUtilities {
|
||||
public static bool is_strock(string sec_type) {
|
||||
return String.Compare(sec_type, SecurityType.Stock.ToString(), true) == 0;
|
||||
return String.Compare(sec_type, SecurityType.Spot.ToString(), true) == 0;
|
||||
// return String.Compare(sec_type, SecurityType.Stock.ToString(), true) == 0 ||
|
||||
// String.Compare(sec_type, SecurityType.Equity.ToString(), true) == 0 ||
|
||||
// String.Compare(sec_type, SecurityType.ETF.ToString(), true) == 0 ||
|
||||
@@ -18,8 +18,8 @@ namespace BCG {
|
||||
}
|
||||
|
||||
//also see SecurityType.cs extension method
|
||||
public static SecurityType default_aw_stock_type {
|
||||
get { return SecurityType.Stock; }
|
||||
public static SecurityType default_aw_spot_type {
|
||||
get { return SecurityType.Spot; }
|
||||
}
|
||||
|
||||
public static string case_correct_symbol(string sym_type, SecurityType default_type = SecurityType.Future) {
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bts.api {
|
||||
|
||||
public static SecurityType security_type(this Security.ContractOneofCase contract_case) =>
|
||||
contract_case switch {
|
||||
Security.ContractOneofCase.Spot => SecurityType.Stock,
|
||||
Security.ContractOneofCase.Spot => SecurityType.Spot,
|
||||
Security.ContractOneofCase.Future => SecurityType.Future,
|
||||
Security.ContractOneofCase.Option => SecurityType.Option,
|
||||
Security.ContractOneofCase.Spread => SecurityType.Spread,
|
||||
@@ -130,7 +130,7 @@ namespace bts.api {
|
||||
|
||||
public static SecurityType to_security_type(this domain.SecurityType api_security_type) =>
|
||||
api_security_type switch {
|
||||
domain.SecurityType.Spot => SecurityType.Stock,
|
||||
domain.SecurityType.Spot => SecurityType.Spot,
|
||||
domain.SecurityType.Future => SecurityType.Future,
|
||||
domain.SecurityType.Option => SecurityType.Option,
|
||||
domain.SecurityType.Spread => SecurityType.Spread,
|
||||
@@ -140,7 +140,7 @@ namespace bts.api {
|
||||
|
||||
public static domain.SecurityType to_api_security_type(this SecurityType api_security_type) =>
|
||||
api_security_type switch {
|
||||
SecurityType.Stock => domain.SecurityType.Spot,
|
||||
SecurityType.Spot => domain.SecurityType.Spot,
|
||||
SecurityType.Future => domain.SecurityType.Future,
|
||||
SecurityType.Option => domain.SecurityType.Option,
|
||||
SecurityType.Spread => domain.SecurityType.Spread,
|
||||
|
||||
@@ -1689,7 +1689,7 @@ api::SecurityType AdminServiceUtils::security_type(
|
||||
case api::Security::ContractCase::kOption:
|
||||
return api::SecurityType::SECURITYTYPE_OPTION;
|
||||
case api::Security::ContractCase::kSpot:
|
||||
return api::SecurityType::SECURITYTYPE_STOCK;
|
||||
return api::SecurityType::SECURITYTYPE_SPOT;
|
||||
case api::Security::ContractCase::kSpread:
|
||||
return api::SecurityType::SECURITYTYPE_SPREAD;
|
||||
case api::Security::ContractCase::kSynthetic:
|
||||
|
||||
@@ -70,7 +70,7 @@ bts::api::domain::SecurityType DomainSecurityUtils::convert(
|
||||
switch (sec_type) {
|
||||
case bts::api::SecurityType::SECURITYTYPE_UNSET:
|
||||
return DOMAIN_SEC_TYPE(UNSPECIFIED);
|
||||
case bts::api::SecurityType::SECURITYTYPE_STOCK:
|
||||
case bts::api::SecurityType::SECURITYTYPE_SPOT:
|
||||
return DOMAIN_SEC_TYPE(SPOT);
|
||||
case bts::api::SecurityType::SECURITYTYPE_OPTION:
|
||||
return DOMAIN_SEC_TYPE(OPTION);
|
||||
@@ -131,7 +131,7 @@ bts::api::SecurityType DomainSecurityUtils::get_type(
|
||||
case bts::api::Security::ContractCase::kSynthetic:
|
||||
return bts::api::SecurityType::SECURITYTYPE_SYNTHETIC;
|
||||
case bts::api::Security::ContractCase::kSpot:
|
||||
return bts::api::SECURITYTYPE_STOCK;
|
||||
return bts::api::SECURITYTYPE_SPOT;
|
||||
default:
|
||||
bts_assert(false);
|
||||
return bts::api::SecurityType::SECURITYTYPE_UNSET;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace bts::domain {
|
||||
|
||||
Security::Security(const bts::api::Security &s) : security_common(s) {
|
||||
switch (DomainSecurityUtils::get_type(s)) {
|
||||
case (bts::api::SecurityType::SECURITYTYPE_STOCK): {
|
||||
case (bts::api::SecurityType::SECURITYTYPE_SPOT): {
|
||||
SpotSecurity spot_security = {};
|
||||
security = spot_security;
|
||||
break;
|
||||
|
||||
@@ -40,7 +40,7 @@ api::SecurityType security_type(api::Security const &security) {
|
||||
case api::Security::ContractCase::kOption:
|
||||
return api::SecurityType::SECURITYTYPE_OPTION;
|
||||
case api::Security::ContractCase::kSpot:
|
||||
return api::SecurityType::SECURITYTYPE_STOCK;
|
||||
return api::SecurityType::SECURITYTYPE_SPOT;
|
||||
case api::Security::ContractCase::kSpread:
|
||||
return api::SecurityType::SECURITYTYPE_SPREAD;
|
||||
case api::Security::ContractCase::kSynthetic:
|
||||
|
||||
@@ -21,7 +21,7 @@ enum Venue {
|
||||
|
||||
enum SecurityType {
|
||||
SECURITYTYPE_UNSET = 0;
|
||||
SECURITYTYPE_STOCK = 1;
|
||||
SECURITYTYPE_SPOT = 1;
|
||||
SECURITYTYPE_OPTION = 2;
|
||||
SECURITYTYPE_FUTURE = 3;
|
||||
SECURITYTYPE_SPREAD = 4;
|
||||
|
||||
@@ -86,7 +86,7 @@ string ShmDumper::dump_security(const FixedSecurity &security) {
|
||||
res << "'mic_code': " << security.mic_code() << ", ";
|
||||
|
||||
switch (security.type) {
|
||||
case SECURITYTYPE_STOCK:
|
||||
case SECURITYTYPE_SPOT:
|
||||
break;
|
||||
case SECURITYTYPE_FUTURE: {
|
||||
auto *psec = static_cast<const FixedFutureSecurity *>(&security);
|
||||
|
||||
@@ -413,7 +413,7 @@ void GeneralMarketDataListener::_add_spot(const bts::domain::Security &sec) {
|
||||
bts_assert(sec.type() == SEC_TYPE(SPOT));
|
||||
auto search_result = _find_sec(sec, false);
|
||||
bts_assert(search_result.existed_before);
|
||||
FixedStockSecurity fs_sec;
|
||||
FixedSpotSecurity fs_sec;
|
||||
_copy_security_common(sec, search_result.key, fs_sec);
|
||||
_commit_security(fs_sec);
|
||||
}
|
||||
|
||||
@@ -618,7 +618,7 @@ class MDConsumerImpl {
|
||||
for (auto &s : symbols) {
|
||||
if (s.type() == SECURITYTYPE_FUTURE ||
|
||||
s.type() == SECURITYTYPE_OPTION ||
|
||||
s.type() == api::SECURITYTYPE_STOCK) {
|
||||
s.type() == api::SECURITYTYPE_SPOT) {
|
||||
_instances.push_back(make_shared<MDConsumerInst>(
|
||||
s.symbol(), s.type(), s.exchange(), shared, platform));
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ struct DisplayFactorMapper : public ISecurityMapper {
|
||||
SecurityType::SECURITYTYPE_FUTURE,
|
||||
SecurityType::SECURITYTYPE_SPREAD,
|
||||
SecurityType::SECURITYTYPE_OPTION,
|
||||
SecurityType::SECURITYTYPE_STOCK,
|
||||
SecurityType::SECURITYTYPE_SPOT,
|
||||
}) {
|
||||
_mapped.insert(std::make_pair(
|
||||
UserSymbol{uppercase_copy(ov.symbol()), *venue, t},
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace md {
|
||||
|
||||
FixedSecurity::FixedSecurity()
|
||||
: size(sizeof(FixedSecurity)), key(invalid_security_key), numeric_id(0),
|
||||
type(api::SECURITYTYPE_STOCK), exchange(api::VENUE_UNSET),
|
||||
type(api::SECURITYTYPE_SPOT), exchange(api::VENUE_UNSET),
|
||||
display_factor(0), price_break(0), low_tick(0), high_tick(0),
|
||||
cash_per_point(0), cboe_class_key(0), cme_market_segment_id(0),
|
||||
cme_main_fraction(0), cme_sub_fraction(0), cme_price_display_format(0),
|
||||
@@ -260,8 +260,8 @@ void convert_security(const FixedSecurity &source, Security *presult) {
|
||||
bts_assert(dest.symbol() == source.symbol());
|
||||
break;
|
||||
}
|
||||
case SECURITYTYPE_STOCK: {
|
||||
bts_assert(source.size == sizeof(FixedStockSecurity));
|
||||
case SECURITYTYPE_SPOT: {
|
||||
bts_assert(source.size == sizeof(FixedSpotSecurity));
|
||||
dest.mutable_spot();
|
||||
break;
|
||||
}
|
||||
@@ -281,7 +281,7 @@ SecurityType securitytype_of_contractcase(Security::ContractCase cc) {
|
||||
case Security::ContractCase::kOption:
|
||||
return SECURITYTYPE_OPTION;
|
||||
case Security::ContractCase::kSpot:
|
||||
return api::SECURITYTYPE_STOCK;
|
||||
return api::SECURITYTYPE_SPOT;
|
||||
case Security::ContractCase::kSpread:
|
||||
return SECURITYTYPE_SPREAD;
|
||||
case Security::ContractCase::kSynthetic:
|
||||
@@ -457,7 +457,7 @@ void convert_security(
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case SECURITYTYPE_STOCK:
|
||||
case SECURITYTYPE_SPOT:
|
||||
break;
|
||||
case SECURITYTYPE_UNSET:
|
||||
case SecurityType_INT_MAX_SENTINEL_DO_NOT_USE_:
|
||||
|
||||
@@ -95,9 +95,9 @@ class BTS_EXPORT FixedSecurity {
|
||||
char _mic_code[4];
|
||||
};
|
||||
|
||||
class FixedStockSecurity : public FixedSecurity {
|
||||
class FixedSpotSecurity : public FixedSecurity {
|
||||
public:
|
||||
FixedStockSecurity() { type = api::SECURITYTYPE_STOCK; };
|
||||
FixedSpotSecurity() { type = api::SECURITYTYPE_SPOT; };
|
||||
};
|
||||
|
||||
class BTS_EXPORT FixedFutureSecurity : public FixedSecurity {
|
||||
@@ -269,7 +269,7 @@ inline void to_json(nlohmann::json &j, const FixedSecurity &f) {
|
||||
};
|
||||
|
||||
switch (f.type) {
|
||||
case api::SECURITYTYPE_STOCK:
|
||||
case api::SECURITYTYPE_SPOT:
|
||||
break;
|
||||
case api::SECURITYTYPE_FUTURE: {
|
||||
auto *fut = static_cast<const FixedFutureSecurity *>(&f);
|
||||
@@ -316,8 +316,8 @@ void with_security(
|
||||
const api::Security *psynthetic,
|
||||
C cb) {
|
||||
switch (type) {
|
||||
case api::SECURITYTYPE_STOCK: {
|
||||
FixedStockSecurity security;
|
||||
case api::SECURITYTYPE_SPOT: {
|
||||
FixedSpotSecurity security;
|
||||
bts_assert(security.type == type);
|
||||
cb(security);
|
||||
return;
|
||||
|
||||
@@ -100,8 +100,8 @@ inline std::size_t SymbolLoader::load(
|
||||
vcfg.name());
|
||||
continue;
|
||||
}
|
||||
if (include_all || filter.includes(venue, SEC_TYPE(STOCK))) {
|
||||
add_symbols(vcfg.spot(), venue, SEC_TYPE(STOCK), result);
|
||||
if (include_all || filter.includes(venue, SEC_TYPE(SPOT))) {
|
||||
add_symbols(vcfg.spot(), venue, SEC_TYPE(SPOT), result);
|
||||
}
|
||||
if (include_all || filter.includes(venue, SEC_TYPE(FUTURE))) {
|
||||
add_symbols(vcfg.future(), venue, SEC_TYPE(FUTURE), result);
|
||||
|
||||
@@ -54,7 +54,7 @@ struct UserSymbol {
|
||||
}
|
||||
|
||||
// No move constructor -
|
||||
// because in this case the std::string will be a stock symbol which should
|
||||
// because in this case the std::string will be a spot symbol which should
|
||||
// be small enough to be inlined in both msvsc and gcc/clang
|
||||
|
||||
private:
|
||||
|
||||
@@ -253,7 +253,7 @@ class RelayClient {
|
||||
case SecurityType::SECURITYTYPE_OPTION:
|
||||
log << "Opt ";
|
||||
break;
|
||||
case SecurityType::SECURITYTYPE_STOCK:
|
||||
case SecurityType::SECURITYTYPE_SPOT:
|
||||
log << "Spt ";
|
||||
break;
|
||||
case SecurityType::SECURITYTYPE_SYNTHETIC:
|
||||
|
||||
@@ -29,7 +29,7 @@ struct StaticLimiter {
|
||||
else if (sec.has_option())
|
||||
return api::SECURITYTYPE_OPTION;
|
||||
else if (sec.has_spot())
|
||||
return api::SECURITYTYPE_STOCK;
|
||||
return api::SECURITYTYPE_SPOT;
|
||||
return api::SECURITYTYPE_UNSET;
|
||||
};
|
||||
for (const auto &r : rl.risk_limits()) {
|
||||
|
||||
@@ -7,14 +7,14 @@ namespace bts::cmds::md {
|
||||
|
||||
EnumOptionNames<api::SecurityType> SecurityTypeOption::names() {
|
||||
return {
|
||||
NAME_PAIR(api::SECURITYTYPE_STOCK), NAME_PAIR(api::SECURITYTYPE_FUTURE),
|
||||
NAME_PAIR(api::SECURITYTYPE_SPOT), NAME_PAIR(api::SECURITYTYPE_FUTURE),
|
||||
NAME_PAIR(api::SECURITYTYPE_OPTION), NAME_PAIR(api::SECURITYTYPE_SPREAD),
|
||||
NAME_PAIR(api::SECURITYTYPE_SYNTHETIC)};
|
||||
}
|
||||
|
||||
std::string SecurityTypeOption::name(api::SecurityType venue) {
|
||||
switch (venue) {
|
||||
case api::SECURITYTYPE_STOCK:
|
||||
case api::SECURITYTYPE_SPOT:
|
||||
return "spot";
|
||||
case api::SECURITYTYPE_FUTURE:
|
||||
return "future";
|
||||
|
||||
@@ -109,7 +109,7 @@ bts::api::SecurityType convert_securitytype(
|
||||
case emumba::market_data::security_type::future:
|
||||
return api::SecurityType::SECURITYTYPE_FUTURE;
|
||||
case emumba::market_data::security_type::index:
|
||||
return api::SecurityType::SECURITYTYPE_STOCK;
|
||||
return api::SecurityType::SECURITYTYPE_SPOT;
|
||||
case emumba::market_data::security_type::option:
|
||||
return api::SecurityType::SECURITYTYPE_OPTION;
|
||||
case emumba::market_data::security_type::spread:
|
||||
@@ -727,7 +727,7 @@ void EmMDListener::on_securities(
|
||||
case (api::SecurityType::SECURITYTYPE_FUTURE):
|
||||
_add_future(sec);
|
||||
break;
|
||||
case (api::SecurityType::SECURITYTYPE_STOCK):
|
||||
case (api::SecurityType::SECURITYTYPE_SPOT):
|
||||
_add_spot(sec);
|
||||
break;
|
||||
case (api::SecurityType::SECURITYTYPE_OPTION):
|
||||
|
||||
Reference in new issue
Block a user