|
|
@@ -233,7 +233,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 更新当前strategy的各类信息
|
|
|
- #[instrument(skip(self, trader_msg), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, trader_msg), level="TRACE")]
|
|
|
pub fn _update_data(&mut self, trader_msg: &TraderMsg) -> bool {
|
|
|
debug!(?self);
|
|
|
debug!(?trader_msg);
|
|
|
@@ -348,7 +348,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 取消目标方向订单,原文是_cancel_targit_side_orders
|
|
|
- #[instrument(skip(self, command), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, command), level="TRACE")]
|
|
|
pub fn _cancel_target_side_orders(&self, command: &mut OrderCommand) {
|
|
|
// 要取消的目标方向
|
|
|
let target_side = vec![
|
|
|
@@ -376,7 +376,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 生成各类挂单价格,原文是gen_dist
|
|
|
- #[instrument(skip(self), level="DEBUG")]
|
|
|
+ #[instrument(skip(self), level="TRACE")]
|
|
|
pub fn generate_dist(&mut self) {
|
|
|
let open = self.trade_open_dist;
|
|
|
let close = self.trade_close_dist;
|
|
|
@@ -442,7 +442,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 统计请求次数
|
|
|
- #[instrument(skip(self, command), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, command), level="TRACE")]
|
|
|
pub fn _update_request_num(&mut self, command: &OrderCommand) {
|
|
|
debug!(?command);
|
|
|
debug!(?self.request_order_count, ?self.request_count);
|
|
|
@@ -457,7 +457,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 根据平均请求次数限制开仓下单
|
|
|
- #[instrument(skip(self, command), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, command), level="TRACE")]
|
|
|
pub fn _check_request_limit(&mut self, command: &mut OrderCommand) {
|
|
|
debug!(?command);
|
|
|
// 如果当前请求数超过限制
|
|
|
@@ -493,7 +493,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 新增正在撤单、检查撤单队列,释放过时限制
|
|
|
- #[instrument(skip(self), level="DEBUG")]
|
|
|
+ #[instrument(skip(self), level="TRACE")]
|
|
|
pub fn _update_in_cancel(&mut self, command: &mut OrderCommand) {
|
|
|
let mut new_cancel: HashMap<String, Vec<String>> = HashMap::new();
|
|
|
|
|
|
@@ -529,7 +529,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 维护查单队列,检查是否在撤单
|
|
|
- #[instrument(skip(self), level="DEBUG")]
|
|
|
+ #[instrument(skip(self), level="TRACE")]
|
|
|
pub fn _release_in_check(&mut self) {
|
|
|
debug!(?self.in_check);
|
|
|
// 为什么要移出来:Rust不允许边循环边修改map
|
|
|
@@ -555,7 +555,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 检查是否正在撤单
|
|
|
- #[instrument(skip(self), level="DEBUG")]
|
|
|
+ #[instrument(skip(self), level="TRACE")]
|
|
|
pub fn _release_in_cancel(&mut self) {
|
|
|
debug!(?self.in_cancel);
|
|
|
// 为什么要移出来:Rust不允许边循环边修改map
|
|
|
@@ -593,7 +593,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 刷新持仓比例
|
|
|
- #[instrument(skip(self), level="DEBUG")]
|
|
|
+ #[instrument(skip(self), level="TRACE")]
|
|
|
pub fn _pos_rate(&mut self) {
|
|
|
debug!(?self);
|
|
|
|
|
|
@@ -655,7 +655,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 清空所有挂单和仓位保持休眠状态
|
|
|
- #[instrument(skip(self, command), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, command), level="TRACE")]
|
|
|
pub fn _close_all(&self, command: &mut OrderCommand) {
|
|
|
// 撤掉全部挂单
|
|
|
let mut pd_amount = Decimal::ZERO;
|
|
|
@@ -750,7 +750,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 平仓订单处理命令
|
|
|
- #[instrument(skip(self, command), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, command), level="TRACE")]
|
|
|
pub fn _post_close(&self, command: &mut OrderCommand) {
|
|
|
debug!(?command);
|
|
|
|
|
|
@@ -895,7 +895,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 生成取消订单的指令
|
|
|
- #[instrument(skip(self, command), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, command), level="TRACE")]
|
|
|
pub fn _cancel_open(&self, command: &mut OrderCommand) {
|
|
|
debug!(?command);
|
|
|
// 挂单范围
|
|
|
@@ -932,7 +932,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 超时触发查单信号
|
|
|
- #[instrument(skip(self, command), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, command), level="TRACE")]
|
|
|
pub fn _check_local_orders(&mut self, command: &mut OrderCommand) {
|
|
|
debug!(?command);
|
|
|
// 超时检测
|
|
|
@@ -974,7 +974,7 @@ impl Strategy {
|
|
|
}
|
|
|
|
|
|
// 开单指令生成逻辑
|
|
|
- #[instrument(skip(self, command), level="DEBUG")]
|
|
|
+ #[instrument(skip(self, command), level="TRACE")]
|
|
|
pub fn _post_open(&mut self, command: &mut OrderCommand) {
|
|
|
debug!(?command);
|
|
|
// 开仓逻辑检测,主要是检测整点开仓逻辑
|