diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-01 17:11:51 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-01 17:11:51 +0900 |
| commit | 66368d580cf569b50a33e438f2287a977e6fc704 (patch) | |
| tree | 8a3b9e538333abf4564846849affec1ef1279e05 /services/strategy-engine/strategies/vwap_strategy.py | |
| parent | 2d1530f210f4b4f679a5d3b3597c4815904398a7 (diff) | |
test: add edge case tests for zero volume, empty data, extreme values
Diffstat (limited to 'services/strategy-engine/strategies/vwap_strategy.py')
| -rw-r--r-- | services/strategy-engine/strategies/vwap_strategy.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/services/strategy-engine/strategies/vwap_strategy.py b/services/strategy-engine/strategies/vwap_strategy.py index 78919f1..f371c32 100644 --- a/services/strategy-engine/strategies/vwap_strategy.py +++ b/services/strategy-engine/strategies/vwap_strategy.py @@ -56,6 +56,8 @@ class VwapStrategy(BaseStrategy): return None vwap = self._cumulative_tp_vol / self._cumulative_vol + if vwap == 0.0: + return None deviation = (close - vwap) / vwap if deviation < -self._deviation_threshold: |
