diff --git a/src/strategies/custom/vwap_strategy.rs b/src/strategies/custom/vwap_strategy.rs index 1720d4d..57d3568 100644 --- a/src/strategies/custom/vwap_strategy.rs +++ b/src/strategies/custom/vwap_strategy.rs @@ -200,7 +200,7 @@ impl TradingStrategy for VWAPDayInitStrategy { Self: Sized { VWAPDayInitStrategy { - points_per_tick_asset: None, + points_per_tick_asset: Some(5.0), // FIXME: Hardcoded, need to update using min_point_variation cut_off_time_sending_orders: NaiveTime::from_hms_opt(10, 30, 00).unwrap(), time_force_close_open_positions: NaiveTime::from_hms_opt(17, 30, 00).unwrap(), min_candles: 20, @@ -209,7 +209,6 @@ impl TradingStrategy for VWAPDayInitStrategy { candle_parser: TimeCandlestickGenerator::new(TimeUnit::Minutes, CANDLESTICK_PERIOD), short_sma: SimpleMovingAverage::new(SHORT_SMA_PERIOD).unwrap(), long_sma: SimpleMovingAverage::new(LONG_SMA_PERIOD).unwrap(), - // ema: ExponentialMovingAverage::default(SHORT_SMA_PERIOD), vwap: VolumeWeightedAveragePrice::new().unwrap(), current_side: CandleDirection::UNDEFINED, open_position: None, @@ -220,8 +219,9 @@ impl TradingStrategy for VWAPDayInitStrategy { "VWAP_init_trading_day_strategy" } - fn init_trading_day(&mut self, asset: &Asset, _trades: &[Trade]) { - self.points_per_tick_asset = Some(asset.min_point_variation); + fn init_trading_day(&mut self, _asset: &Asset, _trades: &[Trade]) { + // FIXME: This is not working, need to update market-connector values for min_point_variation + // self.points_per_tick_asset = Some(asset.min_point_variation); self.candle_count = 0; self.quadrant_changed_signal_buffer = 0; @@ -232,6 +232,7 @@ impl TradingStrategy for VWAPDayInitStrategy { } fn process_new_trade(&mut self, new_trade: &Trade) -> TradeAction { + assert_ne!(self.points_per_tick_asset, None, "Points Per Tick Asset should not be None"); let mut order_open_position: Option = None; let order_close_position: Option = self.should_close_position(new_trade);