add paper trading: mark a setup as taken, track open P&L, sell
New paper_trades table (migration 007) + service/router. "Mark as taken" on each setup card (shares prefilled from position sizing, entry from current price, both editable) records a simulated trade. Overview gains an Open Trades table that marks each position to the latest close — P&L in $, %, and R-multiples — with a total unrealized P&L footer and a Sell button to close at the current price. Closed trades are retained for future realized-P&L reporting. Deploy: alembic upgrade (new paper_trades table). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,7 @@ from app.routers.sr_levels import router as sr_levels_router
|
||||
from app.routers.tickers import router as tickers_router
|
||||
from app.routers.jobs import router as jobs_router
|
||||
from app.routers.market import router as market_router
|
||||
from app.routers.paper_trades import router as paper_trades_router
|
||||
|
||||
|
||||
def _configure_logging() -> None:
|
||||
@@ -162,3 +163,4 @@ app.include_router(trades_router, prefix="/api/v1")
|
||||
app.include_router(watchlist_router, prefix="/api/v1")
|
||||
app.include_router(jobs_router, prefix="/api/v1")
|
||||
app.include_router(market_router, prefix="/api/v1")
|
||||
app.include_router(paper_trades_router, prefix="/api/v1")
|
||||
|
||||
Reference in New Issue
Block a user