From b9d21e2e2f7ae096c2f8a01bb142a685683b5b90 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 2 Apr 2026 09:44:43 +0900 Subject: feat: add market sentiment filters (Fear & Greed, CryptoPanic, CryptoQuant) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SentimentProvider: fetches Fear & Greed Index (free, no key), CryptoPanic news sentiment (free key), CryptoQuant exchange netflow (free key) - SentimentData: aggregated should_buy/should_block logic - Fear < 30 = buy opportunity, Greed > 80 = block buying - Negative news < -0.5 = block buying - Exchange outflow = bullish, inflow = bearish - Integrated into Asian Session RSI strategy as entry filter - All providers optional — disabled when API key missing - 14 sentiment tests + 386 total tests passing --- services/strategy-engine/tests/test_macd_strategy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'services/strategy-engine/tests/test_macd_strategy.py') diff --git a/services/strategy-engine/tests/test_macd_strategy.py b/services/strategy-engine/tests/test_macd_strategy.py index cd24ee0..17dd2cf 100644 --- a/services/strategy-engine/tests/test_macd_strategy.py +++ b/services/strategy-engine/tests/test_macd_strategy.py @@ -98,7 +98,9 @@ def test_macd_signal_line_crossover(): assert len(buy_signals) > 0, "Expected at least one BUY signal" # Check that at least one is a signal-line crossover or histogram crossover all_reasons = [sig.reason for sig in buy_signals] - assert any("crossover" in r for r in all_reasons), f"Expected crossover signal, got: {all_reasons}" + assert any("crossover" in r for r in all_reasons), ( + f"Expected crossover signal, got: {all_reasons}" + ) def test_macd_conviction_varies_with_distance(): -- cgit v1.2.3