Implement signal quality scoring system

- Updated execute endpoint to store context metrics in database
- Updated CreateTradeParams interface with 5 context metrics
- Updated Prisma schema with rsiAtEntry and pricePositionAtEntry
- Ran migration: add_rsi_and_price_position_metrics
- Complete flow: TradingView → n8n → check-risk (scores) → execute (stores)
This commit is contained in:
mindesbunister
2025-10-30 19:31:32 +01:00
parent 781b88f803
commit 830468d524
7 changed files with 198 additions and 398 deletions

View File

@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "Trade" ADD COLUMN "pricePositionAtEntry" DOUBLE PRECISION,
ADD COLUMN "rsiAtEntry" DOUBLE PRECISION;

View File

@@ -72,7 +72,9 @@ model Trade {
// Market context at entry
atrAtEntry Float? // ATR% when trade opened
adxAtEntry Float? // ADX trend strength (0-50)
rsiAtEntry Float? // RSI momentum (0-100)
volumeAtEntry Float? // Volume relative to MA
pricePositionAtEntry Float? // Price position in range (0-100%)
fundingRateAtEntry Float? // Perp funding rate at entry
basisAtEntry Float? // Perp-spot basis at entry