Loading…

Account Model Cost Comparator

A terminal is connected to exactly one account. Nothing in MQL4 or MQL5 can send the same trades through a raw-spread account and a standard account simultaneously to compare the real result - any tool claiming to do that is either exaggerating or not doing what it says. This tool is honest about that limit: it is a calculator over two cost structures the user provides (spread in pips and commission per lot for each model), projected across a shared assumed trade size and monthly trade count, so the difference is computed from real formulas rather than implied by literally running both. Model A optionally reads its spread LIVE from the account this terminal is actually connected to (a real, current number), with a manual commission input alongside it, since neither MQL4 nor MQL5 has an API to read an account's commission schedule. Model B is always a manual cost structure, typed in from the broker's published fee schedule, since no second account is actually connected. Both models' spread cost is computed from tick value and tick size, not a Point-based approximation, so the comparison stays correct on JPY crosses, metals and indices. The result shows a monthly cost figure for each model and which one is cheaper at the assumed trading volume - a real answer to a real question, built from the trader's own inputs rather than from an implied dual-execution test the platform cannot actually run. Notes and limitations This is a cost calculator, not a profitability comparison - it says nothing about which account type would have produced better trading results, only which one is cheaper to trade at the volume assumed. It assumes a constant spread for Model A over the projection period (the live-read figure is a single snapshot, refreshed only as often as InpRecalcSeconds) and a constant spread for Model B (since it is never actually live). Real spreads widen around news and thin liquidity on both account types, which this simple projection does not model. Commission figures must be kept current with the broker's own published schedule; this tool has no way to verify them.

Expert advisor · MT4 · v1.0 · Free

About Account Model Cost Comparator

Account Model Cost Comparator is a script for MetaTrader 4. It has 10 settings, such as Model a live spread, Model a spread pips and Model a commission per lot. MQL source code included.

Files in the download: AccountModelCostComparator.ex4, AccountModelCostComparator.mq4, AccountModelCostComparator.txt.

Settings

SettingDefaultWhat it does
Model a live spreadtrueRead Model A's spread live from this connected account instead of the manual input below
Model a spread pips0.2Model A manual spread (pips) - used only when InpModelALiveSpread is false
Model a commission per lot7.0Model A commission per lot, ROUND TURN, account currency (0 if none)
Model a nameRaw-spread account
Model b spread pips1.6Model B spread (pips) - always manual, this account is not actually connected
Model b commission per lot0.0Model B commission per lot, ROUND TURN, account currency (0 if none)
Model b nameStandard account
Lots per trade0.10Lot size assumed per trade, both models
Trades per month100Trade count assumed per month, both models
Recalc seconds10Minimum seconds between recalculations

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: MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria