diff --git a/src/__pycache__/main_ml.cpython-310.pyc b/src/__pycache__/main_ml.cpython-310.pyc index 5a0d36c..af6a736 100644 Binary files a/src/__pycache__/main_ml.cpython-310.pyc and b/src/__pycache__/main_ml.cpython-310.pyc differ diff --git a/src/__pycache__/web_dashboard.cpython-310.pyc b/src/__pycache__/web_dashboard.cpython-310.pyc index e56b85a..c887460 100644 Binary files a/src/__pycache__/web_dashboard.cpython-310.pyc and b/src/__pycache__/web_dashboard.cpython-310.pyc differ diff --git a/src/web_dashboard.py b/src/web_dashboard.py index e1323ed..18d6043 100644 --- a/src/web_dashboard.py +++ b/src/web_dashboard.py @@ -114,12 +114,14 @@ async def update_state(data: dict): return {"status": "updated"} @app.post("/api/trade/buy") -async def record_buy(pair: str, qty: float, price: float): +async def record_buy(pair: str, qty: float, price: float, entry_time: str = None): """Record a buy trade""" + if entry_time is None: + entry_time = datetime.now().isoformat() trading_state['current_trades'][pair] = { 'qty': qty, - 'entry_price': price, - 'entry_time': datetime.now().isoformat(), + 'price': price, + 'entry_time': entry_time, 'type': 'BUY' } trading_state['trades_today'] += 1