|
|
@@ -42,7 +42,7 @@ pub struct Core {
|
|
|
//
|
|
|
pub strategy: Strategy,
|
|
|
// 本地挂单时间表
|
|
|
- pub local_order_times: HashMap<String, i64>,
|
|
|
+ pub local_order_infos: HashMap<String, Vec<String>>,
|
|
|
// 本地挂单表
|
|
|
pub local_orders: HashMap<String, OrderInfo>,
|
|
|
// 本地订单缓存队列
|
|
|
@@ -137,7 +137,7 @@ impl Core {
|
|
|
// 现货底仓
|
|
|
hold_coin: clip(params.hold_coin, Decimal::ZERO, Decimal::ONE_HUNDRED * Decimal::ONE_HUNDRED),
|
|
|
strategy: Strategy::new(¶ms, true),
|
|
|
- local_order_times: Default::default(),
|
|
|
+ local_order_infos: Default::default(),
|
|
|
local_orders: Default::default(),
|
|
|
local_orders_backup: Default::default(),
|
|
|
local_orders_backup_cid: Default::default(),
|
|
|
@@ -493,12 +493,18 @@ impl Core {
|
|
|
}
|
|
|
// info!("成交单耗时数据:{}", time_record.to_string());
|
|
|
info!("更新推算仓位 {:?}", self.local_position_by_orders);
|
|
|
- info!("当前时间-订单委托时间={}ms", Utc::now().timestamp_millis() - self.local_order_times.get(&data.client_id).unwrap());
|
|
|
+ let place_time = self.local_order_infos.get(&data.client_id).unwrap()[4].parse::<i64>().unwrap();
|
|
|
+ info!("当前时间-订单委托时间={}ms", Utc::now().timestamp_millis() - place_time);
|
|
|
if let Some(cancel_time) = self.local_cancel_time.get(&data.client_id) {
|
|
|
info!("当前时间-订单首次取消时间={}ms", Utc::now().timestamp_millis() - cancel_time)
|
|
|
} else {
|
|
|
info!("没有提交过取消订单")
|
|
|
}
|
|
|
+ info!("委托时fp={}, mp={}, op={}",
|
|
|
+ self.local_order_infos.get(&data.client_id).unwrap()[5],
|
|
|
+ self.local_order_infos.get(&data.client_id).unwrap()[6],
|
|
|
+ self.local_order_infos.get(&data.client_id).unwrap()[7]
|
|
|
+ );
|
|
|
// 本地计算利润
|
|
|
self._print_local_trades_summary().await;
|
|
|
// 打印各类信息
|
|
|
@@ -827,7 +833,7 @@ impl Core {
|
|
|
fee: Default::default(),
|
|
|
trace_stack: TraceStack::new(0, Instant::now()),
|
|
|
};
|
|
|
- self.local_order_times.insert(orders.limits_open.get(j).unwrap()[3].clone(), Utc::now().timestamp_millis());
|
|
|
+ self.local_order_infos.insert(orders.limits_open.get(j).unwrap()[3].clone(), orders.limits_open.get(j).unwrap().clone());
|
|
|
// 本地挂单表
|
|
|
self.local_orders.insert(orders.limits_open.get(j).unwrap()[3].clone(), order_info.clone());
|
|
|
// 本地缓存表
|