Touchstone
- Experts
-
Gayathiri Gopalakrishnan
I am an independent MQL5 developer focused on creating practical trading tools for MetaTrader 5.
My work includes Expert Advisors, trading indicators, analytical tools and trading utilities designed to help traders analyze the market, manage trades and automate specific trading tasks. - Versione: 1.0
- Attivazioni: 5
Touchstone Gold is an automated Expert Advisor for MetaTrader 5 that trades gold (XAUUSD) and Bitcoin (BTCUSD). It runs on the M5, M15, M30 and H1 charts. It acts on clean price action from closed candles and trades only while the market is trending. It checks the next higher timeframe before every entry and sends every order with a stop loss.
It was built for traders who want a calm, rule-based system that explains itself. Every decision is written in the journal, and a dashboard on the chart shows why a setup was taken or skipped. A start-up check confirms that each function is working on your account before the first trade.
How a trade is chosen
Each new candle is checked only after it has closed. The entry engine reads the structure of price on the chart you trade and decides whether the closed candle forms a setup. Because nothing is decided on an open candle, a signal does not change or disappear once it has been shown.
A setup then goes through a direction engine. It weighs many independent readings of the market, led by support and resistance and by order flow. It then decides whether the trade should be a buy or a sell. Every decision and the readings behind it can be written to the journal, so you can see why each side was chosen.
The trend filter comes next. It measures whether the market is trending or moving sideways, using several independent trend readings on the timeframe you trade. Sideways markets are skipped, because they produce many false moves. In a trend, only setups that agree with the trend are traded, and a decision against the trend is turned into the trend.
Before the order goes out, the timeframe one step higher is read as well. When its last closed candle has moved firmly against the planned trade, the trade follows that larger move instead, with the same stop distance. This can also be set to skip such trades, or switched off.
Finally, trading costs and your account rules are checked. These are the spread, the price movement since the signal, the open trades, the risk limits and the margin. Only then is the order sent, together with its stop loss.
Markets and timeframes
Touchstone Gold trades gold (XAUUSD) and Bitcoin (BTCUSD). It can run on the M1, M5, M15, M30 and H1 charts. Each one reads the next higher timeframe: M1 reads M5, M5 reads M15, M15 reads H1, M30 reads H2 and H1 reads H4.
Lower timeframes give more setups with smaller stops, so the spread takes a larger share of each trade. The spread filter therefore skips more setups on M1 than on H1. Higher timeframes give fewer trades with wider stops. Bitcoin usually has a wider spread than gold, so more of its setups are skipped. The H1 chart is the natural place to start with it.
From one chart the Expert Advisor can also trade other symbols and timeframes. Type them into "More symbols to trade from this chart" and "More timeframes to trade from this chart". For example, enter BTCUSD in the first and M15,H1 in the second. Each market is handled on its own, with its own stop, its own trend reading and its own limits. Symbol names with a prefix or suffix from your broker are recognised.
Stop loss and exits
Every trade is sent with a stop loss, and the stop is checked again after the order is filled. If a broker ever drops it, it is put back.
The default exit is the step trail. The stop stays exactly where it was placed until price has moved one engine step in the trade's favour. An engine step is the unit of price movement the engine works with on that chart, and it adapts to the market. At that point the stop moves to lock 25 percent of a step. It then follows the highest price reached, or the lowest for a sell, three quarters of a step behind. It only ever moves forward. A trade that turns before reaching one step ends at its first stop. An optional take profit can be added to the step trail as a multiple of the stop distance.
Two other exits can be chosen in "Stop loss". Fixed keeps the stop where it is and closes winning trades at a take profit, twice the stop distance by default. Moving uses break-even and a trailing stop, set in its own group. Its recommended style moves the stop to break-even, with costs covered, once the trade has moved one stop distance. It locks half a stop distance at one and a half, and trails one stop distance behind from two. Other styles follow fixed distances in pips, adapt the distances to each symbol, or protect profit step by step from each trade's own stop.
A hard loss cap per trade in your account currency can close a trade before its stop is reached. Open trades can also be closed before the weekend at a set hour on Friday.
Spread and slippage protection
The spread and slippage filter is on by default and is checked before anything is sent or closed. A trade is skipped when the spread is more than 25 percent of its stop distance, because it would start too far behind. It is also skipped when the spread is three times its usual size or more. The usual size is the middle value of the spread over the last two hours. This catches news, the daily rollover and thin markets.
A trade is also skipped when price has already run 20 percent of the stop distance since the signal candle closed. This happens after a gap or a delay. When the order is sent, it may be filled at most that same distance from the price asked. The limit is never less than twice the spread, so normal movement does not refuse it. A requote beyond that limit is not chased.
Many brokers fill gold and Bitcoin at the market and ignore the allowed deviation. That is why the fill itself is checked too. A trade filled half a stop distance or more worse than asked is closed at once. Each of these limits can be changed or set to 0 to switch it off.
"Max spread (points)" adds a fixed spread limit of your own. The cost check adds a limit on the spread and the commission together, as a share of the stop. Commission is read from your own deals. If your broker charges one and nothing has been traded yet, enter it in "Commission per lot, round turn".
Risk management and lot size
There is no martingale and no doubling: the lot size never grows after a loss. After a number of losses in a row, three by default, the lot size is reduced until the losing run ends.
By default the lot is 0.01 for every 250 US dollars of balance. It grows and shrinks with your account, in any account currency. Set the balance step to 0 for a fixed lot. "Risk Percentage per trade" sizes each trade from its own stop distance instead. An automatic lot per symbol and a per-symbol lot table are also available.
Several limits work together. "Max Risk per trade" caps the risk of a single trade at 5 percent of equity by default. "Max risk of all open trades together" caps them all, with a fixed ceiling of 50 percent. The account guard, when switched on, skips a trade if even the smallest lot would risk more than your cap. "Max margin per trade" reduces the volume to fit your free margin.
You can also limit the number of open trades on the whole terminal and for each market and side. Other limits cover the trades per day, the candles between trades and the positions leaning one currency. "Blocked hours" takes server hours such as 4,16,18 or a range such as 0-3, and no new trade opens in them.
News filter
The news filter reads the economic calendar built into MetaTrader 5. It can pause new trades, pause them and move open trades to break-even, or pause them and close open trades before the news. You choose high impact only, or high and medium impact, and how many minutes before and after an event to stay out. The biggest events, such as payrolls, rate decisions and inflation data, have a longer window of their own. United States dollar news can pause every symbol. The Strategy Tester has no economic calendar, so the news filter acts only on live and demo charts.
Prop firm challenges and funded accounts
For proprietary trading firm (prop firm) challenges and funded accounts, switch on "Enable Prop Firm limits". It also switches on by itself on known prop firm servers. Enter the daily loss limit and the total loss limit. Then choose how your firm measures the total: fixed below the starting balance, trailing the highest balance, or trailing the highest equity. Set when your firm's day starts, at midnight in Prague, at 17:00 in New York, at midnight UTC or at a server hour.
A challenge profit target closes all trades and stops trading once it is reached, and a daily profit target can stop the day. The number of order requests per day can be capped. A news rule keeps orders from being opened, changed or closed for a set number of minutes around high-impact news. A minimum trade time keeps the Expert Advisor from trailing or closing a trade before your firm allows it. Keep the daily loss setting a little below your firm's own figure, so a fast market cannot cross it.
Account types and brokers
The Expert Advisor works on hedging and netting accounts, and on accounts that must close trades in first-in, first-out order. On hedging accounts every signal opens a trade of its own on either side. On netting and first-in, first-out accounts, an opposite signal first closes the open side, oldest first, and then opens the new one. On a netting account it never adds to an open position, so an existing stop is never merged or moved. A position opened by hand or by another Expert Advisor is never touched.
Any number of digits, any account currency and symbol names with a prefix or suffix are handled. Before each order the minimum stop distance, the freeze distance, the allowed order types and the volume steps of your broker are respected. When the market is closed, a setup is held and checked again when trading opens.
Direction engine and order flow
By default the direction engine decides every trade with a vote of its techniques. Support and resistance and order flow lead that vote. Other choices let a learning engine take over once it has proven itself on the chart's own history. A chart can also stay on paper until then. The history it measures, up to 20,000 candles, can be set. An optional edge check sends real orders only on charts whose unseen past setups ended positive after costs.
Order flow is measured on every setup and used as one of the main readings. It can also be set to confirm trades and skip a trade the order flow is against. A strict choice trades only when the order flow agrees. Where your broker offers market depth, it is used. The engine can also read public order books from exchanges over the internet. If the journal asks you to allow an address, add it under Tools, Options, Expert Advisors, "Allow WebRequest for listed URL". Without it the Expert Advisor still trades. The Strategy Tester does not use the internet.
Engines and charts
The precision engine reads the chart you trade and is the default. The adaptive engine needs no chart view and suits extra markets and virtual servers. If the precision engine has not started within five minutes, the chart switches to the adaptive engine instead of waiting. With the precision engine, each chart running Touchstone Gold comes to the front for a moment at start and from time to time. This happens one chart at a time, and the screen then returns to the chart you were on. Choose the Background mode if you prefer that this never happens.
Dashboard, journal and start-up check
At start the Expert Advisor checks its settings, your account and your broker's trading conditions. The Experts tab of the journal then lists every function as LIVE, PENDING, INACTIVE or OFF. INACTIVE means a function is switched on but cannot work on this account, and the line says why. A compatibility report shows the symbol's digits, volume steps, stop and freeze distances and the account's margin mode.
The dashboard on the chart shows the open trades, their stop stage and the last signal. When a setup is not sent, the dashboard says why in a few words. On live and demo charts the journal also prints a short report every ten minutes. It counts the setups found, the trades placed and the reasons setups were skipped, and names the setting behind the main reason. Every trade is written to a journal file in the Files folder of your terminal. It holds the entry, the stop and the result for your own review. Entries can be marked with arrows, and a screenshot can be saved on each trade.
Installation and first run
Copy nothing by hand: install the Expert Advisor from the Market inside MetaTrader 5. Open an XAUUSD chart on the timeframe you want, drag Touchstone Gold onto it and tick "Allow Algo Trading". Make sure the Algo Trading button in the toolbar is on. The default settings are the recommended start.
Read the start-up check in the Experts tab. Every important function should show LIVE. If anything shows INACTIVE, the same line names the reason and the fix. Watch the dashboard for the first setups. If no trade comes for a while, read the report in the journal. A sideways market, a wide spread or one of your limits will be named there.
For BTCUSD, attach it to a BTCUSD chart, or add BTCUSD to "More symbols to trade from this chart". A broker with a low Bitcoin spread matters most. A virtual private server keeps the Expert Advisor running when your computer is off.
Testing in the Strategy Tester
Test on your own broker's symbol, because spreads, digits and trading hours differ between brokers. Choose "Every tick based on real ticks" so the real spread and real price movement are used. Test more than one year, so trending and quiet periods are both included, and test each timeframe you plan to use. Then run it on a demo account before trading live. The news filter, the internet order books and the precision engine's chart view are not available in the tester. Live results can therefore differ from tests.
Settings, group by group
Markets. "More symbols to trade from this chart" and "More timeframes to trade from this chart" add markets, separated by commas. "Max open trades on this terminal" is 10 by default and counts every chart and market. "Max risk of all open trades together" can be set up to 50 percent of equity. The netting setting that closes the open side on an opposite signal is on by default.
Signal. "Signal strength" is 1 for the standard setup. A higher number asks for a stronger setup and gives fewer trades. "Write signal journal (CSV)" keeps the trade file, and "Extra journal detail" adds more lines for checking.
Engine. "Engine" selects the precision engine or the adaptive engine. "Precision engine mode" is Standard by default, the most precise. Mixed uses the chart view whenever it can, and Background needs no chart view at all. The switch to the adaptive engine waits five minutes, and each chart is refreshed every 30 minutes, the charts taking turns. "Auto-optimize parameters per symbol" adapts the allowed slippage and other figures to each symbol.
Stop loss and take profit. "Stop loss" chooses Step trail, Fixed or Moving. For the step trail, the start is 1 engine step and the lock is 25 percent of a step. Its take profit is off. For the fixed stop, the take profit is twice the stop distance.
Moving stop. These settings act only with the stop loss set to Moving. They hold the trailing style, the break-even point, the profit lock, the trailing start and distance, and the structure trail. The fixed and adaptive styles use distances in pips, with separate values in dollars of price for BTCUSD.
Direction engine. "Every setup is traded: the direction engine decides BUY or SELL" is on. "Direction: BUY or SELL for real orders comes from" is the vote by default. The history it measures, the decision log, the liquidity heat map and the edge check are set here too.
Trend filter. "Trend filter" skips sideways markets and keeps trades with the trend by default. "Strength a trend needs" is 50 out of 100. A higher number means only clear trends and fewer trades. "Trade only setups whose candle runs with the trend" is on. The higher timeframe's trend can also skip trades, which is off by default.
Pullback on the next timeframe up. Reverse is the default, and Skip and Off are the other choices. The move that counts is a quarter of that timeframe's average range.
Entry filters. "Pullback entry" sends a limit order part of the way back toward the stop instead of a market order. It waits for 50 percent of the stop distance by default and is removed if it is not filled within three candles. It is off by default and works on hedging accounts.
Trade pacing. Here you find "Blocked hours", "Hard loss cap per trade", "Minimum bars between trades" (1) and "Maximum trades per day" (0 means no limit).
Trading. This group holds "Lot size" and "Lot grows with balance", and "Max open trades per market, each side" (10). It also holds "Close opposite on new signal" (off) and "Stop buffer (points)", which moves every stop a few points further away (0). The spread limit, the cost check, the commission and the maximum deviation follow. The magic number base, the currency limit and "Cut size after N losses in a row" (3) complete it.
Spread and slippage filter. It is on by default, with the 25 percent, 3 times, 20 percent and 50 percent limits described above.
Visual. Arrows mark the entries, and the dashboard can be shown or hidden. Its light can be Off, Still or Live, and a screenshot can be saved on each trade.
Risk manager (prop firm). This group holds the prop firm switch and limits described above. It also holds "Risk Percentage per trade", the automatic lot, the per-symbol lot table, the margin cap and "Max Risk per trade" (5 percent). The account guard, the initial balance of a challenge (0 reads the first deposit) and the Friday close are here too.
News filter. This group sets the mode, the impact and the minutes before and after. It also sets the longer window for the biggest events and the window for medium news. Finally, it decides whether United States dollar news pauses every symbol.
Footprint confirmation. This group sets how order flow is used: measure only by default, confirm or strict. It also sets how the setup candle's order flow is read and how strongly it must agree. Other settings choose whether outside markets and exchange order books are read, and whether each verdict is written to the journal.
Lot size examples
With the default settings, a 250 dollar account trades 0.01 lot, a 1,000 dollar account 0.04 lot and a 5,000 dollar account 0.20 lot. On gold, 0.01 lot usually moves about 1 US dollar for each dollar of price. A stop 2 dollars away therefore risks about 2 US dollars at 0.01 lot. On Bitcoin, 0.01 lot usually moves about 1 US dollar for each 100 dollars of price, depending on your broker's contract size. Check the risk of one trade against your balance before you start.
Questions and answers
Why are there no trades yet? The market may be moving sideways, the spread may be too wide for the stop, or one of your limits may have been reached. The dashboard and the journal report say which one.
Can it run on several charts at once? Yes. "Max open trades on this terminal" counts the trades of every chart together. Do not run two copies on the same symbol and timeframe.
Which timeframe should I use? All of M1, M5, M15, M30 and H1 are supported. Lower timeframes trade more often and depend more on a low spread. Test the ones you want on your broker's data first.
Does it work with prop firms? Yes. Switch on the prop firm limits and enter your firm's rules. Many firms are recognised by their server name.
Does it use martingale or averaging? No. Every trade has its own stop loss, and the lot size never grows after a loss.
Does it work with other symbols? It is built for gold and Bitcoin. Other symbols can be added, but test each one first, because a wide spread weighs on every trade.
Does it need the internet? Only for the optional order book data. Trading itself works with the normal connection to your broker.
What deposit do I need? The default lot is 0.01 for every 250 US dollars of balance, so 250 US dollars per 0.01 lot is the starting point. With less, even the smallest lot risks a larger share of the account.
Requirements
You need MetaTrader 5 on a hedging, netting or first-in, first-out account, with Algo Trading allowed. A broker with a low spread on the symbols you trade matters most. A virtual private server is recommended for continuous running. Allowing web addresses is optional.
