Market Mirror EA - User Guide

Market Mirror EA - User Guide

15 October 2026, 15:54
Tuomas Tirroniemi
0
21

Market Mirror EA
Let your balance reflect the market.

An Expert Advisor designed to follow the long-term direction of the chart symbol, aiming to make its balance curve reflect the underlying market's price development.

Introduction

Market Mirror EA is a MetaTrader Expert Advisor built around a simple concept: follow the long-term direction of a market rather than attempting to predict every short-term price movement.

The EA opens positions according to a daily schedule and manages them according to the selected trading direction, risk settings, and holding rules. By maintaining exposure to a market over time, the strategy aims to reflect the market's broader price development in the account balance.

The idea is particularly relevant to markets that have historically demonstrated a positive long-term price trend, such as certain equity indices. Precious metals and other instruments can also be considered, although their long-term behavior may differ considerably.

Market Mirror is designed primarily for a long-term investment-style approach rather than frequent short-term speculation. Its objective is to participate in the underlying market's development over time, accepting that temporary drawdowns and extended periods of adverse price movement are part of the process.

The EA also includes manual controls that let you extend the holding period, enable or disable new entries during an extended hold, pause automatic entries, and manage existing positions directly from the chart.


1. The Market Mirror Concept

Let the Market Determine the Direction

Traditional trading strategies often attempt to identify precise entry and exit points using indicators, patterns, or short-term market signals.

Market Mirror takes a different approach. It follows a scheduled trading process, opening positions in a selected direction and closing them according to its daily schedule unless the holding period has been extended.

The EA does not attempt to identify every market top or bottom. Instead, it is designed to maintain exposure to the selected market's directional movement.

For a market with a positive long-term trend, a long-oriented approach may benefit from sustained price appreciation. However, no market rises continuously, and historical growth does not guarantee future performance.

How the Daily Trading Cycle Works

The EA follows a daily schedule with an opening time and a closing time.

  1. At the configured opening time, the EA attempts to open a position in the selected direction.

  2. The position remains open during the scheduled trading period.

  3. At the configured closing time, the EA closes applicable positions unless an active holding extension requires them to remain open.

  4. On subsequent trading days, the daily process continues according to the configured schedule and holding state.

The default settings are:

  • Opening time: 01:15

  • Closing time: 23:30

These times use the broker's server time, not necessarily your computer's local time.

If the EA misses its scheduled opening time, it does not automatically make up the missed entry later that day. You can use the START NOW button when you want to request an immediate entry instead.

The EA's daily cycle is designed to provide a repeatable process rather than require constant manual intervention.

Why Can This Approach Work?

Some markets, particularly broad equity indices, have historically benefited from economic growth, corporate earnings growth, reinvestment, and rising nominal valuations over long periods.

A strategy that maintains market exposure may participate in that appreciation without needing to predict each short-term fluctuation.

There are important qualifications:

  • Markets can decline for extended periods.

  • Some indices have experienced very long recovery periods after major drawdowns.

  • Metals and other markets do not necessarily share the same long-term upward tendency as equity indices.

  • Leverage, trading costs, position sizing, and execution can materially affect results.

  • A strategy that performs well during one historical period may perform poorly during another.

Market Mirror does not create the market's underlying return. Its performance depends on the instrument selected, the sequence of trades, the position sizes, and the costs of maintaining exposure.



2. Minimum Deposit and Recommended Capital


How Much Capital Is Required?

The required account size depends on the instrument, the broker's contract specifications, the minimum tradable volume, the permitted volume increments, leverage, margin requirements, and the EA's risk settings.

The minimum lot size alone does not establish the minimum deposit.

For example, suppose a broker offers:

  • Minimum volume: 0.01 lots

  • Volume step: 0.01 lots

In this case, 0.01 lots is the smallest permitted trade volume. However, the amount of capital required to trade that volume depends on the selected symbol and broker.

An index CFD with one contract specification can require a very different amount of margin from another index CFD, even when both support 0.01 lots.

Suggested Capital Approach

For the intended long-term investment-style use of Market Mirror, a larger capital base can provide more room to manage exposure and adverse market conditions.

A $10,000 account can be used as an illustrative starting point for evaluating the strategy, while $100,000 or more is the suggested capital level for the more conservative, long-term approach described here.

These figures are capital recommendations, not verified minimums or guarantees of safety. A $100,000 account can still experience substantial losses, and some instruments may require considerably more or less capital.

Before trading, check the broker's contract specifications, minimum volume, volume step, margin requirements, and the EA's calculated position size.

The Minimum Volume and Volume Step Settings

Market Mirror includes two settings that help define its effective trading-volume limits.

Setting Default Purpose
MinimumVolumeInput 0.01 Minimum volume the EA will accept for its calculations, subject to broker rules.
VolumeStepInput 0.01 Configured volume increment used when calculating trade size.

The EA also checks the broker's actual minimum volume, maximum volume, and volume step.

The effective minimum cannot be lower than the broker's minimum. The configured volume step must be compatible with the broker's permitted increment.

If the risk calculation produces a volume below the effective minimum, the EA skips the trade rather than automatically increasing the volume and exceeding the calculated risk budget.

This behavior is important because forcing a minimum lot size could create more exposure than the selected risk calculation allows.



3. Risk Management and Trading Without a Stop Loss


The Default No-Stop-Loss Configuration

Market Mirror supports trading with or without a percentage-based Stop Loss and Take Profit.

Both are disabled by default:

  • StopLossPercent = 0.00

  • TakeProfitPercent = 0.00

When these values are zero, the EA submits positions without a broker-side Stop Loss or Take Profit.

The strategy can therefore retain market exposure without automatically exiting because a price-based Stop Loss has been reached.

This can be useful for a strategy that aims to participate in longer-term market movements. However, trading without a Stop Loss does not mean that the position has zero risk.

A position can continue losing value as the market moves against it. If the account uses leverage, a sufficiently adverse move can cause a margin call or forced liquidation by the broker.

How Does the EA Calculate Risk Without a Stop Loss?

The supplied source code uses a hypothetical adverse price level for position sizing when Stop Loss is disabled.

For a Buy position, the risk calculation uses a hypothetical price of zero. For a Sell position, it uses a hypothetical price twice the entry price.

These are calculation reference points, not actual Stop Loss orders.

The EA uses the resulting estimated loss per lot to determine the volume permitted by the configured risk budget.

For example, the calculation attempts to estimate the loss associated with a long position falling from its entry price to zero. For a short position, it estimates the loss associated with the price rising by an amount equal to the entry price.

This is a position-sizing method, not a guarantee that losses cannot exceed the estimate. Real-world losses may be affected by contract specifications, execution, gaps, costs, and broker liquidation rules.

Important: The Default Risk Budget Is 100%

The supplied EA has the following defaults:

Setting Default
RiskMode RISK_PERCENT
RiskPercent 100.00
RiskMoney 100.00

In percentage mode, the EA calculates the risk budget from account equity.

With RiskPercent = 100.00, the risk budget is 100% of current equity before any additional risk adjustment.

This does not mean that the account is protected from losing 100%, nor does it mean that the risk is zero. It means that the position-sizing calculation uses a budget equal to the selected percentage of equity.

A hypothetical price level used for position sizing cannot replace an actual protective order.

If capital preservation is a priority, carefully evaluate the risk percentage and whether a broker-side Stop Loss is appropriate for your strategy.

Fixed-Money and Percentage Risk Modes

Market Mirror supports two risk modes.

Percentage Risk

Set:

RiskMode = RISK_PERCENT

The EA calculates the risk budget as a percentage of account equity.

For example, a 10% setting on an account with $100,000 in equity produces a nominal risk budget of $10,000 before any additional risk adjustment.

The actual position size depends on the estimated loss per lot and the permitted trading volume.

Fixed-Money Risk

Set:

RiskMode = RISK_FIXED_MONEY

The EA uses RiskMoney as the starting monetary risk budget.

For example, if RiskMoney = 1,000, the initial risk budget is $1,000 in an account denominated in USD, before any additional risk adjustment.

Fixed-money mode does not automatically make the strategy safer. The relationship between the risk budget, account equity, and instrument exposure must still be considered.



4. Optional Stop Loss and Take Profit


Although Market Mirror is designed to support a no-Stop-Loss configuration, percentage-based protective levels are available.

Setting Default Purpose
StopLossPercent 0.00 Stop Loss distance as a percentage of entry price. Zero disables the Stop Loss.
TakeProfitPercent 0.00 Take Profit distance as a percentage of entry price. Zero disables the Take Profit.

For a Buy position, the Stop Loss is calculated below the entry price and the Take Profit above it.

For a Sell position, the Stop Loss is calculated above the entry price and the Take Profit below it.

Example

If a Buy position is opened at 100:

  • A 5% Stop Loss corresponds to 95.

  • A 10% Take Profit corresponds to 110.

These are illustrative price levels. Actual prices are normalized to the instrument's tick size, and the broker must accept the resulting orders.

The EA does not include a separate ATR-based Stop Loss model or a configurable collection of alternative Stop Loss strategies in the supplied source. Its current protective-level inputs are percentage-based.

When a Stop Loss is enabled, the position-sizing calculation also uses the Stop Loss price as its reference for estimated risk.



5. Trading Direction


Market Mirror can be configured to trade long or short.

Setting Default Purpose
OnlyLong True Enables long-only trading.
OnlyShort False Enables short-only trading.

Exactly one of these settings must be enabled for trading to proceed.

OnlyLong = True

The EA opens Buy positions according to its daily schedule.

This configuration is intended for users who want to follow the potential long-term appreciation of a selected instrument.

OnlyShort = True

The EA opens Sell positions according to its daily schedule.

This configuration follows downward price movements rather than upward ones. It has a different risk profile and should not be assumed to benefit from the same long-term market tendencies as a long-oriented equity-index strategy.

If both settings are enabled, or both are disabled, the EA does not open new positions.



6. Daily Schedule Settings


The daily schedule determines when the EA attempts to enter the market and when it normally closes its positions.

Setting Default Purpose
OpenTime 01:15 Scheduled daily entry time.
CloseTime 23:30 Scheduled closing time.

The times must use the HH:MM format, and the closing time must be later than the opening time on the same day.

The EA uses broker server time. If your broker changes its server time due to daylight saving time, the relationship between server time and your local time can change.

Missed Entries

The EA does not automatically open a missed scheduled position later in the day.

If the opening time has already passed, the automatic entry attempt for that day is marked as processed.

The START NOW button provides a manual alternative when you want the EA to attempt to open a position immediately.



7. The HOLD Feature – Extend the Holding Period


One of Market Mirror's central management features is its built-in HOLD function.

The feature allows you to extend the time that positions remain open beyond the normal daily closing schedule.

This is particularly relevant when the market is experiencing a temporary decline and you prefer to maintain exposure rather than close positions at the usual daily closing time.

HOLD +1

The HOLD +1 button extends the holding deadline by one calendar day.

Each click adds another day to the existing deadline. If a holding extension is already active, the new day is added to the later of the current date or the existing hold deadline.

For example:

  • First click: extend the hold by one day.

  • Second click: extend it by another day.

  • Third click: extend it by another day.

The panel displays the current hold deadline and updates the button label to show the total remaining extension, such as HOLD +1, HOLD +2, or HOLD +3.

The hold deadline uses the broker's server calendar date.

What Happens During a Hold?

When an active hold prevents normal closing, the EA keeps its applicable positions open until the configured closing time on the hold deadline.

The intention is to allow more time for the market to recover or continue its longer-term movement.

However, an extension does not guarantee recovery. It can also increase exposure to further adverse price movement.

The HOLD feature changes the EA's scheduled closing behavior; it does not guarantee that positions remain open under every circumstance. Broker margin liquidation, Stop Loss execution, trading restrictions, or manual intervention can still close a position.

RESET

The RESET button clears the holding extension.

After the hold is reset, the normal scheduled closing logic is restored.

Use RESET when you no longer want an extended holding period to override the normal daily closing schedule.

Before resetting, check the current positions and the time remaining until the scheduled close.



8. RE-ENTRY – Allow New Positions During a Hold


Market Mirror separates the decision to hold existing positions from the decision to open additional positions.

The RE-ENTRY button controls whether the EA may open new positions at the normal daily entry time while a hold is active.

RE-ENTRY OFF

When RE-ENTRY is disabled, the EA keeps applicable existing positions open during the hold but skips automatic new daily entries covered by that hold.

This configuration is useful when you want to extend the holding period of existing positions without increasing the number of positions through additional scheduled entries.

RE-ENTRY ON

When RE-ENTRY is enabled, the EA can open a new position at the scheduled daily entry time while the hold is active.

For example, suppose you have extended the hold for three days and RE-ENTRY is enabled.

The EA can maintain the existing positions and open additional positions at the scheduled entry time on eligible days.

This means the strategy continues adding market exposure according to its daily entry schedule instead of merely holding the original position.

Additional positions increase total exposure and can increase both potential gains and potential losses.

The actual number of positions depends on successful entries, the schedule, the hold deadline, and the account's ability to support the resulting exposure.

HOLD and RE-ENTRY Together

HOLD RE-ENTRY Behavior
Inactive OFF Normal scheduled entry and closing behavior.
Active OFF Existing applicable positions are held; automatic new entries during the hold are skipped.
Active ON Existing applicable positions are held, and eligible new daily entries can be opened.

HOLD and RE-ENTRY are independent controls. HOLD changes the closing schedule, while RE-ENTRY controls whether new automatic entries can occur during that extension.



9. Persistent Settings and Restart Recovery


Market Mirror stores its HOLD deadline and RE-ENTRY state using MetaTrader's terminal Global Variables.

This allows those settings to be restored when the EA is initialized again.

For example, if you extend the holding period and restart MetaTrader or reattach the EA, the stored hold deadline can be loaded again. The RE-ENTRY setting is also restored.

This is useful if you do not want a terminal restart to erase your chosen holding behavior.

The stored state is associated with the EA's Magic Number and chart symbol. Changing those identifiers can cause the EA to use a different set of stored state variables.

The EA also stores its daily entry-processing state and consecutive-loss count.

Important: Persistent settings do not mean that the EA can operate without MetaTrader running or without a working connection. The EA must be running to process its schedule and manage positions. Broker-side Stop Loss and Take Profit orders, if used, are separate from the EA's local scheduled logic.



10. The Market Mirror Control Panel


The EA includes a compact chart panel for monitoring the current state and controlling the trading process.

The panel displays:

  • EA status.

  • Selected symbol.

  • Trading direction.

  • Scheduled opening and closing times.

  • Number of applicable open positions.

  • Floating profit or loss.

  • Risk budget.

  • Current hold deadline.

The panel also provides the main control buttons.

PAUSE / RESUME

The PAUSE button disables automatic daily entries.

While paused, the EA's scheduled closing logic continues to run. PAUSE should therefore not be interpreted as a command to freeze every aspect of position management.

Press RESUME to allow automatic entries again.

If the scheduled entry time passes while the EA is paused, that day's automatic entry is skipped rather than automatically made up later.

CLOSE ALL

The CLOSE ALL button attempts to close all positions matching the EA's current chart symbol and Magic Number.

It does not mean that every position in the entire trading account will be closed.

After using the button, verify the result in the MT5 Trade tab. A rejected or unsuccessful close request may leave a position open.

HOLD +1

Adds one calendar day to the current holding deadline.

RESET

Removes the hold extension and restores the normal scheduled closing behavior.

RE-ENTRY: ON / OFF

Toggles automatic new entries during an active holding extension.

START NOW

Requests an immediate entry using the EA's normal direction, position-sizing, and Stop Loss/Take Profit logic.

START NOW can be used even if the scheduled entry attempt for the current day has already been processed. It is not an override for every restriction: trading must not be paused, the direction settings must be valid, the risk calculation must permit a volume, and the broker must accept the order.

The button requests a new position; it does not guarantee that the order will be accepted.



11. Risk Adjustment After Losing Positions


Market Mirror includes an optional mechanism that increases its risk budget after losing positions.

This is controlled by the following settings:

Setting Default Purpose
AddRiskAfterLoss True Enables risk-budget adjustments based on consecutive losing positions.
AddRiskPercentageAfterLoss 10.00 Additional percentage points per consecutive loss in percentage mode.
AllowRiskAbove100Percent True Allows the percentage risk budget to exceed 100% of equity.

How It Works

When enabled, the EA tracks closed position results.

A losing position increases the consecutive-loss count. A profitable position resets that count. A break-even position leaves the existing count unchanged.

In percentage mode, the effective risk percentage is calculated as:

RiskPercent + consecutive losses × AddRiskPercentageAfterLoss

With the default values, the nominal percentage sequence is:

  • Initial setting: 100%

  • After one consecutive loss: 110%

  • After two consecutive losses: 120%

  • After three consecutive losses: 130%

These percentages determine the risk budget used by the position-sizing calculation. They do not guarantee a particular realized loss or recovery.

In fixed-money mode, the starting monetary risk budget is adjusted proportionally using the consecutive-loss count and the configured increment.

Important Risk Warning

Increasing risk after losses can accelerate account drawdown and increase the chance of severe losses.

Allowing the risk budget to exceed 100% of equity does not create additional capital. It simply permits the EA's nominal risk budget to exceed current equity.

For a conservative long-term strategy, review these settings carefully. Consider whether increasing exposure after losses is consistent with your investment objectives and ability to withstand drawdowns.

If AddRiskAfterLoss is disabled, the EA does not apply this loss-based risk adjustment.



12. General Execution Settings


The EA includes two general execution settings.

Setting Default Purpose
MagicNumber 261013 Identifies the EA's applicable positions and stored state.
DeviationPoints 20 Configures the permitted execution deviation in platform points where supported.

MagicNumber

The Magic Number identifies positions managed by this EA instance for the current symbol.

When running multiple EAs, use distinct Magic Numbers where appropriate to help separate their positions and management rules.

Changing the Magic Number while positions remain open can prevent the EA from recognizing positions opened under the previous identifier.

DeviationPoints

This setting specifies the permitted execution deviation in points for trade operations where supported by the broker and execution method.

It does not guarantee a specific fill price. Execution conditions, liquidity, market gaps, and broker rules can affect the final result.


13. Understanding the EA's Position Sizing

Position sizing is central to Market Mirror because the EA uses the configured risk budget to determine the permitted trading volume.

The process is broadly as follows:

  1. Determine the entry price and trade direction.

  2. Calculate the risk reference price, using the configured Stop Loss when enabled or the hypothetical adverse price level when it is disabled.

  3. Estimate the potential loss per lot using the instrument's trading calculations.

  4. Calculate a volume from the risk budget and estimated loss per lot.

  5. Normalize the volume to the permitted volume increments.

  6. Skip the trade if the calculated volume falls below the effective minimum or fails the risk and broker-volume checks.

This process helps avoid automatically forcing a larger position than the calculated risk budget allows.

It does not remove the risks associated with trading without a Stop Loss, and it cannot guarantee that the final trading result will remain within the calculated budget.

If a trade is skipped because the minimum volume would exceed the calculated budget, review the account equity, risk settings, contract specifications, and minimum tradable volume rather than assuming that a larger position is safe.



14. Recommended Setup for Long-Term Use


The following checklist can help you prepare the EA before using it on a live account.

Step 1: Select the Instrument

Attach Market Mirror to the symbol you want to follow.

The EA trades the symbol of the chart to which it is attached. Its performance will therefore depend on that instrument's price behavior and contract specifications.

Step 2: Choose the Direction

For a long-oriented market strategy:

  • OnlyLong = true

  • OnlyShort = false

For a short-oriented strategy, reverse these settings.

Only one direction should be enabled.

Step 3: Set the Daily Schedule

Choose an opening and closing time based on broker server time and the instrument's trading hours.

Verify that the market is available at the selected times and that the closing time is later than the opening time on the same day.

Step 4: Check the Volume Limits

Confirm the broker's minimum lot, maximum lot, volume step, and margin requirements.

Set MinimumVolumeInput and VolumeStepInput to compatible values.

Step 5: Review Risk Settings

Choose between percentage-based and fixed-money risk.

Review RiskPercent, RiskMoney, AddRiskAfterLoss, and AllowRiskAbove100Percent.

Do not assume that disabling the Stop Loss makes the strategy risk-free. Test the position-sizing behavior and understand the consequences of an adverse market movement.

Step 6: Decide Whether to Use a Stop Loss or Take Profit

The default configuration disables both.

If you want percentage-based protective levels, set StopLossPercent and/or TakeProfitPercent to positive values.

Confirm that the resulting levels are accepted by the broker.

Step 7: Understand HOLD and RE-ENTRY

Before extending the holding period, decide whether you want to:

  • Keep only the existing positions open by leaving RE-ENTRY disabled; or

  • Allow additional scheduled entries by enabling RE-ENTRY.

Monitor the total number of open positions and the combined account exposure.

Step 8: Test Before Live Trading

Use the MT5 Strategy Tester and a demo account to understand the EA's behavior during:

  • Sustained upward markets.

  • Sustained downward markets.

  • Sideways markets.

  • High-volatility periods.

  • Market gaps and trading interruptions.

  • Extended holding periods.

  • Consecutive losing positions.

Backtesting and demo trading cannot guarantee future performance, but they can reveal how the settings interact with the selected instrument.



15. Frequently Asked Questions


Does Market Mirror guarantee that my balance will follow the chart?

No. The strategy aims to reflect the market's price development, but actual results depend on trade timing, position sizing, costs, execution, and the market's future direction. The balance curve will not necessarily reproduce the instrument's price chart exactly.

Why would I use an index with a long-term upward tendency?

Some equity indices have historically appreciated over long periods. A long-oriented strategy may participate in that growth without attempting to time every short-term movement. However, long periods of declining prices and substantial drawdowns remain possible.

Can I run Market Mirror without a Stop Loss?

Yes. Both Stop Loss and Take Profit are disabled by default. However, a position without a Stop Loss can experience substantial losses, and the EA's hypothetical risk reference is not a protective order.

What happens when I press HOLD +1?

The EA extends the holding deadline by one calendar day. Each additional click adds another day to the current deadline.

Does HOLD automatically open more positions?

Not by itself. RE-ENTRY controls whether new scheduled positions can be opened during the hold. With RE-ENTRY disabled, the EA holds existing positions without opening new automatic daily entries covered by the hold.

Will HOLD and RE-ENTRY settings survive a restart?

The EA stores both settings in MetaTrader Global Variables and restores them during initialization, provided the corresponding stored state remains available.

What does PAUSE do?

PAUSE disables automatic new entries. The EA's scheduled closing logic continues to operate, so PAUSE does not freeze position management.

What happens if the EA misses the scheduled entry time?

The missed automatic entry is not made up later that day. You can use START NOW to request an immediate entry if the EA is not paused and the trade passes the normal checks.

What happens if the calculated lot size is too small?

If the permitted volume would exceed the calculated risk budget, the EA skips the trade instead of automatically increasing the volume to the broker's minimum.

Can I use Market Mirror on metals?

The EA can be attached to a metal symbol supported by the broker, provided the trading conditions and contract specifications are compatible. However, the strategy's long-term assumptions should be evaluated separately for each instrument.


Conclusion

Market Mirror EA is designed for traders who want a systematic way to follow the longer-term direction of a selected market.

Its daily entry and closing schedule provides a consistent operating framework. The HOLD feature allows users to extend the holding period, while RE-ENTRY determines whether the EA can add new positions during that extension. Persistent settings help preserve these choices across restarts.

Risk settings, volume limits, optional percentage-based Stop Loss and Take Profit, and chart-based controls provide ways to configure and supervise the strategy.

The central principle is straightforward: participate in the market's development over time rather than relying exclusively on short-term trading opportunities.

Market Mirror is intended to support a long-term investment-style approach, not promise quick profits or guaranteed returns. Its success depends on the selected market, the account's capital and risk settings, and how the future market performs.

Market Mirror EA — Let your balance reflect the market.


Remember to download set Files.zip.


Files:
Set_Files.zip  2 kb