[MQL5 Paradise] Nice to meet you, welcome to the world of MQL5!
【MQL5 Paradise Episode 1】Welcome to the Paradise of Automated Trading! Take your first step in MQL5 development
Nice to meet you, and welcome to MQL5 Paradise!
Hello everyone, nice to meet you. I am Pineapple, who has devoted years to programming and charts in the FX world and loves MQL5.
The world of markets is truly deep. Prices go up and down, and sometimes charts show movements beyond imagination. Many people are tirelessly striving to ride those waves.
Starting today, using GogoJungle's Investment Navigator+,“MQL5 Paradise”a new series will begin. In this series, using the programming language MQL5, I aim to share everything you need to build your own indicators and automated trading systems (EAs) without holding back.
Some of you might think, “Programming sounds difficult…” or “I’m not suited because I’m from a humanities background!” But please rest assured. I have spent many years dealing with markets and programs, and honestly, it isn’t that complicated. Rather,“avoiding over-optimization (curve fitting) and emphasizing simple, robust trading”is my creed.
Complex logic often fits past markets perfectly but fails entirely in future markets. Truly strong systems tend to operate under surprisingly simple rules. In this series, I’d like to learn together with you, including such practical “ways of thinking.”
Please read while relaxed, perhaps with a cup of coffee.
Why choose MT5 and MQL5 now?
So, which platform do you usually trade on? Likely many are still using “MetaTrader 4 (MT4).” MT4 is an excellent tool and loved worldwide.
However, times are gradually and surely shifting toward“MetaTrader 5 (MT5)”as a standard. Even GogoJungle has been discussing things like the “MQL5 Converter” to migrate MT4 tools to MT5. That shows the wave toward MT5 is here.
So why should we learn the new language MQL5? I believe there are several clear reasons.
- Overwhelming backtesting speedThe biggest attraction of MT5 is its speed and performance, including multi-currency testing that MT4 couldn’t handle as smoothly. In EA development, testing time directly translates to development speed, which is a huge advantage.
- More freedom and expressivenessMQL5 embraces object-oriented concepts, allowing you to compose program parts like building blocks. This makes creating complex indicators and handy panels with clickable buttons relatively smooth.
- Investment in the futureMetaQuotes, the developer, is already focusing on MT5 updates. If you’re going to learn something new, choosing the tool that will become the standard is prudent.
At first, you may be puzzled by the differences from MQL4, but once you get used to MQL5’s comforts, you won’t want to go back. A paradise-like, comfortable development environment awaits you.
Development environment is already on your computer
When starting programming, many stumble on “setting up the development environment.” Downloading various software, configuring them, setting paths—this can take a day and exhaust you before you even write a line of code.
However, the wonderful thing about MQL5 is thatyou already have a fully prepared development environment once you install MT5.
Open MT5 and click the yellow notebook-like icon at the top menu, or press the F4 key. Then you’ll see“MetaEditor”— the dedicated window to write programs.
That’s all—ready to go! No need to buy new software or go through tedious setup. From the moment you decide, you can take your first step as a programmer. Doesn’t that feel exciting?
Programs are not “magic” but “recipes for cooking”
“But when I see a black screen filled with English text, my head hurts….”
You might hear such concerns. Indeed, first-time source code can look like an indecipherable cipher or dark magic spell.
However, the essence of programming is very simple. It’s likea “recipe for cooking”in a sense.
For example, imagine making curry rice as a recipe:
- Chop onions and potatoes
- Sauté in a pot
- Add water and simmer
- Add curry roux
- If the taste is weak, add a little salt
Setting aside jokes about no meat, programming follows the same pattern: you write what you want the computer to do in order. In actual MQL5 programs, what behavior will occur? For instance, describe in words the operation of an indicator that emits a signal when moving averages cross.
- Prepare the chart (pre-work)First, compute and prepare the short-term and long-term moving averages on the screen. Behind the scenes, you’re continually calculating “the average for the past 14 days” and “the average for the past 50 days.”
- Monitor the situation (check the heat of the pot)Each time a new candle completes, check the relative positions of the two moving averages.
- Decision of conditions (tasting to see if it’s good)Check conditions like “if the short-term line was below the long-term line just before, but now it has risen above (golden cross).”
- Execution (plating)If the conditions match, draw an upward arrow (↑) on the chart. You can also trigger an alert sound saying “Chance is here!”
How about that? Translating into words makes it clear that it isn’t magical magic but something understandable.
What we will be writing in MetaEditor from now on is a list of requests to MT5. MT5 is very earnest and obedient, so it will work 24 hours a day exactly as per your recipes, without complaint. Sometimes it might misread the recipe and behave oddly, but that too is part of its charm. The process of refining the recipe through failures is the essence of development.
Why I love “simple and robust trading”
Here, allow me to share my view on trading a little.
Once you can write programs, you might start trying to add more complex conditions or to create the strongest EA that never loses in the past ten years of charts. You combine many indicators and set dozens of parameters to ensure the past data yields profits.
This is called“curve fitting (over-optimization)”in technical terms.
I used to stare at computer screens, pushing parameters until my eyes bled, shouting in joy when I finally found the holy grail. I used to do that a lot(笑)。
But what happens when you run such a past-focused, strongest-ever EA on actual markets (forward testing)? In most cases, it becomes a nightmare. Because markets are living beings, and the exact same movement never repeats in the future.
Systems forced to fit a specific past period and its noise will stop working as soon as market conditions change.
That’s why Iprioritize “simple and robust trading”.
Truly profitable logic often comes from simple, time-tested methods like “buy when the moving averages cross” or “sell when price breaks a support line,” which can adapt to changing market environments. Simple rules carry a flexibility that lets them endure. In this series, I want you to focus on eliminating unnecessary complexity and hitting the core. Let’s move away from over-optimization and create programs that endure longer.
The journey we will learn together
Now, here is a rough outline of what we will learn in this “MQL5 Paradise.”
- Master the basicsExplain the fundamentals of programming—variables, functions—in clear, relatable terms. We will avoid difficult jargon, so you can follow with ease.
- Create your own indicatorFirst, try creating an indicator that draws lines or emits signals on the chart. Seeing your own logic visualized on the chart is an invaluable experience.
- Develop EA (automatic trading system)Use the knowledge from indicators to learn how to place orders and manage positions with an EA. We will also cover risk management concepts and safety measures for when errors occur.
- Practical implementation techniques and distribution preparationWe will share practical ideas to make your tools more user-friendly and how to publish and distribute them on GogoJungle for others to use.
We will progress step by step, so please stay at your own pace and don’t rush. If you get stuck, review the previous articles.
In closing
For our commemorative first issue, this turned out longer than expected, but thank you for sticking with me until the end.
This time there were no programming code samples, but if you could walk away with the image that “MQL5 seems interesting” and “I can do it,” that would be a great success.
The ability to create your own automated trading programs will be a lifelong asset. Rather than relying on someone else’s black-box EA, understanding every aspect of the logic and operating it with confidence offers a significant mental benefit as well.
Next time, we will actually run a simple program using MetaEditor. Let’s take the first step to display “Hello, MQL5!” on the MT5 screen.
Well then, I look forward to seeing you in the next edition of “MQL5 Paradise.” May your trading life become richer and more fruitful!