Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20c369ddcb | ||
|
|
7b98d35fb3 |
No files matched your search
@@ -17,7 +17,7 @@ type Tab =
|
||||
| PositionManagementTab
|
||||
| MarginTab
|
||||
|
||||
let venues = [| Venue.BINANCE; Venue.BinanceUs; Venue.BinanceUsdsFutures; Venue.CBOE; Venue.COINBASE; Venue.DERIBIT; Venue.GLBX; Venue.ICE; Venue.TAIFEX; Venue.SIM; |]
|
||||
let venues = [| Venue.BINANCE; Venue.BinanceUs; Venue.BinanceUsdsFutures; Venue.CBOE; Venue.COINBASE; Venue.DERIBIT; Venue.GLBX; Venue.ICE; Venue.TAIFEX; Venue.TWSE; Venue.SIM; |]
|
||||
|
||||
let securityTypes = [| SecurityType.SPOT; SecurityType.FUTURE; SecurityType.OPTION; SecurityType.SPREAD; |]
|
||||
|
||||
@@ -74,6 +74,11 @@ type TaifexExchangeField =
|
||||
| Origin of CustomerOrFirm
|
||||
| ClearingAccount of string
|
||||
|
||||
type TwseExchangeField =
|
||||
| CTI of CTICode
|
||||
| Origin of CustomerOrFirm
|
||||
| ClearingAccount of string
|
||||
|
||||
type SIMExchangeField =
|
||||
| CTI of CTICode
|
||||
| Origin of CustomerOrFirm
|
||||
|
||||
@@ -800,6 +800,7 @@ let venueToString (venue:bts.api.Venue) =
|
||||
| bts.api.Venue.FTX -> "FTX"
|
||||
| bts.api.Venue.OKX -> "OKX"
|
||||
| bts.api.Venue.TAIFEX -> "TAIFEX"
|
||||
| bts.api.Venue.TWSE -> "TWSE"
|
||||
|
||||
let exchange_display expirationNameList =
|
||||
let s = sprintf "%O" expirationNameList.product.exchange
|
||||
|
||||
@@ -111,6 +111,7 @@ namespace bts.api {
|
||||
Security.ExchangeDataOneofCase.Okx => security.Okx.SecurityDesc,
|
||||
Security.ExchangeDataOneofCase.Cboe => security.Cboe.SecurityDesc,
|
||||
Security.ExchangeDataOneofCase.Taifex => security.Taifex.SecurityDesc,
|
||||
Security.ExchangeDataOneofCase.Twse => security.Twse.SecurityDesc,
|
||||
_ => throw new NotImplementedException("security_desc not implemented for exchange")
|
||||
};
|
||||
|
||||
@@ -158,6 +159,7 @@ namespace bts.api {
|
||||
domain.Venue.Okx => Venue.Okx,
|
||||
domain.Venue.Cboe => Venue.Cboe,
|
||||
domain.Venue.Taifex => Venue.Taifex,
|
||||
domain.Venue.Twse => Venue.Twse,
|
||||
|
||||
|
||||
domain.Venue.Unspecified => Venue.Unset,
|
||||
@@ -178,6 +180,7 @@ namespace bts.api {
|
||||
Venue.Okx => domain.Venue.Okx,
|
||||
Venue.Cboe => domain.Venue.Cboe,
|
||||
Venue.Taifex => domain.Venue.Taifex,
|
||||
Venue.Twse => domain.Venue.Twse,
|
||||
|
||||
Venue.Unset => domain.Venue.Unspecified,
|
||||
_ => throw new NotImplementedException(),
|
||||
|
||||
@@ -27,4 +27,5 @@ enum Venue {
|
||||
VENUE_OKX = 15;
|
||||
VENUE_TAIFEX = 16;
|
||||
VENUE_CBOE = 17;
|
||||
VENUE_TWSE = 18;
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import "lib/api/md/EmumbaDeribitMarketDataConfig.proto";
|
||||
import "lib/api/md/OkxMarketDataConfig.proto";
|
||||
import "lib/api/md/GlbxMarketDataConfig.proto";
|
||||
import "lib/api/md/TaifexMarketDataConfig.proto";
|
||||
import "lib/api/md/TwseMarketDataConfig.proto";
|
||||
import "lib/api/md/CboeMarketDataConfig.proto";
|
||||
|
||||
option csharp_namespace = "bts.api.md";
|
||||
@@ -29,6 +30,7 @@ message MarketDataConfig {
|
||||
repeated GlbxMarketDataConfig glbx = 8;
|
||||
repeated CboeMarketDataConfig cboe = 9;
|
||||
repeated TaifexMarketDataConfig taifex =10;
|
||||
repeated TwseMarketDataConfig twse =11;
|
||||
// Add an entry here for all the exchanges that need their market data to be recorded
|
||||
|
||||
repeated EmumbaDeribitMarketDataConfig emumba_deribit = 100;
|
||||
|
||||
@@ -23,6 +23,8 @@ std::set<bts::api::Venue> MarketDataConfigUtils::get_live_exchanges(
|
||||
rv.insert(bts::api::VENUE_GLBX);
|
||||
if (cfg.taifex_size()>0)
|
||||
rv.insert(bts::api::VENUE_TAIFEX);
|
||||
if (cfg.twse_size()>0)
|
||||
rv.insert(bts::api::VENUE_TWSE);
|
||||
if (cfg.cboe_size()>0)
|
||||
rv.insert(bts::api::VENUE_CBOE);
|
||||
return rv;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "lib/api/domain/SecurityCriteria.proto";
|
||||
|
||||
package bts.api.md;
|
||||
|
||||
option csharp_namespace = "bts.api.md";
|
||||
message TwseConnectionDetails{
|
||||
string live_data_ip = 30;
|
||||
}
|
||||
|
||||
message TwseMarketDataConfig {
|
||||
uint32 unique_check_value = 1;
|
||||
bool read_from_file = 20;
|
||||
string realtime_data_file_name = 22;
|
||||
TwseConnectionDetails connection_details = 30;
|
||||
bts.api.domain.SecurityCriteria security_criteria = 3;
|
||||
|
||||
}
|
||||
@@ -72,6 +72,7 @@ bool AdminServiceUtils::has_exchange(
|
||||
case api::Venue::VENUE_OKX:
|
||||
case api::Venue::VENUE_BTS:
|
||||
case api::Venue::VENUE_CBOE:
|
||||
case api::Venue::VENUE_TWSE:
|
||||
case api::Venue::VENUE_TAIFEX:
|
||||
case api::Venue::VENUE_CBOECFE:
|
||||
case api::Venue::Venue_INT_MIN_SENTINEL_DO_NOT_USE_:
|
||||
@@ -187,6 +188,7 @@ AdminServiceUtils::resolve_connection(
|
||||
case api::Venue::VENUE_BINANCE:
|
||||
case api::Venue::VENUE_BINANCE_US:
|
||||
case api::Venue::VENUE_COINBASE:
|
||||
case api::Venue::VENUE_TWSE:
|
||||
case api::Venue::VENUE_TAIFEX:
|
||||
case api::Venue::VENUE_CBOE:
|
||||
case api::Venue::VENUE_BINANCE_USDS_FUTURES: {
|
||||
@@ -460,6 +462,7 @@ std::string AdminServiceUtils::find_account_exchange_account(
|
||||
case api::Venue::VENUE_OKX:
|
||||
case api::Venue::VENUE_BTS:
|
||||
case api::Venue::VENUE_CBOE:
|
||||
case api::Venue::VENUE_TWSE:
|
||||
case api::Venue::VENUE_TAIFEX:
|
||||
case api::Venue::VENUE_CBOECFE:
|
||||
case api::Venue::Venue_INT_MIN_SENTINEL_DO_NOT_USE_:
|
||||
@@ -757,6 +760,7 @@ bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(
|
||||
case api::VENUE_OKX:
|
||||
case api::Venue::VENUE_UNSET:
|
||||
case api::Venue::VENUE_BTS:
|
||||
case api::Venue::VENUE_TWSE:
|
||||
case api::Venue::VENUE_CBOECFE:
|
||||
case api::Venue::Venue_INT_MIN_SENTINEL_DO_NOT_USE_:
|
||||
case api::Venue::Venue_INT_MAX_SENTINEL_DO_NOT_USE_:
|
||||
@@ -1152,6 +1156,7 @@ std::string AdminServiceUtils::find_user_exchange_id(
|
||||
case api::Venue::VENUE_UNSET:
|
||||
case api::Venue::VENUE_BTS:
|
||||
case api::Venue::VENUE_CBOE:
|
||||
case api::Venue::VENUE_TWSE:
|
||||
case api::Venue::VENUE_TAIFEX:
|
||||
case api::Venue::VENUE_CBOECFE:
|
||||
case api::Venue::Venue_INT_MIN_SENTINEL_DO_NOT_USE_:
|
||||
@@ -1190,6 +1195,7 @@ std::string AdminServiceUtils::find_user_company_id(
|
||||
case api::Venue::VENUE_UNSET:
|
||||
case api::Venue::VENUE_BTS:
|
||||
case api::Venue::VENUE_CBOE:
|
||||
case api::Venue::VENUE_TWSE:
|
||||
case api::Venue::VENUE_TAIFEX:
|
||||
|
||||
case api::Venue::VENUE_CBOECFE:
|
||||
|
||||
@@ -19,6 +19,14 @@ SymbolLists {
|
||||
symbol: "BTC"
|
||||
symbol: "ETH"
|
||||
}
|
||||
list {
|
||||
key: "TWSE"
|
||||
symbol: "2330"
|
||||
symbol: "2317"
|
||||
symbol: "2454"
|
||||
symbol: "2603"
|
||||
symbol: "2615"
|
||||
}
|
||||
list {
|
||||
key: "TAIFEX"
|
||||
symbol: "QFFH"
|
||||
@@ -59,6 +67,11 @@ Symbols {
|
||||
future: @SymbolLists.list[GLBX].symbol
|
||||
spread: @SymbolLists.list[GLBX].symbol
|
||||
}
|
||||
venues{
|
||||
name: "VENUE_TWSE"
|
||||
future: @SymbolLists[TWSE].symbol
|
||||
option: @SymbolLists[TWSE].symbol
|
||||
}
|
||||
venues{
|
||||
name: "VENUE_TAIFEX"
|
||||
future: @SymbolLists[TAIFEX].symbol
|
||||
@@ -91,6 +104,11 @@ Symbols {
|
||||
future: @SymbolLists.list[ICE].symbol
|
||||
spread: @SymbolLists.list[ICE].symbol
|
||||
}
|
||||
venues{
|
||||
name: "VENUE_TWSE"
|
||||
future: @SymbolLists[TWSE].symbol
|
||||
option: @SymbolLists[TWSE].symbol
|
||||
}
|
||||
venues{
|
||||
name: "VENUE_TAIFEX"
|
||||
future: @SymbolLists[TAIFEX].symbol
|
||||
@@ -125,6 +143,11 @@ Symbols {
|
||||
option: @SymbolLists.list[DERIBIT].symbol
|
||||
spread: @SymbolLists.list[DERIBIT].symbol
|
||||
}
|
||||
venues{
|
||||
name: "VENUE_TWSE"
|
||||
future: @SymbolLists.list[TWSE].symbol
|
||||
option: @SymbolLists.list[TWSE].symbol
|
||||
}
|
||||
venues{
|
||||
name: "VENUE_TAIFEX"
|
||||
future: @SymbolLists.list[TAIFEX].symbol
|
||||
|
||||
@@ -25,6 +25,8 @@ api::domain::Venue DomainSecurityUtils::convert(bts::api::Venue venue) {
|
||||
return DOMAIN_VENUE(DERIBIT);
|
||||
case bts::api::Venue::VENUE_CBOE:
|
||||
return DOMAIN_VENUE(CBOE);
|
||||
case bts::api::Venue::VENUE_TWSE:
|
||||
return DOMAIN_VENUE(TWSE);
|
||||
case bts::api::Venue::VENUE_TAIFEX:
|
||||
return DOMAIN_VENUE(TAIFEX);
|
||||
case bts::api::Venue::VENUE_BTS:
|
||||
@@ -59,6 +61,8 @@ bts::api::Venue DomainSecurityUtils::convert(api::domain::Venue venue) {
|
||||
return api::Venue::VENUE_DERIBIT;
|
||||
case DOMAIN_VENUE(CBOE):
|
||||
return api::Venue::VENUE_CBOE;
|
||||
case DOMAIN_VENUE(TWSE):
|
||||
return api::Venue::VENUE_TWSE;
|
||||
case DOMAIN_VENUE(TAIFEX):
|
||||
return api::Venue::VENUE_TAIFEX;
|
||||
case DOMAIN_VENUE(FTX):
|
||||
@@ -171,6 +175,9 @@ bool DomainSecurityUtils::get_security_desc(
|
||||
case bts::api::Security::ExchangeDataCase::kCboe:
|
||||
desc = security.cboe().security_desc();
|
||||
break;
|
||||
case bts::api::Security::ExchangeDataCase::kTwse:
|
||||
desc = security.twse().security_desc();
|
||||
break;
|
||||
case bts::api::Security::ExchangeDataCase::kTaifex:
|
||||
desc = security.taifex().security_desc();
|
||||
break;
|
||||
|
||||
@@ -276,6 +276,8 @@ inline const std::string &descriptor(
|
||||
return sec.coinbase().security_desc();
|
||||
case api::Security::kOkx:
|
||||
return sec.okx().security_desc();
|
||||
case api::Security::kTwse:
|
||||
return sec.twse().security_desc();
|
||||
case api::Security::kTaifex:
|
||||
return sec.taifex().security_desc();
|
||||
default: {
|
||||
|
||||
@@ -20,6 +20,7 @@ enum Venue {
|
||||
VENUE_COINBASE = 450;
|
||||
VENUE_OKX = 460;
|
||||
VENUE_TAIFEX = 500;
|
||||
VENUE_TWSE = 600;
|
||||
}
|
||||
|
||||
enum SecurityType {
|
||||
@@ -87,6 +88,11 @@ message CBOEExchangeData {
|
||||
int32 class_key = 30;
|
||||
string source = 40;
|
||||
}
|
||||
message TWSEExchangeData {
|
||||
int64 exchange_id = 10;
|
||||
int32 class_key = 30;
|
||||
string security_desc = 20;
|
||||
}
|
||||
message TAIFEXExchangeData {
|
||||
int64 exchange_id = 10;
|
||||
int32 class_key = 30;
|
||||
@@ -233,6 +239,7 @@ message Security {
|
||||
CoinbaseExchangeData coinbase = 290;
|
||||
OkxExchangeData okx = 300;
|
||||
TAIFEXExchangeData taifex = 400;
|
||||
TWSEExchangeData twse = 500;
|
||||
}
|
||||
}
|
||||
message SecurityList {
|
||||
|
||||
@@ -146,6 +146,10 @@ void convert_security(const FixedSecurity &source, Security *presult) {
|
||||
dest.mutable_okx()->set_security_desc(source.security_desc());
|
||||
dest.mutable_okx()->set_exchange_id(source.numeric_id);
|
||||
break;
|
||||
case Venue::VENUE_TWSE:
|
||||
dest.mutable_twse()->set_security_desc(source.security_desc());
|
||||
dest.mutable_twse()->set_exchange_id(source.numeric_id);
|
||||
break;
|
||||
case Venue::VENUE_TAIFEX:
|
||||
dest.mutable_taifex()->set_security_desc(source.security_desc());
|
||||
dest.mutable_taifex()->set_exchange_id(source.numeric_id);
|
||||
@@ -256,6 +260,8 @@ uint64_t exchange_id(const Security &security) {
|
||||
return security.binance_usds_futures().exchange_id();
|
||||
case Security::ExchangeDataCase::kOkx:
|
||||
return security.okx().exchange_id();
|
||||
case Security::ExchangeDataCase::kTwse:
|
||||
return security.twse().exchange_id();
|
||||
case Security::ExchangeDataCase::kTaifex:
|
||||
return security.taifex().exchange_id();
|
||||
// Debatable whether this should be an error or not.
|
||||
@@ -289,10 +295,15 @@ void convert_security(
|
||||
dest.security_desc(src.cboe().security_desc());
|
||||
dest.cboe_class_key = src.cboe().class_key();
|
||||
break;
|
||||
case Security::ExchangeDataCase::kTwse:
|
||||
dest.numeric_id = src.twse().exchange_id();
|
||||
dest.security_desc(src.twse().security_desc());
|
||||
// dest.cboe_class_key = src.twse().class_key();
|
||||
break;
|
||||
case Security::ExchangeDataCase::kTaifex:
|
||||
dest.numeric_id = src.deribit().exchange_id();
|
||||
dest.security_desc(src.deribit().security_desc());
|
||||
dest.cboe_class_key = src.taifex().class_key();
|
||||
dest.numeric_id = src.taifex().exchange_id();
|
||||
dest.security_desc(src.taifex().security_desc());
|
||||
// dest.cboe_class_key = src.taifex().class_key();
|
||||
break;
|
||||
case Security::ExchangeDataCase::kCfe:
|
||||
dest.cboe_class_key = src.cfe().class_key();
|
||||
|
||||
@@ -194,6 +194,9 @@ struct MDConsumerGroup {
|
||||
case api::VENUE_CBOE:
|
||||
this->mic = "CBOE";
|
||||
break;
|
||||
case api::VENUE_TWSE:
|
||||
this->mic = "TWSE";
|
||||
break;
|
||||
case api::VENUE_TAIFEX:
|
||||
this->mic = "TAIFEX";
|
||||
break;
|
||||
|
||||
@@ -20,7 +20,8 @@ EnumOptionNames<api::Venue> VenueOption::names() {
|
||||
NAME_PAIR(api::VENUE_COINBASE),
|
||||
NAME_PAIR(api::VENUE_BINANCE_USDS_FUTURES),
|
||||
NAME_PAIR(api::VENUE_CBOE),
|
||||
NAME_PAIR(api::VENUE_TAIFEX)};
|
||||
NAME_PAIR(api::VENUE_TAIFEX),
|
||||
NAME_PAIR(api::VENUE_TWSE)};
|
||||
}
|
||||
|
||||
std::string VenueOption::name(api::Venue venue) {
|
||||
@@ -49,6 +50,8 @@ std::string VenueOption::name(api::Venue venue) {
|
||||
return "binance_usds_futures";
|
||||
case api::VENUE_CBOE:
|
||||
return "cboe";
|
||||
case api::VENUE_TWSE:
|
||||
return "twse";
|
||||
case api::VENUE_TAIFEX:
|
||||
return "taifex";
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user