diff --git a/view_live_mt5_eas.py b/view_live_mt5_eas.py index 309aecb..befc533 100644 --- a/view_live_mt5_eas.py +++ b/view_live_mt5_eas.py @@ -686,12 +686,32 @@ cache/ _all_open.append(df_op) if _all_open: - open_df = pd.concat(_all_open, ignore_index=True) - show_cols = [c for c in ["_account","symbol","type","volume", - "open_time","open_price","sl","tp"] - if c in open_df.columns] + open_df = pd.concat(_all_open, ignore_index=True) + col_order = ["_account","open_time","position","symbol","type","volume", + "open_price","sl","tp","market_price","swap","profit","comment"] + show_cols = [c for c in col_order if c in open_df.columns] + rename_map = { + "_account" : "Account", + "open_time" : "Time", + "position" : "Position", + "symbol" : "Symbol", + "type" : "Type", + "volume" : "Volume", + "open_price" : "Price", + "sl" : "S/L", + "tp" : "T/P", + "market_price": "Market Price", + "swap" : "Swap", + "profit" : "Profit", + "comment" : "Comment", + } + disp = open_df[show_cols].rename(columns=rename_map).copy() + if "Time" in disp.columns: + disp["Time"] = pd.to_datetime( + disp["Time"], errors="coerce" + ).dt.strftime("%d.%m.%Y %H:%M") with st.expander(f"🔴 Open Positions ({len(open_df)})", expanded=True): - st.dataframe(open_df[show_cols], use_container_width=True, hide_index=True) + st.dataframe(disp, use_container_width=True, hide_index=True) else: st.caption("No open positions in current reports.")