Loading…

Realised Floating Split Bars

An account's daily P/L figure alone answers "how much" but not "how safe is it". A trader sitting on +$400 with all of it in closed, banked trades is in a completely different position from one sitting on +$400 that is entirely floating profit on two still-open positions - the first can only get worse if new trades go wrong, the second can evaporate on the next few candles even if no new trade is placed. This indicator draws one bar per calendar day (attach it to a D1 chart) in a subwindow. The solid histogram bar is the day's REALISED total: every order account-wide whose close time falls on that calendar day, summed. For today only, a marker is plotted at realised plus current floating P/L - the gap between the top of the bar and the marker is exactly the amount still at risk, still capable of moving before the day is done. Floating P/L only exists for the still-open trading day - a past day's floating result was, by definition, already folded into realised P/L by the time that day ended. Historical bars therefore show realised only, computed once on load (or when a new day's bar appears), not recalculated every tick. Today's bar is fully live: both realised-so-far and current floating are recomputed on every OnCalculate call. Native MQL4 has no DRAW_HISTOGRAM2 (confirmed by a hard compile error - that draw type is MQL5-only), so a true stacked-segment bar cannot be drawn directly the way the concept implies. The shipped design - a solid realised bar plus a single arrow marker at the realised+floating total on today's bar - reproduces the same "banked vs at risk" read without needing an unsupported draw type. Notes and limitations - Account-wide: it sums every closed/open order regardless of symbol or magic number, by design - a daily P/L split is a whole-account question, not a per-strategy one. - Realised totals for past days are computed once per load/bar-close, not live - if you manually close a trade whose close time falls on a day already drawn, revisit the chart (reload the indicator) to see it reflected. - No swap/commission breakdown by side - InpIncludeSwapCommission is all-or-nothing. - The floating marker is meaningless on any bar except today's and is intentionally left blank everywhere else. - Designed for D1; running it on an intraday timeframe still works but each "bar" will not correspond to a calendar day.

Indicator · MT4 · v1.0 · Free

About Realised Floating Split Bars

Realised Floating Split Bars is an indicator for MetaTrader 4. It draws buy and sell arrows on the chart. It has 3 settings, such as Max days back, Include swap commission and Total marker arrow code. MQL source code included.

Files in the download: RealisedFloatingSplitBars.mq4, RealisedFloatingSplitBars.txt.

Settings

SettingDefaultWhat it does
Max days back90How many past daily bars get their realised total (re)computed
Include swap commissiontrueFold swap + commission into the realised/floating totals
Total marker arrow code159Wingdings code for the "total incl. floating" marker (159 = filled diamond)

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Buy/Sell Arrows · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria