🌐 English
AT_SYSTEM
EA Manual

Parameters & Features

For versions released in 2026 and later

EA Manual (MQL5 Market Edition)

Common usage and parameter guide for AT_SYSTEM EAs

Contents

Introduction

This manual explains the usage, parameters, and other features common to the EAs I provide.

Descriptions and screenshots are from MT5. MT4 versions are the same unless noted otherwise.
Features and parameters may be present or named differently depending on the EA and version. Please skip any item that your EA does not have.

Setting Up the EA

Currency pair and timeframe set automatically
Currency pair and timeframe set automatically

You can also confirm that the EA was set up from the log in the “Experts” tab of the Toolbox.

Experts tab in the Toolbox
Experts tab in the Toolbox

A brief specification is shown in the “Common” tab when you attach the EA (the “About” tab in MT4). Set the number of bars loaded on the chart to at least the number stated there.

Brief specification (MT4: “About” tab)
Brief specification (MT4: “About” tab)

Parameters and Chart Comment

Example 1: General
Example 1: General
Example 2: Multi-strategy type
Example 2: Multi-strategy type

Each block is explained below.
Items in [ ] are shown in the chart comment.

1. Basic Settings and Compounding Settings

ParameterDescription
Magic Number
[magic]
The EA's identification number. Use a different value for each EA. If it duplicates another EA's number, the EAs will malfunction.
Fixed Lot
[lots]
The lot size for fixed-lot trading. It is also used when compounding is selected but there is no SL.
Lot Calculation Mode
[met]
Compounding setting. 0 = Fixed, 1 = Compounding (Balance), 2 = Compounding (Free Margin)
Risk Percent
[risk]
Risk setting for compounding. The maximum SL loss as a percentage of the selected basis (balance or free margin).
Initial BalanceThe balance at which compounding starts, in your account currency. It is not shown in the chart comment.
Lot Growth Rate
[ver]
Sets how much changes in funds are reflected in the lot size, from 0 to 100. It softens sudden lot changes caused by sharp changes in funds.

Differences between compounding modes

Initial Balance is referenced no matter how many years after you start. Even if the EA stops (for example, after a terminal restart), the lot size can be recalculated under the same conditions.

In backtests, compounding is calculated assuming 1 USD = 150 JPY. Lot sizes may therefore differ from live trading.

If the lot stays at the Fixed Lot value even though compounding is selected, check the Experts tab and add the currency pairs needed for the calculation to Market Watch. The calculation may then work.

Example: When trading AUDCAD on an account in Japanese yen, compounding cannot be calculated unless USDCAD is shown in Market Watch, and the lot stays at the Fixed Lot value.

Compounding formula

Compounded lot = Risk amount ÷ SL loss per 1 lot

Risk amount = Base balance × Risk rate (Risk Percent)

Base balance = Initial balance (Initial Balance) + (Current funds − Initial balance) × Lot growth rate (Lot Growth Rate)

Current funds = Current balance + credit, or current free margin

Example: USDJPY, Lot Calculation Mode = Free Margin, Risk Percent 5%, Initial Balance ¥700,000, current funds ¥1,000,000, Lot Growth Rate 30%, SL 210 pips

{¥700,000 + (¥1,000,000 − ¥700,000) × 30%} × 5% ÷ ¥210,000 ≈ 0.188 → 0.18 lots (rounded down to the lot step)

If the calculated lot is below the broker's minimum lot, the minimum lot is used. In that case, the risk becomes larger than set.

2. Filters and Trade Controls

ParameterDescription
Allowed Max Spread
[max]
The upper limit of the spread (pips) at which trading is allowed. In the figure, this is the 8 at the upper left inside the frame.
Allowed range from average spread
[adj]
The pips added to the average spread measured internally (shown as [avg] in the chart comment). If the spread exceeds “average + this value,” the EA skips trading. As the average moves up and down, the allowed spread also moves gradually. Allowed Max Spread sets its upper limit.
Buy / Sell TP and SL
[Buy TP,SL / Sell TP,SL]
On EAs where TP and SL can be changed, they appear in the parameters list. The unit is pips in principle (1 pip = 10 points).
Stop new entries after loss
Loss that triggers entry stop
[cooldown h,pips]
Only on EAs that include it. When a single close results in a loss of Loss that triggers entry stop (pips) or more, new entries are prohibited for Stop new entries after loss (hours). Setting the hours to 0 disables it. See Built-in Support Features, item 5 for details.
Operation ModeSwitch between buy only, sell only, both, or both stopped in the parameters. This works the same way in MT5. For a side that is not active, the TP and SL are dimmed.
Allow hedging
[2way]
true: hedging allowed; false: hedging not allowed. Default values differ by EA. As a rule, this switch is provided as standard so you can change it when a broker prohibits hedging.
Weekend carry-over
[weekend]
true: positions are carried over the weekend; false: they are not. Default values differ by EA. If false, any open position is closed at 23:00 on Friday.
Triple swap stop control
[3xSwapTrade]
Only on EAs that include it. The EA automatically detects the day with triple swap and skips entries from shortly before that day rolls over. The timing of the skip differs by EA.
Summertime
[DST]
Only on EAs affected by daylight saving time. The EA detects it automatically and an item is added to the chart comment.
none: none | American: US style | European: European/UK style

3. Utilities

ParameterDescription
Export trade info to CSV
[csv]
Writes the following to a CSV file for each entry, exit, TP/SL, and order failure: spread, gap, slippage, latency, floating profit/loss, swap, and more. Details are given later.
Show P/L pips on chart
[pips]
Using the trade history in the terminal, shows lines from entry to exit and the pips gained on the chart.
Order Comment
[cmt]
The text you enter is shown in the comment field of orders. Text over 31 characters is automatically cut from the end. Even if the comment is lost, the internal default comment is shown.

4. Parameters for Each Buy/Sell Strategy

ParameterDescription
Enable Strategy1~Active: true / Inactive: false
TP [pips]You can change the maximum TP. On some EAs, the value varies depending on conditions.
SL [pips]The maximum SL. On some EAs, the value varies depending on conditions. It is used for the compounding calculation. If a strategy has several SLs, the calculation uses the maximum among the active strategies. The maximum is shown in the Experts tab at initialization, right after the EA is attached.

Built-in Support Features

To prevent unnecessary losses from human error, the EA includes various support features that make operating mistakes less likely. For verification support, it also keeps the functions I used during development, such as detailed trade output and trade history display on the chart.

1. Auto Chart Setup

When you drag and drop the EA onto an FX chart, the chart automatically switches to the correct currency pair and timeframe, and the parameter settings appear on the right. The colors of the bars and other elements also change.

For non-FX symbols (crypto, indices, etc.), the characters after the symbol name differ by broker. Therefore, open the chart with the correct symbol and timeframe yourself before attaching the EA.

2. Chart Comment

Brief information such as the parameters is laid out on the right side of the chart for easy reading. The “magic number” and “lot size,” which can cause accidents if wrong, are shown larger and in a different color.

The comment is compact so that it stays visible even when you shrink the chart and place several side by side, with high-priority items at the top. When the order comment is long, the font becomes smaller. The font is the default one to avoid garbled characters.

Example of several charts side by side
Example of several charts side by side

3. Chart Changes on Errors and Other States

When the EA cannot operate, the chart display changes according to the situation so you can tell at a glance. If the EA becomes inactive, for example because of a lost connection, everything except the magic number and lot size is dimmed.

Normal operation
Normal operation
Inactive (caused by settings or connection)
Inactive (caused by settings or connection)

If the EA is removed, for example by a terminal update, the comment may remain with the EA name at the upper right blank. Because nothing is dimmed, it is easy to mistake for normal operation, so please be careful.

4. Low Funds Check

A check for insufficient margin has long been built in as standard. However, the EA could still enter with funds that could not withstand even a small floating loss, despite plenty of room before the SL.

So if the funds cannot withstand a single SL, the EA skips new entries and shows a warning. When this warning appears, check your funds and lot size.

Low funds warning
Warning at the bottom of the comment (no new entries are made)
Low funds warning (enlarged)
Same, enlarged

5. Cooldown

This feature is available only on EAs that include it. After a large loss on the previous close, it stops new entries for a set time. It is used to prevent consecutive entries (overtrading) when the market moves suddenly.

During a cooldown, the remaining time (hours:minutes) is shown in orange at the bottom of the chart comment.

Chart during a cooldown
Display during a cooldown (remaining time)
Display during a cooldown (enlarged)
Same, enlarged

The time is counted from the close time of the losing position. Only the most recent close for the same currency pair and magic number is evaluated. New entries for both buy and sell are stopped. Closing of positions continues as usual.

6. Duplicate Magic Number Alert

If a magic number seems to be duplicated within the same MT4/MT5, an alert window is shown.

Alert window in MT5
Alert window in MT5

If you shut down the PC without closing the MT4/MT5 terminal, the shutdown processing is not performed, and the alert may appear even when there is no duplicate. It may also appear unexpectedly in other cases. If there is no duplicate, you can ignore it and continue with the setup.

7. Warning for GMT0 Brokers

For a few brokers defined internally among the GMT0 brokers, a warning alert is shown. Other GMT0 brokers are not checked. Please judge for yourself.

For supported GMT, see GMT under “Other Notes.”

8. Automatic Daylight Saving Time Control

For EAs that need a daylight saving time setting, it is detected automatically for each broker. When the EA is attached, one of the following is shown in the Experts tab.

It is also shown at the bottom of the chart comment. The detection is based on the brokers I know of. Other brokers may be detected differently. If the display differs from your broker's, please let me know.

In the Experts tab
In the Experts tab
Bottom of the chart comment
Bottom of the chart comment

9. Automatic Spread Measurement

The EA calculates the average spread automatically and sets that average plus a few pips internally as the spread filter value. You no longer need to measure and check the spread every time you attach the EA.

10. Trade History Lines and Pips Display

Shows the trade history visually on the chart. It is displayed even if you change the timeframe. When not needed, switch it ON/OFF in the parameters. It shows the line from entry to exit and the pips gained.

MT4 can also display it in backtests. In MT5, it works in backtests only in visual mode.

Chart after an MT4 backtest
Chart after an MT4 backtest

11. Tester Display

During backtests, the annualized recovery factor (YRF) is displayed. It is one of the metrics I refer to in development.

YRF = Profit ÷ Drawdown ÷ Years

MT4: “Journal” tab after a backtest
MT4: “Journal” tab after a backtest
MT4: OnTester result column during optimization
MT4: OnTester result column during optimization
MT5: “Journal” tab at the end of a backtest (YRF)
MT5: “Journal” tab at the end of a backtest (YRF)
MT5: Result column after optimization (maximum DD)
MT5: Result column after optimization (maximum DD)

12. Trade Information Log (CSV Output)

Information about each trade can be recorded in a CSV file. Switch it on in the parameters. Output makes processing somewhat heavier.

TicketOrder TimeHourMinuteDay of WeekOrder TypeOrder PriceFill PriceAllowed Spread(pips)Average Spread(pips)Fill Spread(pips)Gap(pips)Slippage(pips)Latency(ms)Runtime(ms)Order RetriesProfit/Loss(pips)Max Floating Profit(pips)Max Floating Loss(pips)CommissionSwapGross P/LNet P/LHold TimeLot SizeSymbolTimeframeEA NameVersionMagic Number
22021.01.06 02:00:0020WedBuy139.933139.9333.80.80.60.60.0001------------------------0.1GBPJPY-M5Murasame6.4852431095
32021.01.06 06:25:00625WedSell139.926139.9263.90.90.70.00.0001------------------------0.1GBPJPY-M5Murasame6.4852431095
32021.01.06 11:00:00110WedClose140.1140.13.90.90.7-0.70.0001-17.48.5-45.20.00.0-16.92-16.924:35:000.1GBPJPY-M5Murasame6.4852431095
22021.01.08 09:04:5894FriTP141.099141.0993.90.90.90.00.0001116.6116.7-16.20.02.69112.19114.8855:04:580.1GBPJPY-M5Murasame6.4852431095
62021.01.19 01:00:0010TueBuy140.835140.8353.90.92.82.80.0001------------------------0.1GBPJPY-M5Murasame6.4852431095
62021.01.20 10:34:591034WedTP141.884141.8843.90.90.70.00.0001104.9106.3-5.40.00.67101.06101.7333:34:590.1GBPJPY-M5Murasame6.4852431095
82021.01.21 01:10:00110ThuSell141.456141.4563.90.92.1-0.10.0001------------------------0.1GBPJPY-M5Murasame6.4852431095
82021.01.21 06:20:00620ThuClose141.561141.5613.90.91.1-1.10.0001-10.50.4-26.70.00.0-10.15-10.155:10:000.1GBPJPY-M5Murasame6.4852431095
CSV output example (MT5). You can scroll sideways.
LocationLive/demo trading: the Files folder inside the MQL4 or MQL5 folder
Backtest (MT4): tester\files inside the MT4 data folder
Backtest (MT5): MQL5\Files inside the tester's own folder (example: MetaQuotes\Tester\(ID)\Agent-127.0.0.1-(port number)\MQL5\Files)
File nameEA name_account number_TradeLog.csv (common to MT4/MT5; a separate file for each EA)
DelimiterTab-delimited
ColumnsTicket / Order Time / Hour / Minute / Day of Week / Order Type / Order Price / Fill Price / Allowed Spread(pips) / Average Spread(pips) / Fill Spread(pips) / Gap(pips) / Slippage(pips) / Latency(ms) / Runtime(ms) / Order Retries / Profit/Loss(pips) / Max Floating Profit(pips) / Max Floating Loss(pips) / Commission / Swap / Gross P/L / Net P/L / Hold Time / Lot Size / Symbol / Timeframe / EA Name / Version / Magic Number

Built-in Logic and Techniques

NameDescription
No new entries during the 0:00 hour of server timeNew entries are, in principle, not made during the 0:00 hour, when spreads tend to widen. Depending on the logic, some strategies close positions during this hour and others do not.
Exit spread filterA spread filter is also applied to exits, so that positions are less likely to be closed when the spread is wide in the early morning. However, it cannot control SL hits and does not apply to them. Some EAs do not have it because of the nature of their logic.
Gap filterNo entry when the difference between the previous bar's close and the current price is above a set value. The value is set for each EA. Many strategies judge by the previous bar's close, so an execution price far from it is a disadvantage; this filter is meant to limit that. It also helps prevent trouble where the price jumps and the order fills at a gapped price. It does not apply to exits. You can check the gap at each trade in the CSV output.
Prevention of jump-price fillsIn the past, there were cases where the price jumped right after entry and hit the SL. This seems to have happened while the price was showing an abnormal value. A spread filter could not prevent it, and neither could the timing of placing the SL or the slippage setting. A method that may prevent it is built into every EA that can include it.
Year-end and New Year controlFrom around December 20 (it varies by EA) until January 3 of the next year, no new entries are made and only exits are performed. If you want to close positions earlier during this period, do it manually.
Margin and trading-permission checkPrevents sending orders with a lot size that exceeds your margin, or while trading is not permitted in MT4/MT5. This avoids continually sending useless communication to the server because of order errors.
AMPAC
(Anti Miss Positioning Auto Control)
A technology I developed to improve order execution. In MT4/MT5, orders can be skipped because quotes arrive late due to communication delays, or because EA processing is congested. My own repeat-order logic and lightweight processing compensate for this and improve execution.
Magnet codingA coding technique I developed for MT4 to make the EA work correctly in live trading. MT4 sometimes does not behave as coded, and a filter that works in backtests may not work in live trading. This is one way to avoid that. It is not perfect and some differences may remain, but the gap between backtests and live trading over the same period tends to be smaller than in EAs made before 2024.

Other Notes

GMT

My EAs rely heavily on daily bars, so they only work with brokers on GMT+2 in winter / GMT+3 in summer that have five daily bars a week. With any other GMT, there are six daily bars, the calculations between the daily and 4-hour bars change, and the logic does not hold.

Number of bars displayed on the chart

Most EAs need 1,000 bars or more. The required number of bars is written in the brief specification shown in the “Common” tab (MT4: “About” tab) when the EA is attached. Set it to at least that number.

Attaching on weekends

On weekends the chart is not moving, so the chart comment may not appear in MT5 after attaching the EA. In that case, press “OK” on the parameters screen again, and it may appear.

Notes and Disclaimer