Loading…

Fixed Fractional Sizing Demo

Fixed-fractional sizing risks a constant percentage of account equity on every trade rather than a constant lot size or a constant money amount. Because the percentage is applied to equity fresh before each trade, the lot size shrinks automatically after a losing streak and grows after a winning one, which is the opposite of martingale sizing - covered separately in this catalogue - where the lot grows specifically because of losses. Neither approach guarantees an edge; this EA only demonstrates the sizing arithmetic and how it responds to the account's own equity curve. The entry signal is a plain fast/slow EMA crossover, deliberately unremarkable, because the point of this EA is the sizing formula rather than the signal. Lot size is converted from the risk percentage using the symbol's tick value and tick size rather than a hardcoded contract size, so it stays correct on metals, indices and JPY crosses as well as plain forex, and is recomputed from current account equity immediately before every entry rather than cached from a previous trade. Notes and limitations - One position at a time; a new entry only opens once the previous trade under this magic number has closed. - Sizing is based on equity, which includes floating profit and loss from any other open position on the account, not only this EA's own trades - on an account running several EAs, size the risk percentage accordingly. - The entry signal has no claimed edge; it exists only to generate trades for the sizing formula to size. - Requires AutoTrading enabled and trading permitted at the terminal, account and expert level; if trading is disabled the EA logs it and places nothing. - On a netting MQL5 account, a foreign-magic position already open on the chart symbol blocks this EA from entering at all until that position is gone - see the differences section above.

Expert advisor · MT4 · v1.0 · Free

About Fixed Fractional Sizing Demo

Fixed Fractional Sizing Demo is an expert advisor (trading robot) for MetaTrader 4 based on Moving Average. It can size trades from your balance and risk percent. It has 9 settings, such as Risk percent, Fast ma period and Slow ma period. MQL source code included.

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

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

Settings

SettingDefaultWhat it does
Risk percent1.0Risk per trade, % of CURRENT equity, recomputed every trade
Fast ma period10Fast moving average period for the entry signal
Slow ma period30Slow moving average period for the entry signal
Stop loss pips30Stop loss per trade, in pips - also the risk unit the sizing is based on
Take profit pips45Take profit per trade, in pips (0 = none)
Magic number20260825Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action 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 4 open File → Open Data Folder, then go to MQL4 → Experts.
  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 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: Martingale · Risk & Lot Size · Moving Average · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria