June 10, 2026

Automating the Inside Bar Breakout Strategy

The biggest strength of the Inside Bar Breakout strategy is that it teaches a key automation lesson: A visual price action pattern can be reduced to a set of exact rules.

Inside Bar Breakout Strategy

The Inside Bar Breakout strategy is one of the cleanest price action strategies to understand, test, and automate. 

The idea is very simple: 

  1. Price pauses after a run
  2. Price moves in a small range
  3. Volatility compresses
  4. Price eventually breaks out

It’s so simple and so easy to automate in Profectus AI, yet so many people make it too complicated or overlook the power of these simple rules.
What I really like about this strategy is that there is no predictive element or bias needed to figure out if the price is breaking out to the upside or the downside. With our version of the Inside Bar Breakout, we anticipate a breakout in either direction and just trade which one comes first. 

This strategy is based on 2 very simple elements. First, there is the inside bar, and secondly, there is the imbalance. Both are indicators of consolidation and volatility compression and can be derived directly from only looking at the previous candle.

Disclaimer: Templates are for educational purposes only!

👉 Get the Inside Bar Breakout Strategy Automation Template → Inside Bar Breakout Profectus Template

This template is designed to run on the Daily Timeframe.

You might also want to watch the full Youtube video on the Inside Bar strategy here to get an in-depth explanation of the pattern.

How we measure consolidation

We start by looking if price is in consolidation. We made this as simple as we can by simply looking at the previous candle and checking if the body of that candle only makes up a small portion of the total size of that candle. Our specific rule is that the body size can not be bigger than 50% of the total candle size. For example, if the total candle size (from high to low) is 100 pips. Then the body of that candle (from open to close) can not be bigger than 50 pips. 

We call this the imbalance candle. We run this strategy on the Daily timeframe, but if we were to move down to a lower timeframe, the imbalance candle shows a consolidating price range. 

How we measure volatility compression

The second rule we have for this strategy is that we want to see if the imbalance candle we measured earlier is also an inside bar. An inside bar is a candle (or bar, if you like) whose high and low fall within the high and low of the candle before it. 

Candle high candle ID 1 < Candle high candle ID 2

Candle low candle ID 1 > Candle low candle ID 2

The total price range of this candle is now compressed within the total price range of the candle before it. Combined with the imbalance characteristics, this represents a perfect consolidation price range that is waiting for a breakout. 

Inside Bar Breakout Trading Rules

Let’s keep it simple and list the trade rules for this strategy one by one so we can build this strategy together in the next step using Profectus AI.

  1. Once a day at market open, check if the previous candle is an imbalance candle (body 50% smaller than total candle size)
  2. After this, check if this same candle is an inside bar compared to the candle before it
  3. Place 1 buy pending order at the inside bar candle high & 1 sell pending order at the inside bar candle low
  4. Use a 0.1% of price stop loss (adjust to your own preference) and a 500% of stoploss target for a 1:5 RR (adjust to your own preference)
  5. Set an expiration time at the end of the day, in our case, at 21:00, so that both pending orders are deleted
  6. Add a trade management module, such as the Lock-in profit template, to trail the stoploss after 2% floating profit has been reached.

This is what the complete picture looks like on a chart. I have added what it looks like from the Daily timeframe perspective and what the trade looks like on the 15-minute timeframe.

Inside Bar Breakout MT5 EA
Inside Bar Breakout trading example

Automating the Inside Bar Breakout Strategy

Now, let’s move to Profectus AI to build this amazingly simple strategy so that you can test it for yourself. 


Disclaimer: Templates are for educational purposes only!

👉 Get the Inside Bar Breakout Strategy Automation Template → Inside Bar Breakout Profectus Template

This template is designed to run on the Daily Timeframe.

When you open the template, your canvas should look like this. 

Inside Bar Breakout strategy built in Profectus AI
Inside Bar Breakout strategy built in Profectus AI

Let’s go building the strategy block-by-block: 

  1. Run at time block. Put the time setting on Server Time and at 1:00 to start the EA every night at market open
  2. Trade rule block 1. In this first trade rule block, we look for the imbalance candle. It’s a simple expression:

    Candle body size (candle id 1) < Candle total size (candle id 1) adjusted * 0.5
  3. Trade rule block 2. In this second trade rule block, we specify the first part of the inside bar rule.

    Candle high (candle id 2) > Candle high (candle id 1)
  1. Trade rule block 3. In this third trade block, we specify the second part of the inside bar rule.

    Candle low (candle id 2) < Candle low (candle id 1)

  2. Pending order blocks. Connect a buy & sell pending order block and put:

    Stop loss percentage of price: 0.1 (change according to your own preference)
    Take profit percentage of stop loss: 500 (change according to your own preference
    Order expiration: Fixed time 21:00 (to delete the orders at the end of the day)

  3. Add the Lock-in Profit from the Management Templates in the Template section in the builder, and set the rules according to your own preference.

Get Access to the Inside Bar Automation Template

Want to see how this Inside Bar strategy 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 Inside Bar Breakout Strategy Automation Template → Inside Bar Breakout Profectus Template

This template is designed to run on the Daily Timeframe.

How to run the Strategy in Metatrader 5?

We have written a full article to get you started in Metatrader 5 and how you can run any automated strategy, such as the Inside Bar strategy, as an Expert Advisor yourself.

Read the full guide here to run your first trading bot in MT5