Files
foxhunt/sql/test_stop_loss_debug.sql
jgrusewski 8d89fe80ff chore: Second cleanup wave - organize root directory
- Archive: 85 agent .txt files → docs/archive/agents/legacy_txt/
- Scripts: Move 110 shell scripts → scripts/ (keep deploy.sh in root)
- Models: Move 18 .safetensors → ml/models/checkpoints/training_artifacts/
- Delete: 34 directories (~33GB freed) - target/, coverage_*, test artifacts
- Build: Clean 14 build artifacts (.rlib, .o, .pid, binaries)
- Tests: Move 14 .rs files → tests/standalone/
- SQL: Move 5 files → sql/ (keep init-db*.sql for Docker)
- Wave 153: Archive to docs/archive/historical/wave153/
- Docs: Archive 9 markdown files to wave_d/reports/ and historical/

Total impact: ~34GB freed (both waves), root directory cleaned from 583 to ~40 essential files
Directory count reduced from 65 to 31 (52% reduction)
All historical data preserved in organized archive structure
2025-10-30 01:26:02 +01:00

40 lines
1.0 KiB
SQL

-- Debug script for stop-loss integration test
-- Check if regime state exists
SELECT 'Regime State:' as step;
SELECT symbol, regime, confidence FROM regime_states WHERE symbol = 'NQ.FUT' ORDER BY event_timestamp DESC LIMIT 1;
-- Check if market data exists
SELECT 'Market Data Count:' as step;
SELECT COUNT(*) as bar_count FROM prices WHERE symbol = 'NQ.FUT';
-- Check market data values
SELECT 'Market Data Sample:' as step;
SELECT
high::FLOAT8 / 100.0 as high,
low::FLOAT8 / 100.0 as low,
close::FLOAT8 / 100.0 as close
FROM prices
WHERE symbol = 'NQ.FUT'
ORDER BY timestamp DESC
LIMIT 5;
-- Test ATR calculation manually
SELECT 'Manual ATR Check:' as step;
WITH bars AS (
SELECT
high::FLOAT8 / 100.0 as high,
low::FLOAT8 / 100.0 as low,
close::FLOAT8 / 100.0 as close,
timestamp
FROM prices
WHERE symbol = 'NQ.FUT'
ORDER BY timestamp DESC
LIMIT 20
)
SELECT
AVG(high - low) as avg_range,
MAX(high - low) as max_range,
MIN(high - low) as min_range
FROM bars;