|
|
@@ -95,6 +95,10 @@ impl Predictor {
|
|
|
const DONT_VIEW: Decimal = dec!(14142135623730951);
|
|
|
|
|
|
pub fn new(_cci_arc: Arc<Mutex<CentralControlInfo>>, params: Params) -> Self {
|
|
|
+ if params.close.is_zero() {
|
|
|
+ panic!("做市策略特殊逻辑要求平仓距离不得为0。");
|
|
|
+ }
|
|
|
+
|
|
|
// 创建数据通道
|
|
|
// 创建一个无界通道
|
|
|
let (tx, mut rx) = futures_channel::mpsc::unbounded::<Vec<Decimal>>();
|
|
|
@@ -203,10 +207,6 @@ impl Predictor {
|
|
|
trade_amount: Default::default(),
|
|
|
};
|
|
|
|
|
|
- if params.close.is_zero() {
|
|
|
- panic!("做市策略特殊逻辑要求平仓距离不得为0。");
|
|
|
- }
|
|
|
-
|
|
|
predictor
|
|
|
}
|
|
|
|