Loading…

Risk Budget Dial Panel

A day-risk percent typed separately into every guard EA's own inputs means changing your mind mid-session requires editing several panels one at a time, and they silently drift out of sync with each other. This panel makes the day's risk appetite one deliberate decision: pick a preset or type a custom percent, press Apply, and every other tool that reads the shared GlobalVariable "RiskBudgetDial_Percent" sees the same figure immediately. Alongside the percent, the panel publishes the wall-clock time it was set and the account equity at that moment, so a reading guard can compute a money risk budget against the equity the trader actually saw when making the decision rather than equity that has since drifted from further trading. The panel's own display shows how many hours old the current setting is and flags it in red once it passes InpStaleAfterHours, since a risk dial left over from yesterday is a real hazard, not a formality. This panel never touches an order itself - it is a publisher, and every other EA that wants to respect the dial must read the GlobalVariable and act on it independently. See NOTES for the exact GlobalVariable names. Notes and limitations - This panel never opens, closes or modifies a trade; it only publishes GlobalVariable values other programs can choose to read. - Published GlobalVariables: "RiskBudgetDial_Percent" (double, the chosen percent), "RiskBudgetDial_SetTime" (double, TimeCurrent() at the moment it was set), "RiskBudgetDial_StartEquity" (double, account equity at that moment). - GlobalVariables are terminal-wide, not per-chart or per-EA, so running two copies of this panel on different charts simply overwrites the same shared value with whichever was clicked last. - MT4 clears GlobalVariables after roughly four weeks of terminal inactivity (a platform-level expiry, not something this panel controls) - a reading guard should treat a missing GlobalVariable as "no dial set" rather than assuming zero risk. - Nothing enforces that another EA actually reads or respects this value; the discipline lives in the reading EA, not this publisher.

Expert advisor · MT5 · v1.0 · Free

About Risk Budget Dial Panel

Risk Budget Dial Panel is a script for MetaTrader 5. It has 4 settings, such as Stale after hours, Corner and X offset. MQL source code included.

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

Settings

SettingDefaultWhat it does
Stale after hours18.0Hours after which the published dial is flagged stale on the panel
Corner1Panel corner: 0=top-left 1=top-right 2=bottom-left 3=bottom-right
X offset12Panel offset from the chosen corner, X pixels
Y offset18Panel offset from the chosen corner, Y pixels

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: Trading Sessions · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria