Position and Deal Stats Board
- 指标
- 版本: 1.0
Position and Deal Stats Board is a MetaTrader 5 panel indicator that builds two tables directly on the chart: per-symbol long/short lots and P/L for your open positions and for your closed deals, one row per symbol plus a totals row. TWO TABLES - Open Positions: walks the current positions and aggregates Buy Lots / Buy P/L / Sell Lots / Sell P/L per symbol (floating P/L; swap optional). - Closed Deals: the same four columns for closed deals; the period switches between Today / This week / This month / All history (server time, week starts on Monday; realized P/L includes commission and swap by default, each can be switched off). - Totals row: every table ends with totals of all symbols, even when the number of symbols exceeds the display limit. - Side attribution: selling to close counts on the buy side, buying to close counts on the sell side (opposite of the position direction); partial closes accumulate volume. INTERACTION - Bottom buttons: Today / Week / Month / All switch the closed-deals period; By symbol / By P/L toggles the sort order (A..Z or best P/L first - the button always shows the current mode); Refresh recomputes immediately. - Drag the title bar to move the panel; it keeps your position afterwards. - The panel height follows the number of symbols and scales down automatically when taller than the chart, so it is never clipped. - Profit values are green, loss values are red. INPUTS - InpPeriod / InpSort: default period and sort mode. - InpShowOpen / InpShowClosed: switch each table on or off. - InpMaxRows: maximum visible rows per table (0 = unlimited) with an overflow note; totals still include all symbols. - InpMagic: magic-number filter (0 = all); InpSymbols: symbol filter, comma separated, for example XAUUSD.e,EURUSD.e - InpSwapOpen / InpSwapClosed / InpCommClosed: include swap and commission in the shown P/L. - InpLotDigits / InpProfitDigits: decimals for lots and P/L. InpRefreshSec: auto refresh interval (default 3 seconds). - InpFont / InpUIScale / InpAlpha / InpClr*: font, interface scale, panel opacity and colors. DATA BASIS - Open Positions table = floating P/L (POSITION_PROFIT, optionally + POSITION_SWAP). - Closed Deals table = realized P/L (DEAL_PROFIT, optionally + DEAL_SWAP + DEAL_COMMISSION), closing deals only (including Close by); deposits, withdrawals and entry deals are not counted. - The two tables therefore use different bases: floating versus realized P/L. - Every refresh re-walks the open positions and scans the selected history range; Today / This week are cheap, All history scans the full account history (raise the refresh interval for very large histories). COMPATIBILITY - MetaTrader 5; any symbol, any timeframe, any account type (netting or hedged). - The whole interface is drawn with CCanvas bitmaps: it does not occupy an indicator subwindow and produces no plot buffers. - No DLL calls and no network access - the indicator only reads this account's positions and deal history.
