- Bug: Validation queue used TradingView symbol format (SOLUSDT) to lookup market data cache - Cache uses normalized Drift format (SOL-PERP) - Result: Cache lookup failed, wrong/stale price shown in Telegram abandonment notifications - Real incident: Signal at $126.00 showed $98.18 abandonment price (-22.08% impossible drop) - Fix: Added normalizeTradingViewSymbol() call in check-risk endpoint before passing to validation queue - Files changed: app/api/trading/check-risk/route.ts (import + symbol normalization) - Impact: Validation queue now correctly retrieves current price from market data cache - Deployed: Dec 1, 2025
46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Test profile adapter logic"""
|
|
from money_line_v9 import MoneyLineV9Inputs
|
|
|
|
# Test profile adapter logic
|
|
config = {
|
|
'profile': 'minutes',
|
|
'atr_minutes': 12,
|
|
'mult_minutes': 3.8,
|
|
'rsi_long_min': 35,
|
|
'rsi_long_max': 70,
|
|
'rsi_short_min': 30,
|
|
'rsi_short_max': 70,
|
|
'vol_max': 3.5,
|
|
'entry_buffer': 0.2,
|
|
'adx_length': 16,
|
|
'use_ma_gap': False,
|
|
'ma_gap_min_long': 0.0,
|
|
'ma_gap_min_short': 0.0
|
|
}
|
|
|
|
# Simulate adapter logic
|
|
profile = config['profile']
|
|
atr_map = {'minutes': config.get('atr_minutes', 12)}
|
|
mult_map = {'minutes': config.get('mult_minutes', 3.8)}
|
|
|
|
# Create inputs with mapped parameters
|
|
inputs = MoneyLineV9Inputs(
|
|
atr_period=atr_map[profile],
|
|
multiplier=mult_map[profile],
|
|
rsi_long_min=config['rsi_long_min'],
|
|
rsi_long_max=config['rsi_long_max'],
|
|
rsi_short_min=config['rsi_short_min'],
|
|
rsi_short_max=config['rsi_short_max'],
|
|
vol_max=config['vol_max'],
|
|
entry_buffer_atr=config['entry_buffer'],
|
|
adx_length=config['adx_length'],
|
|
use_ma_gap_filter=config['use_ma_gap'],
|
|
ma_gap_long_min=config['ma_gap_min_long'],
|
|
ma_gap_short_max=config['ma_gap_min_short']
|
|
)
|
|
|
|
print(f"✅ MoneyLineV9Inputs created successfully!")
|
|
print(f" atr_period={inputs.atr_period}, multiplier={inputs.multiplier}")
|
|
print(f" use_ma_gap_filter={inputs.use_ma_gap_filter}")
|