diff --git a/src/trading/journal.py b/src/trading/journal.py index dac8f93..73969f7 100644 --- a/src/trading/journal.py +++ b/src/trading/journal.py @@ -536,7 +536,10 @@ def get_trade_history(limit: int = 50): with create_client() as client: query = f""" SELECT - *, + id, position_id, ticker, entry_date, shares, entry_price, + target_price, stop_loss, strategy, order_type, direction, + followed_rules, entry_reason, exit_price, exit_date, + exit_reason, notes, created_at, groupArray(ticker) OVER (PARTITION BY position_id) as related_tickers, groupArray(id) OVER (PARTITION BY position_id) as related_ids FROM stock_db.trades @@ -544,9 +547,11 @@ def get_trade_history(limit: int = 50): LIMIT {limit} """ result = client.query(query).result_rows - columns = ['id', 'position_id', 'ticker', 'entry_date', 'shares', 'entry_price', 'target_price', - 'stop_loss', 'strategy', 'order_type', 'followed_rules', 'entry_reason', 'exit_price', - 'exit_date', 'exit_reason', 'notes', 'created_at', 'direction', 'related_tickers', 'related_ids'] + columns = ['id', 'position_id', 'ticker', 'entry_date', 'shares', + 'entry_price', 'target_price', 'stop_loss', 'strategy', + 'order_type', 'direction', 'followed_rules', 'entry_reason', + 'exit_price', 'exit_date', 'exit_reason', 'notes', + 'created_at', 'related_tickers', 'related_ids'] return [dict(zip(columns, row)) for row in result] def journal_menu():