Multi Martin
This software component for MetaTrader 5 is built to enhance the capabilities of your trading environment. This Expert Advisor serves as automated trading software. It is utilized to monitor financial markets and execute trades based on predefined algorithmic rules, enabling precise position management without the need for constant manual oversight.
How to Setup and Use Multi Martin
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
Description & Settings
This is a multi-asset expert adviser based on martingale trading strategy. Its original idea is taken from another expert adviser - available for MT4.
Warning. Martingale is easy yet very dangerous strategy. Evaluate your risks carefully.
The strategy is to open reversal trades with increased lots after every loss, until a profitable trade occured or a maximal number of reversals achieved. In both cases next trade will start with initial lot.
In comparison to the original one, this expert adviser demonstrates several points:
adaptation from single-symbol to multi-symbol processing;
source code refactoring for easier reading and support;
Also some bugs were fixed.
The program can still be improved in many aspects, for example, operation by timer, volatility analysis, etc. are left out of consideration.
Input parameters
Specific symbol settings - used for step by step optimization on every work symbol (should be selected as current chart symbol).
UseTime - enable/disable new trades opening according to the range of hours [HourStart..HourEnd];
HourStart - starting hour of the range when new trades are allowed; takes effect if only UseTime is true;
HourEnd - ending hour of the range when new trades are allowed; takes effect if only UseTime is true;
Lots - initial lot size;
Factor - multiplication factor for increased lots;
Limit - maximal number of multiplications, if reached - initial lot is used;
StopLoss - distance to stoploss in points (no automatic pip adjustement);
TakeProfit - distance to takeprofit in points (no automatic pip adjustement);
StartType - trade type for starting order: o - buy, 1 - sell;
Common settings - used for trading.
Magic - expert id;
SkipBadTime - an option to wait predefined period of time after trading errors (such as "not enough money", "lost connection" etc);
WorkSymbols - a string of work symbols and their specific settings, which should be selected after separate optimizations per every symbol; the settings for symbols are separated by semicolon; the format is "name±lots*factor^limit(sl,tp)[start,stop];...", for example "EURUSD+0.01*2.0^7(500,500)[2,22];AUDJPY+0.01*2.0^5(500,500)[1,21]" -- to trade EURUSD and AUDJPY starting with buying (the plus sign) of 0.01 lots, then multiplied by 2 on losses up to 7 or 5 times correspondingly, stoploss and takeprofit are all 500 points, trading window differs by 1 hour;
Trail - a mode how to treat stop orders: none - fixed level stoploss (no trailing), break-even - trail after profit equal to stoploss size in points, straight - trail from very beginning (may end up with a loss up to the stoploss size in points, but not larger than that);
When used with multi-currency settings, it's advisable to place the expert to a chart with most liquid symbol (where ticks arrive most frequently and trading sessions are continuous), for example EURUSD. Alternatively, one can replace OnTick event handler with OnTimer and start a timer in OnInit.
Example reports
MultiMartin trade performance on EURUSD for 3 years 2016-2019
MultiMartin trade performance on EURUSD,AUDJPY,GBPCHF for 2019