Disclaimer: Please note that all screenshots and examples are only shown for the purpose of a technical demonstration and should not in any way be construed as recommending any type of trading strategy and they do not constitute any form of advice. Please click here for further explanation.


Many popular technical trading strategies are based on bar patterns (AKA Candlestick patterns). This means looking for a specific bar behavior as a way to indicate the right moment to enter or exit a trading position.

While these methods are popular amongst technical traders, newbies, as well as experienced traders, often find that monitoring the charts waiting for the right pattern to occur can be a daunting task. A specific pattern might take hours, days, or even weeks to appear, making it harder for traders to stick to their plan.

This is exactly why our new Candlestick Pattern Strategies was so highly requested by Capitaise.ai traders.

How to refer to historical bars?

The latest bar in the chart is the open bar and could be addressed as “the current bar”.

The first closed bar could already be addressed as “the previous bar”, now you can also relate to the previous bar using the term “with an offset of 0”. In order to relate to any bar prior to the previous bar, we will increment the offset, such that:

Relate to historical bars using the term Offset

For example, if you would like to monitor the closing price of a 15-minute bar which closed 2 bars before the current bar, you can write:

“If AAPL bar(1, 15m, Close) with an offset of 1…”

This new capability enables you to create endless strategy scenarios to meet your specific trading method.

In this article, we will demonstrate the use of this new feature with an example of a Candlesticks Pattern Strategy.

Defining candlesticks patterns

For the sake of this explanation, I would like to introduce an example of a 3 bar pattern and how I can set a trading strategy that will execute my orders once this pattern occurs.

The following 3 bars pattern tries to seize an opportunity for quick-moving market trade. A long play of the 3 bar pattern would look like this:

This pattern starts with a long bullish bar followed by a smaller contained bearish bar and ends with the current bar breaking above the first bar’s high price.

In order to catch this pattern, we need to define multiple conditions:

  • The first bar should be a strong bullish bar. for example, we can set it to be at least 5% in price movement:

  • The second bar should have a small range, for example, less than 0.5%.

  • The second bar should also have its high price below the first bar high

  • Finally, the current bar should cross above the first bar’s (the one with an offset of 1) high.

Creating a full entry strategy

Once we add all of these conditions together, we can complete the strategy by setting an action to buy or sell any amount of shares. This is how the full entry strategy will look like:

This is just one example of a trading strategy you can write, automate & execute code-free with Capitalise.ai. Try the strategy wizard to create your own strategy or use ready-made templates from the Live Examples library.

Did this answer your question?