Loading…

Account Currency Risk Normaliser

Nearly every free position-sizing snippet on the internet hardcodes the relationship between pips and money: one pip equals ten dollars per standard lot. That is true for EURUSD. It is not true for USDJPY, it is wildly wrong for XAUUSD, and it is a different number again for every index CFD a broker lists. An EA carrying that assumption sizes silently wrong the moment it is dropped onto anything other than the pair it was tested on, and the trader usually never finds out until a stop-out is much larger than intended. The correct fix reads MODE_TICKVALUE and MODE_TICKSIZE from the broker for the actual symbol and derives money-per-point from those, scaled to the requested lot size. This tool computes that correct figure and, next to it, the naive fixed-multiplier figure the buggy version would have used, then shows what the naive lot size would really have risked in account currency if it had been sent. On a standard EURUSD chart the two numbers usually match closely. On gold, JPY pairs or an index the gap is immediate and often dramatic - that gap is the bug made visible. A demo entry button is included so the correct sizing can be proven with a real ticket, not just a printed number. It is disabled by default and only ever uses the correct lot size - the naive figure is calculated for comparison only and is never passed to OrderSend. Notes and limitations - This is a sizing calculator and a demonstration, not a trading strategy. It opens at most one order, only on request, only with the correct size. - The naive figure exists purely to make the bug visible on screen. It is never used to size anything that gets sent to the broker. - If tick value or tick size cannot be read for the symbol (rare, usually a feed issue), the correct side of the panel reports "n/a" rather than showing a guessed number. - Recomputes every tick; the arithmetic involved is a handful of symbol-info calls, not an indicator recalculation, so this is cheap even on a fast market. - On the MQL5 build, the demo entry button refuses on a netting account if the chart symbol already carries a position under a different magic number - see MQL4 VERSUS MQL5 DIFFERENCES above.

Expert advisor · MT5 · v1.0 · Free

About Account Currency Risk Normaliser

Account Currency Risk Normaliser is an expert advisor (trading robot) for MetaTrader 5. It can size trades from your balance and risk percent. It has 11 settings, such as Risk mode, Target risk money and Target risk percent. MQL source code included.

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

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Risk modeRISK_PERCENT_EQUITYHow the target risk is expressed
Target risk money50.0Target risk, account currency (RISK_MONEY)
Target risk percent1.0Target risk, percent of equity (RISK_PERCENT_EQUITY)
Stop loss pips30Stop loss distance used for the comparison, in pips
Naive dollar per pip per lot10.0The naive assumption a buggy EA hardcodes - WRONG on most symbols
Enable demo entryfalseAllow the on-chart button to send a real demo order
Demo take profit pips0Take profit for the demo entry, pips (0 = none)
Magic number20260901Magic number for the demo entry this tool can place
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per demo entry before giving up
Retry wait ms500Pause between attempts, milliseconds

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 → Experts.
  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 expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Gold (XAUUSD) · Risk & Lot Size · EURUSD · USDJPY · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria