Phase Aware Risk Switcher
MQL4 has no function that can ask a broker or prop firm what phase a challenge account is currently in - that information exists only on the firm's own dashboard, and this EA does not pretend otherwise. What it automates is the other half of the problem: once you tell it, by setting InpCurrentPhase, which phase you are actually in, it immediately publishes that phase's configured risk percent and lot cap through terminal global variables that any other EA on the account can read, so a phase change means updating one input in one place rather than hunting down every strategy's own risk setting. It also watches equity growth against a configurable profit target for the currently selected phase and shows a plain suggestion once that target looks reached - phrased explicitly as something to go verify on your firm's dashboard, never as an automatic phase change, because this program genuinely cannot know whether the firm has moved the account yet. Phase 2's target is measured from the equity recorded the first time InpCurrentPhase is set to Phase 2, not from the original challenge balance, so a partial phase-1 profit already banked is not counted twice against the phase-2 target. Notes and limitations - This program cannot detect, confirm or change your actual challenge phase with any broker or prop firm - InpCurrentPhase is the single source of truth and it is entirely manual. - The on-screen target suggestion is based on account equity growth against a target you configured, not the firm's own progress tracking, and may not match a firm's own calculation exactly (some measure profit against balance, or exclude open floating profit, differently). - Terminal global variables are shared by name across every EA on the terminal; if another program already uses the same names (PARS_ActivePhase, PARS_RiskPercent, PARS_MaxLots) there will be a collision. Rename them in the source if that applies to you. - It never sends, closes or modifies an order itself - it only publishes a recommendation for other programs to use.
Expert advisor · MT4 · v1.0 · Free
About Phase Aware Risk Switcher
Phase Aware Risk Switcher is a script for MetaTrader 4. It has 12 settings, such as Current phase, Initial balance and Phase1 target percent. MQL source code included.
Files in the download: PhaseAwareRiskSwitcher.ex4, PhaseAwareRiskSwitcher.mq4, PhaseAwareRiskSwitcher.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Current phase | PHASE_ONE | Set by hand once your firm confirms the phase - see header note |
| Initial balance | 10000.0 | Balance the challenge started at, used only for the on-screen suggestion |
| Phase1 target percent | 8.0 | Phase 1 profit target, percent of InpInitialBalance (0 = no suggestion) |
| Phase2 target percent | 5.0 | Phase 2 profit target, percent of balance at the start of phase 2 (0 = no suggestion) |
| Phase1 risk percent | 1.0 | Recommended risk per trade while in phase 1, percent of balance |
| Phase2 risk percent | 0.5 | Recommended risk per trade while in phase 2 |
| Funded risk percent | 0.25 | Recommended risk per trade once funded |
| Phase1 max lots | 0.0 | Aggregate lot cap to publish for phase 1 (0 = publish no cap, i.e. unlimited) |
| Phase2 max lots | 0.0 | Aggregate lot cap to publish for phase 2 |
| Funded max lots | 0.0 | Aggregate lot cap to publish once funded |
| Publish global variables | true | Publish the active phase and its profile via terminal global variables |
| Timer interval sec | 15 |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Dashboards & Scanners · MT4 Expert Advisor · MQL4 Source Code