skyffire 1 yıl önce
ebeveyn
işleme
731fec37c3
2 değiştirilmiş dosya ile 4 ekleme ve 3 silme
  1. 1 1
      global/src/cci.rs
  2. 3 2
      strategy/src/avellaneda_stoikov.rs

+ 1 - 1
global/src/cci.rs

@@ -16,7 +16,7 @@ pub struct CentralControlInfo {
 
 impl CentralControlInfo {
     // 时间窗口大小(微秒)
-    const MAX_TIME_RANGE_MICROS: i64 = 5 * 60_000_000;
+    const MAX_TIME_RANGE_MICROS: i64 = 3 * 60_000_000;
 
     pub fn new() -> Self {
         Self {

+ 3 - 2
strategy/src/avellaneda_stoikov.rs

@@ -53,6 +53,7 @@ impl AvellanedaStoikov {
     // 时间窗口大小(微秒)
     const MAX_TIME_RANGE_MICROS: i64 = 3 * 60_000_000;
     const TRADE_LONG_RANGE_MICROS: i64 = 3 * 60_000_000;
+    const SPREAD_RANGE_MICROS: i64 = 6 * 60_000_000;
     const TRADE_SHORT_RANGE_MICROS: i64 = 60_000_000;
     // const ONE_MILLION: Decimal = dec!(1_000_000);
     // const TWENTY_THOUSAND: Decimal = dec!(20_000);
@@ -65,7 +66,7 @@ impl AvellanedaStoikov {
             fair_price_vec: vec![Decimal::ZERO; 10],
 
             // 老的队列
-            spread_vec: FixedTimeRangeDeque::new(Self::MAX_TIME_RANGE_MICROS),
+            spread_vec: FixedTimeRangeDeque::new(Self::SPREAD_RANGE_MICROS),
             trade_long_vec: FixedTimeRangeDeque::new(Self::TRADE_LONG_RANGE_MICROS),
             trade_short_vec: FixedTimeRangeDeque::new(Self::TRADE_SHORT_RANGE_MICROS),
             record_vec: VecDeque::new(),
@@ -230,7 +231,7 @@ impl AvellanedaStoikov {
     }
 
     pub fn update_sigma_square(&mut self) {
-        self.sigma_square = self.spread_max * dec!(0.6);
+        self.sigma_square = self.spread_max * dec!(0.5);
         self.sigma_square.rescale(10);
     }