Loading…

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

SettingDefaultWhat it does
Current phasePHASE_ONESet by hand once your firm confirms the phase - see header note
Initial balance10000.0Balance the challenge started at, used only for the on-screen suggestion
Phase1 target percent8.0Phase 1 profit target, percent of InpInitialBalance (0 = no suggestion)
Phase2 target percent5.0Phase 2 profit target, percent of balance at the start of phase 2 (0 = no suggestion)
Phase1 risk percent1.0Recommended risk per trade while in phase 1, percent of balance
Phase2 risk percent0.5Recommended risk per trade while in phase 2
Funded risk percent0.25Recommended risk per trade once funded
Phase1 max lots0.0Aggregate lot cap to publish for phase 1 (0 = publish no cap, i.e. unlimited)
Phase2 max lots0.0Aggregate lot cap to publish for phase 2
Funded max lots0.0Aggregate lot cap to publish once funded
Publish global variablestruePublish the active phase and its profile via terminal global variables
Timer interval sec15

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 → Scripts.
  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 script onto a chart to run it once.

Download the PDF guide

Tags: Dashboards & Scanners · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria