Indicator Auto Trader MT4
- Experts
-
Muhammad Muqeem Korejo
Hi, I'm Muhammad Muqeem Korejo, an MQL4/MQL5 developer from Pakistan with 1.5 years of trading experience.
I build and fix trading tools for MetaTrader 4 and MetaTrader 5:
• Expert Advisors (EAs) built from your strategy rules
• Custom indicators, alerts and on-chart panels - Versione: 1.0
- Attivazioni: 5
Indicator Auto Trader MT4 turns an indicator into an Expert Advisor: it reads the buy and sell signals of any indicator you already use (arrow indicators, crossing lines, colour or value buffers, levels, arrows drawn as chart objects) and opens the trades for you. You choose how the signal is read, how big the lot is, where the stop loss and the take profit go, and when the EA must stop. Whatever you type is what the EA uses.
The EA trades what the indicator shows. It does not judge the indicator and does not hold a signal back because the indicator repaints. If an arrow is there on the bar you chose, the EA acts. (See "Please read before you buy".)
Try it first
The Market demo runs in the Strategy Tester. Put your indicator in MQL4\Indicators, type its name, set your lot, stop loss and take profit, and look at the trades the EA opens. Or set the mode to Signal Lab: no trade is opened, the EA replays the signals on past bars and reports win rate, profit factor and drawdown in R. No profit is promised.
How the signal is read
- Two arrow buffers: one for buy, one for sell.
- Two lines: buy when line A crosses above line B, sell the other way.
- One buffer with values: buy and sell when it equals the values you type (for example colour 0 and 1, or +1 and -1).
- One buffer with a level: buy above a level, sell below a level.
- Arrows drawn as chart objects: found by a part of the name, by the arrow code or by the colour.
- The signal bar: the last closed bar (the EA acts when a new bar opens), or the forming bar (the EA acts the moment the signal shows).
- Reverse the signals, trade buys only or sells only.
- The inputs of the indicator are typed as a list of numbers (up to 8; true / false are 1 / 0), or in 6 slots that the Strategy Tester can optimise.
- Confirming indicators: up to 3 more indicators must agree with the signal (each one read as arrows, two lines, a value or a level). Its latest signal must be within the number of bars you type.
- To try the EA without an indicator, choose the built-in demo (a cross of two moving averages).
Lot, stop loss and take profit - you decide
- Lot: a fixed lot (any value, rounded to the lot step of the broker), a percent of the balance or of the equity, a money amount, or a lot that grows with the balance. Maximum lot and the minimum-lot rule are inputs.
- Stop loss: none, points, ATR multiple, the low / high of the signal bar, the lowest low / highest high of the last N bars, or a price that your indicator draws in a buffer.
- Take profit: none, points, a reward / risk ratio of your stop loss, an ATR multiple, or a price that your indicator draws in a buffer.
- Up to 3 partial take profits (profit in points, percent of the lot to close), and the stop moves to break-even after the first one.
- Break-even, trailing stop (points or ATR, start, step) and "close after N bars".
- Entry: market order, a stop order beyond the signal bar, or a limit order for a pullback, with an expiry in bars.
- If the stop is closer than the broker allows, you choose: use the broker minimum or skip the trade. The journal says what happened.
Protection for your account (0 = off)
- Daily loss, daily profit target and maximum drawdown from the peak equity.
- Maximum trades per day, and stop for the day after N losing trades in a row.
- Spread filter, trading hours, weekdays, trend filter (EMA and a higher timeframe EMA), ADX minimum.
- Flat-market filter and too-wild filter: the ATR of the last bar (in points) must be inside the limits you type.
- Trade only in a session of a real city (London, New York, Frankfurt, Sydney, Tokyo or UTC) in its local time; summer time is handled.
- Basket: close all trades when the total profit or the total loss reaches a money amount or a percent of the balance.
- Close everything on Friday at a time you choose.
- A broker-side stop loss on every trade you ask for. Planned stops are stored and set again if the broker refuses them in the order. An order whose answer is unclear is never sent twice.
- No martingale, no grid, no averaging.
Signal Lab - look at the indicator before you trade it
Set the mode to Signal Lab (on a chart, or in the Strategy Tester) and the EA opens no trade. It replays the signals of the indicator on past bars with YOUR stop loss and take profit and writes in the journal: number of signals, trades, win rate, profit factor, average result in R, the longest run of losses and the deepest drawdown in R. It also tests other stop loss and take profit sizes and lists the 8 sizes with the highest average result (at least 30 trades). On a chart the report is shown on the panel. A size that looks good on past data is not a promise.
Panel and alerts
- Status, last signal, the reason why the last signal was skipped, open trades, trades today.
- Result of this EA: profit today, yesterday, this week and this month; this month: trades, win rate, profit factor and the deepest drawdown.
- Marks on the chart: every signal gets a small text, green "opened" or orange "skipped: reason". Hover to read it.
- Buttons: BUY and SELL (a manual trade with your lot, stop loss and take profit), Close BUY, Close SELL, Pause / Resume, Close all, Reset stop.
- Alerts and push notifications for signals and trades.
- The journal explains every entry and every skipped signal. A report shows when an arrow of a past signal has changed or gone (information only).
How it was tested
Strategy Tester runs on XAUUSD M5 (open prices only model, fixed spread), each run compared trade by trade with an independent model written in Python: every signal, entry time, side, lot, stop loss, take profit and exit price (about 310,000 checks in 39 runs, 0 differences in the final runs). Also tested with forced broker answers: a requote on the first try (every order retried once), invalid stops (opened without stops, stops set right after), and a lost answer for an order that was executed (the EA found its order and sent nothing twice). Tested: all signal modes, indicator inputs passed to the indicator, all lot modes, all stop loss and take profit modes (points, ATR, signal bar, swing, ratio, indicator buffer), partial take profits with break-even, break-even, points and ATR trailing, close after bars, stop and limit orders, spread / hours / weekday / EMA / ATR filters, sessions in London and New York time through the summer time changes, confirming indicators, maximum trades, losses in a row, daily loss and profit limits, maximum drawdown stop, basket close, reverse and sell-only, hedging with 3 trades, Signal Lab (same numbers as the independent replay), the statistics on the panel, the manual BUY / SELL buttons and the chart marks.
Please read before you buy
- The EA trades whatever the indicator shows. A repainting indicator can show an arrow and remove it later; the EA has already traded it, and it never closes a trade because an arrow disappeared. If you do not want this, use the last closed bar and check your indicator first.
- The EA is as good as the indicator you give it. It does not make a bad indicator good. No profit is promised.
- Signals are read from indicator buffers or from arrows drawn as chart objects. Indicators that draw arrows in another way cannot be read.
- The indicator inputs are passed as numbers (up to 8). Text inputs of an indicator cannot be passed.
- Your indicator must be in the MQL4\Indicators folder of your terminal. In the Strategy Tester the EA can use an indicator only if the file is on your computer.
- This version has no news filter (MetaTrader 4 has no economic calendar), no Auto Buffer Finder and cannot read an indicator that is already on the chart by itself: type the indicator name.
- Signal Lab replays the history as the indicator shows it today. A repainting indicator looks better in Signal Lab than it will trade.
- The tests were run on one symbol (gold) and one timeframe (M5). Test on a demo account first.
Setup in two minutes
1. Put your indicator in MQL4\Indicators. Set Signal source to "Indicator buffers" and type its name (the path inside MQL4\Indicators, without .ex4). 2. Look in the Data Window (Ctrl+D) or let Signal Lab show the result, and set the signal mode and the buffer numbers. 3. Type your lot, stop loss and take profit. Attach the EA to a chart and allow automated trading.
Questions
- Does it work on a FIFO account? With the opposite-signal setting "close" or "ignore" the EA never keeps a buy and a sell open together. FIFO accounts were not part of the tests (the tests ran on a hedging-capable demo account).
- Can it use several indicators? Yes, as confirmation: one main indicator gives the signal and up to 3 more must agree. To trade two different indicators separately, use another chart with another magic number.
- Can I optimise it? Yes: the indicator inputs can be set in 6 slots that the Strategy Tester can run through.
- Why did it not trade? The panel and the journal show the reason of the last skipped signal.
