INNER CODE UNIT · Python

params_with_pagination

GifariKemal/xaubot-ai · web-dashboard/api/main.py:170

    params_with_pagination = params + [limit, offset]
    trades = db.query(
        f"""SELECT id, ticket, direction, entry_price, exit_price, lot_size,
                   profit_usd, profit_pips, sl_price, tp_price,
                   opened_at, closed_at, exit_reason, confidence,
                   regime, session, duration_minutes
            FROM trades
            WHERE {where_sql}
            ORDER BY closed_at DESC
            LIMIT %s OFFSET %s""",
        tuple(params_with_pagination),
    )

    for t in trades:
        for k in ("opened_at", "closed_at"):
            if t.get(k) and hasattr(t[k], "isoformat"):
                t[k] = t[k].isoformat()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…