Loading…

Open Risk Commentary Writer

A margin level percentage and an equity figure tell you the account is fine right now. Neither tells you, in words, what the book actually looks like: how many positions are open, whether they lean long or short as a group, and - the question a numbers-only panel never quite answers - what happens if every stop loss on the book gets hit at once. This script writes that answer out as a short paragraph, the way a trader would describe their own book out loud at the start of a session. The worst-case figure is deliberately conservative: it assumes every open position's recorded stop loss fires at exactly the stop price with no slippage, using the account's own per-point tick value so the calculation works correctly on JPY crosses, metals and indices without any hardcoded contract size. Positions with no stop loss at all are counted and named in the paragraph but excluded from the total, because their downside is genuinely unbounded and folding an arbitrary number into the total would misrepresent it as measured risk rather than an open question. The paragraph is written to the Experts tab, shown as a chart comment, and - if InpWriteToFile is on - appended to a running text file, so a trader who runs this once per session builds up a plain-language risk journal over time without typing anything by hand. Notes and limitations - The worst-case figure assumes no slippage and exact stop execution. A gap, a fast market or a broker's own stop-hunt behaviour can all produce a worse real-world result than the paragraph states. - Positions with no stop loss, or with a stop but an unreadable symbol specification, are named and counted but left out of the worst-case total - the paragraph says so explicitly rather than pretending the total is complete. - Pending orders are counted but not priced into the worst-case figure, since they carry no risk until triggered. - The tool is read-only. It never modifies an order, a stop or a pending order - safe to run on a live account at any time.

Script · MT5 · v1.0 · Free

About Open Risk Commentary Writer

Open Risk Commentary Writer is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Write to file and File name. MQL source code included.

Files in the download: OpenRiskCommentary.ex5, OpenRiskCommentary.mq5, OpenRiskCommentary.txt.

Settings

SettingDefaultWhat it does
Write to filetrueAlso save the paragraph to a text file
File nameopen_risk_commentary.txtFile written to MQL5\Files when the above is on

How to install

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

Download the PDF guide

Tags: Pending Orders · Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria