April 1, 2026
W Pattern Support & Resistance Guide
Automating the popular W-pattern strategy in Profectus AI

Support & Resistance - W Pattern

A visual pattern that creates support & resistance

The W-pattern is one of the easier concepts to grasp when it comes to support & resistance trading. It’s visually easy to spot, and with the proper rules, it’s very easy to implement in an MT5 Expert Advisor. Since we are purely focused on no-code automated trading, we don’t care about the visual aspect so much, although it’s fun to see the lines work in your backtest and live trading environments. 


If you are as excited as we are, you can already access the strategy here.

Disclaimer: Templates are for educational purposes only!

👉 Get the Trending W-Pattern Automation Template → W-Pattern Strategy Profectus Template 

What is a W-pattern resistance?

The W-pattern is a chart pattern that looks at 2 consecutive swing high points being formed within a small range to form a clear resistance level. The range refers to how far the swing points can be away from each other vertically, so that they align like a true W, or M if you will. 

When the 2 swing high points form on a familiar level, it can be a clear sign of declining bullish strength. Price pushes into a high, pulls back, and then makes another move higher but fails to break convincingly above the earlier swing high. That second failed push is a sign that buying strength is weakening, while sellers are becoming more active and starting to take control.

W-pattern support & resistance strategy trading swing points
W-pattern with failed swing points resistance strategy entry

Automating the W-pattern in Profectus

The W-Pattern is a support & resistance technique that can be automated very easily in Profectus. The key to automating chart patterns is to think of the best way to quantify the rules. In this case, the main question is: 

“How can we detect the 2 tops that represent failed bullish attempts?” 

The best way to detect a price top is to use fractals. A fractal top is found by looking if the highest price of 3 candles equals the high of the middle candle (candle ID 2). This is very easy to build in Profectus using 3 trade rule blocks. We simply duplicate the rule for the second swing high. The beauty is that since we’re looking for wicks as the highest points, if the pattern is found using our way, it already directly signals exhaustion of buying power.

W-Pattern Strategy rules 

To automate the pattern in Profectus, the EA follows five clear steps:

  1. Find the first swing high. The system starts by identifying a fractal high using a 3-candle structure. Once found, this level is stored as SwingH1. This is the most recent swing high and serves as the first resistance reference point.
  2. Find the second swing high. Next, the EA uses a simple loop to look further back in price action for an earlier fractal high in the same direction. This second swing high is stored as SwingH2.
  3. Check the lookback threshold. Once both highs have been identified, the EA checks whether SwingH2 was formed within the allowed lookback distance from SwingH1. For example, if the lookback threshold is set to 50, then the second swing high must have occurred within the previous 50 candles. This ensures the two highs belong to the same recent market structure and are not too far apart to be relevant.
  4. Check the range between swings. The system then tests whether SwingH1 and SwingH2 are close enough in price to visually form the pattern. This is done using the rangehigh and rangelow multipliers. These thresholds define the acceptable price distance between the two highs. This step is what turns two separate fractals into a recognizable resistance pattern, because it confirms that both highs were formed in roughly the same resistance area.
  5. Execute the short setup. If all previous conditions are satisfied, the EA confirms the pattern and opens a short trade. The stop-loss is then placed at the recent swing leg, SwingH1, since that is the most recent resistance point and the level that invalidates the setup if broken.  
W-Pattern strategy MT5 Expert Advisor in Profectus AI
W Pattern resistance strategy automated in Profectus AI

And that’s it! It only takes a few minutes to drag-and-drop the blocks and build this W-Pattern Support & Resistance Strategy in Profectus. You can now add more rules to refine the entries, or add more confluences to the strategy. 

Deploying the Strategy as an MQ5 Bot on MetaTrader 5

Once automated, the W-pattern strategy can be deployed as:

  • An MQ5 trading bot
  • Running 24/5 on MetaTrader 5
  • Executing trades exactly as designed once you add buy/sell blocks and rules

Why MT5?

  • Built-in algorithmic execution
  • Broker compatibility
  • Robust order handling
  • Industry-standard platform for automated trading

This allows you to move from manual chart analysis to mechanical automated trading.

Can You Automate Other Support & Resistance Strategies?

Yes. In our blog library, this is the third of the Support & Resistance strategies, but more will follow. This is the Pivot Point Support & Resistance strategy if you are looking for another great example.
We can automate any Support & Resistance strategy if it’s mechanical.

If a strategy has:

  • Clear rules
  • Defined conditions
  • Objective execution logic

It can be automated.

Support & Resistance levels are just one example of how trading concepts translate perfectly into algorithmic systems.

Get Access to the W-Pattern Strategy Automation Template

Want to see how this Support & Resistance concept works when fully automated?

Access an enhanced automation template used to turn this trading concept into a deployable MQ5 trading bot inside Profectus. This template has a trade execution module included, so you can start testing it right away!


Disclaimer: Templates are for educational purposes only!

👉 Get the Trending W-Pattern Automation Template → W-Pattern Strategy Profectus Template