|
|
@@ -20,8 +20,13 @@ use crate::model::{OrderInfo, OriginalTradeGa};
|
|
|
use crate::quant::Quant;
|
|
|
|
|
|
// 1交易、0参考 kucoin 合约 启动
|
|
|
-pub async fn kucoin_swap_run(bool_v1 :Arc<AtomicBool>, type_num: i8, quant_arc: Arc<Mutex<Quant>>,
|
|
|
- name: String, symbols: Vec<String>, exchange_params: BTreeMap<String, String>) {
|
|
|
+pub async fn kucoin_swap_run(bool_v1 :Arc<AtomicBool>,
|
|
|
+ is_trade: bool,
|
|
|
+ quant_arc: Arc<Mutex<Quant>>,
|
|
|
+ name: String,
|
|
|
+ symbols: Vec<String>,
|
|
|
+ is_colo: bool,
|
|
|
+ exchange_params: BTreeMap<String, String>) {
|
|
|
let symbols_clone = symbols.clone();
|
|
|
let mut symbol_arr = Vec::new();
|
|
|
for symbol in symbols_clone {
|
|
|
@@ -56,9 +61,9 @@ pub async fn kucoin_swap_run(bool_v1 :Arc<AtomicBool>, type_num: i8, quant_arc:
|
|
|
let write_tx_am = Arc::new(Mutex::new(write_tx));
|
|
|
|
|
|
// 交易
|
|
|
- if type_num == 1 {
|
|
|
+ if is_trade {
|
|
|
let login_params = parse_btree_map_to_kucoin_swap_login(exchange_params);
|
|
|
- kucoin_exc = KucoinSwapWs::new_label(name.clone(), false, Option::from(login_params), KucoinSwapWsType::Private).await;
|
|
|
+ kucoin_exc = KucoinSwapWs::new_label(name.clone(), is_colo, Option::from(login_params), KucoinSwapWsType::Private).await;
|
|
|
kucoin_exc.set_subscribe(vec![
|
|
|
KucoinSwapSubscribeType::PuContractMarketLevel2Depth50,
|
|
|
// KucoinSwapSubscribeType::PuContractMarkettickerV2,
|
|
|
@@ -67,7 +72,7 @@ pub async fn kucoin_swap_run(bool_v1 :Arc<AtomicBool>, type_num: i8, quant_arc:
|
|
|
KucoinSwapSubscribeType::PrContractMarketTradeOrders
|
|
|
]);
|
|
|
} else { // 参考
|
|
|
- kucoin_exc = KucoinSwapWs::new_label(name.clone(), false, None, KucoinSwapWsType::Public).await;
|
|
|
+ kucoin_exc = KucoinSwapWs::new_label(name.clone(), is_colo, None, KucoinSwapWsType::Public).await;
|
|
|
kucoin_exc.set_subscribe(vec![
|
|
|
KucoinSwapSubscribeType::PuContractMarketLevel2Depth50,
|
|
|
// python注释掉了
|