Using Fractals & EMA to find reliable support & resistance levels in trending markets
Algorithmic trading is the next best thing to happen to your trading career. It’s the method that transforms your trading to a consistent edge-driven machine and that gets rid of emotions and inconsistencies. You will learn what algorithmic trading is, how it works with Metatrader 5, and we will guide you in building your first Export Advisor that can fully automatically take trades for you. The best of all, you don’t need any programming or computer science knowledge to start algorithmic trading. We have done the hard work by transforming the code into drag-and-drop blocks, you only need to bring your creative mind to life to develop ideas into fully automated trading systems.
Algorithmic trading is a method in which trading decisions are made by a computer using an algorithm rather than by a human. An algorithm is best described as a decision tree with true/false conditions. Each condition resembles a rule of the trading plan. A computer runs through this decision tree, rule-by-rule, and checks if the market conditions fit with the rules described. At the end of the decision tree, there is the final decision to open or close a trade.

Algorithmic trading allows a trader to run a trading plan exactly as it was programmed, without errors and without intervention. An algorithm will run while you sleep, while you work, and while you have other things to do than trading manually. We understand that this sounds like rocket science, especially the programming part. That’s why we want to teach you how you can become an algorithmic trader without having to write a single line of code.
We have been trading for 10 years with 5 years of manual trading experience. I have experienced the issues most traders struggle with, and I still see many traders around me struggling with this still.
A trading strategy can make a lot of sense on paper. When backtesting, many strategies still make a lot of sense, given that they are fully mechanical. The real problems only arise when it comes to trading a live account, or prop firm demo account in real-time. You know what kind of setup you want to trade, what confirmation you are looking for, and where you ideally want to enter and exit. You have done this hundreds of times before during your backtesting phase. But when it comes to live execution, things often become inconsistent.
You start to doubt setups, you FOMO in a trade thinking it might leaves without you, you close a trade early because you feel like a small win is better then a loss. These are just a few examples of how your emotions can get the best of you during live trading. And we haven’t even brought up the fact that manual trading, for the most part, requires you to actively monitor the markets and be ready to take a setup when it presents itself. However, other aspects of your life don’t care that you need to take a trade and thus you will find yourself missing setups and screwing with your edge.
That is exactly why so many traders become interested in algorithmic trading and automated trading strategies. Automation brings clarity and consistency to your trading without having to put in more effort. Once you start with automated trading, you remove a lot of the noise that comes with manual decision-making. An algorithm or trading bot does not hesitate, get distracted, or start second-guessing a setup after three losing trades. It simply follows the logic it has been given. And this is incredibly powerful.
Next to getting rid of the emotions, automation gives you a honest idea of how good your strategy really is. Once a strategy is automated, it can be backtested flawlessly over 10+ years of high-qualtiy data in a matter of hours. Instead of guessing whether a strategy “seems promising,” you can actually study how it behaves across different conditions. That does not guarantee success, but it does give you a much more solid foundation to work from. It will show you right away if a strategy is worth pursuing or not.
Another reason traders automate their strategies is speed. Markets do not wait for us. Some setups appear and disappear quickly, and if you are trading manually, it is easy to miss opportunities or react too slowly. An automated trading system can monitor the market continuously and execute immediately when the conditions are met. That makes automated trading especially useful for traders who don’t have the time to monitor the market all day. It gives you room to focus on other aspects of your life while the trading happens for you.
Of course, automating a strategy does not lead to instant profitability. A bad strategy does not become a good one just because you turn it into an automated trading system. But a good strategy becomes far more consistent and scalable when it is automated properly.
That is why traders automate their strategies. Not because they want to remove themselves from the process entirely, but because they want to trade with more structure, more discipline, and less emotion. And we believe, that is where creating automated trading systems in Profectus AI really become valuable.
An algorithm is the program that runs the decision tree. Essentially, it’s the code that holds all the rules of the trading strategy and the trading execution modules. This code needs to run somewhere to be able to execute trades. For this execution environment, we focus on Metatrader 5 (MT5). MT5 is the biggest trading platform for traders in the Forex/CFD market. MT5 is designed for algorithmic trading, and it even has its own coding language, MQL5. The MT5 environment refers to a trading algorithm as an Expert Advisor (EA).
An Expert Advisor (EA) — also known as a Trading Bot or Algorithm (Algo) — is software that automatically enters, manages, and exits trades in Metatrader 5 based on predefined rules.
So, now you have a general idea of what algorithmic trading is and why we call our algorithms EAs or bots.
You already know that an algorithm is essentially a coded trading strategy so that a computer can run it. There are virtually no limits to what type of trading strategies can be coded into an EA, as long as they follow one simple rule:
When it can be expressed as rules, not feelings.
This means that the strategy can not rely on the discretion of the trader executing it. Mechanical means that the rules are fixed and do not change based on the trader’s discretion. Let’s look at an example of a discretionary strategy and a mechanical strategy.
Discretionary strategy
-At market open, I try to define market sentiment for the coming day
-If I see strong buying pressure right at the open, I might decide to look for long positions
-If I like how the first few 15-minute candles form from the open, I take a long and place my stop loss at a safe position behind some form of support
This strategy is all about the trader’s discretion. Nothing is mechanically defined, and the rules are bent around what the trader sees visually and the feelings he attaches to these visuals. There are so many questions unanswered:
How do you define market sentiment?
What is considered strong buying pressure?
How many candles are you watching, and what pattern are you looking for?
What is the exact position of the stoploss?
None of these rules can be repeated exactly the same because of the ambiguity. This makes it difficult to transform this strategy into an Expert Advisor.
Mechanical strategy
-At 09:30 Market open, I measure the overnight range from 00:00-09:30.
-If the height of this range falls within my threshold of 0.5%, I can look for a breakout
-If between 09:30 and 11:00 a candle body on the 15-minute timeframe closes above the high of the overnight range, I take a buy position
-I place my stoploss at the low of the range and my target at 2x the stoploss size
-If my trade runs at half my target (1R profit), I move the stoploss to breakeven and let the trade run from there
This strategy is fully mechanical and explains every detail using clear, repeatable rules. There is no room for discretion, and thus this exact same strategy can be repeated every day, without error. This makes it a perfect strategy to automate and turn into an EA.
With that said, in Profectus, you can automate every type of trading strategy:
Let’s start with a simple trading idea first. If you’re starting to build your first strategy, it’s always a good idea to use a strategy with relatively few rules. For this example, we’re using a simple Breakout strategy. These are the rules:
1. We check the rules at every 1h candlestick closure, between 09:00-20:00
2. We want to see a 1h candlestick closing above the 20-period Bollinger Band Middle line
3. We check if there are no open trades yet, and we place a pending order on the high of this candlestick that closed above the Bollinger Band Middle line.
4. We place a stoploss at 0.3% of the market price and a take profit of 9.5x the stoploss (for a 1:9.5 risk-to-reward ratio)
5. We add a simple risk management module that trails the stop loss with a recent candle low price when the trade hits 1R floating profit
Very basic, yet very effective. We call this strategy the Bollinger Band Breakout Strategy. Now, let’s build it together. We first quantify the strategy completely using the following framework:
Trailing Stop: If trade hits 1R profit, the stop loss moves to the low of the candle 5 bars back, updated every hour.

Block 1: Run per candle speaks for itself. The EA will run all the attached logic once every candlestick, in this case, the 1hr timeframe
Block 2: Run in session. This block specifies the time session we use to trade. In this case, we specify the time between 09:00 and 22:00.
Block 3: Trade Rule. In this Trade Rule block, we specify that the previous candle needs to close above (using the > operand in the block) the Bollinger Band Middle line to generate a valid trading signal.

Block 4: No open trades. We use the Count trades block and specify that:
Trade Count = 0
Order Count = 0
This means the EA is only allowed to take a trade if there are no open trades or orders. It will only open 1 trade at a time.
Block 5: Buy Pending Order. This is the block that houses the actual trade specifications. It specifies the opening price of the order (on the high of candle ID 1, which is the previous candle), the risk (by default this is 1% per trade), the stop loss (at 0.3% of price), and the take-profit (at 950% or 9.5x the stop loss). All of these rules can be selected and filled out in the block in a matter of seconds.
And that’s it! You have now actually created your first EA in a matter of minutes!
For the trading management blocks, you can click Templates and navigate to the Candle High/Low management template.
To export the project to run it in Metatrader 5, you simply press the “Download” button in the top-right corner of the builder. If you want to backtest this algorithm, but don’t know where to start, read through this simple backtesting MT5 Expert Advisors guide.

If you know how to program, and if you are willing to spend a lot of time, you can build almost anything from scratch. You’re probably not even limited to the MQL5 language and have probably built your own environment. However, coding a strategy yourself, even with the use of AI agents is prone to errors and still requires basic understanding of programming. For most traders, this is where the problem starts. Knowing how to trade is not the same as knowing how to turn a strategy into a trading bot, even with the help of AI agents.
This is where Profectus AI comes in.
With Profectus AI, the goal is to remove the coding barrier between your strategy idea and your Expert Advisor. Instead of writing MQL5 by hand, you build your trading logic visually. You define the rules, connect the blocks, and turn your strategy into an EA in a much more intuitive way.
With manual coding, a lot of the work is technical. With Profectus AI, the work stays strategic. You spend more time thinking about how the strategy should behave and less time correcting code and debugging.
That makes a big difference, especially for traders who:
Another advantage of using Profectus AI is speed. Making small changes to a hardcoded strategy can require extra coding, testing, and debugging. With a no-code workflow, it becomes much easier to add and adjust new trading rules. That does not mean no-code is “better” in every possible situation. There may be advanced use cases where fully custom MQL5 coding offers more freedom. But for many traders, that level of flexibility is not a bottleneck. The real bottleneck is getting from a good strategy idea to a working, testable trading bot in the first place, quickly.
If you are a trader who wants to build, test, and improve automated trading strategies without getting buried in code, Profectus AI offers a much faster and more accessible path.
The idea of this article is to give you a better understanding of automated trading and how this can be beneficial to you. It’s an introduction to the concept and if you’ve made it this far into the article it’s most likely that you are interested in learning more. Let’s first get you started with some pre-built trading strategies, some of which you might already recognize. We are adding new automated strategies on a weekly basis to our Trading Bot Library to help you on your way to becoming a sufficient algo trader.
Explore: Trading Bot Library of Profectus AI
If you want to dive deeper into building your own automated systems in Profectus, I recommend you to do a deep dive in our educational section in the Helpcenter. The best place to start is by learning about the most important blocks in Profectus AI, and how to use them. This is the kickstart to your algorithmic trading career.
Dive into a world of knowledge, trends, and industry updates on the Variable blog. Our curated content covers a spectrum of topics,