MetaTrader 5 MQL (1) — First Program
If you wanna learn MQL language from scratch, please check https://medium.com/@p37497277p/metatrader-5-mql-0-the-beginning-240d0c7e32c1…
MetaTrader 5 MQL (1) — First Program
If you wanna learn MQL language from scratch, please check https://medium.com/@p37497277p/metatrader-5-mql-0-the-beginning-240d0c7e32c1 for more detail.
Here it comes one of the simplest strategy you could have online! I’ll talk about the mindset and the logic behind the strategy, the code(the easiest part) would be at the very last of/next article.
This is the first strategy, one example of price actions, called “Three White Soldiers” (Three black Crows on the other direction). To specify, it’s simply the combination of three consecutive bullish days, for that “if we saw three consecutive bullish candlesticks, then we expect the price to surge on the next day.”

Source: howtotradeblog.com
After get an understanding of the surface, you might think “It’s impossible that one could profit simply from that.” The truth is, YOU’RE 100% CORRECT! It might works a century ago, but since the market becomes more complicated, more noises and more investor found this pattern, the pattern would sure to lose its magic power. However, what can we learn from this pattern?
Based on the mindset, we could have such conclusions:
- It’s a matter of statistics
- The mindset of three white soldiers is the same as the mindset of trend following strategy(follow the trend you expected).
- It doesn’t work, but its mindset works (I’m pretty sure there’s a lot of people using trend following strategy nowadays, which has the same concept as three white soldiers), so you should try to combine this with other strategies to see if the combination works.
For example, one of my strategies is combining KNN(K-nearest-neighbors) from Machine Learning with non-linear-regression (Mathematics) to predict the trend, and I can add another feature — Three White Soldiers — to my strategy. Since my strategy is used to find the trend, then Three White Soldiers must work based on that.
One of the easiest example(non-quantitative) is stock price of Nvidia(NVDA) from 2023/10/31 to date.

Here we have two “technical tools”:
- Three White Soldiers
- The strong assumption(tested using historical data) that the stock market tends to be bullish for more than a week after Halloweens.
Based on 2. assumption, I assume that it’s a uptrend; Based on 1., I’ll buy in and hold a long position three days after 10/31/2023. And hit the profit of 10% or 20%, based on how much you trust your strategy.
Homework:
Try to search for “Three black crows” and find both an example of success and an example of failure on the same stock.
Next, we’ll be talking about the implementation on MQL5!
Should you have any question or suggestion, feel free to message or contact me!
메타데이터
- post_id
- e8d2185e15fa
- slug
- metatrader-5-mql-1-first-program-e8d2185e15fa
- url
- https://medium.com/@p37497277p/metatrader-5-mql-1-first-program-e8d2185e15fa
- canonical_url
- https://medium.com/@p37497277p/metatrader-5-mql-1-first-program-e8d2185e15fa
- author_url
- https://medium.com/@p37497277p
- status
- ok
- fetched_at
- 2026-06-22 00:13:37