Price action analysis is the biggest part of technical analysis and is led by candlestick analysis. Generally, your aim is to use the current information to infer a price direction which is not the easiest task to do. This article discusses the Strat indicator, a price action technique based on labelling candlesticks.
Knowledge must be accessible to everyone. This is why, from now on, a purchase of either one of my new books “Contrarian Trading Strategies in Python” or “Trend Following Strategies in Python” comes with free PDF copies of my first three books (Therefore, purchasing one of the new books gets you 4 books in total). The two new books listed above feature a lot of advanced indicators and strategies with a GitHub page. You can use the below link to purchase one of the two books (Please specify which one and make sure to include your e-mail in the note).
Pay Kaabar using PayPal.Me
Go to paypal.me/sofienkaabar and type in the amount. Since it’s PayPal, it’s easy and secure. Don’t have a PayPal…www.paypal.com
Introduction to Candlestick Charts
Candlestick charts are among the most famous ways to analyze the time series visually. They contain more information than a simple line chart and have more visual interpretability than bar charts.
A candlestick is a box-shaped chronological element composed of OHLC data which helps determining the trend but also gives more information on volatility and market psychology.
A bullish candlestick is generally green (or white) and occurs whenever the close price is higher than the open price.
A bearish candlestick is generally red (or black) and occurs whenever the close price is lower than the open price.
The next chart shows a candlestick chart on EURUSD. The time frame used is hourly. What can you say about the trend seen?
With the prevalence of red candlesticks and the increase in volatility (noted by the increasing distance between the high and low prices), the market is obviously in a bearish trend.
The Strat Indicator
The Strat indicator is an overlay technique which means that its information (or values) appear on the same chart as the candlesticks as opposed to independent indicators that are charted in a different panel (e.g. the RSI).
Created by Rob Smith, the Strat indicator aims to categorize candlesticks based on their position relative to the previous ones.
Inside bar (labeled as 1): The candle is completely within the high and low of the previous candle. An inside bar represents indecision.
Directional bar (labeled as 2): The candle extends above or below either the high or low of the previous candle.
Outside bar (labeled as 3): The candle extends both above and below either the high or low of the previous candle.
The color of the candles are not extremely important in the Strat indicator. The following Figure shows a theoretical illustration of an inside bar.
The following Figure shows a theoretical illustration of a directional bar.
The following Figure shows a theoretical illustration of an outside bar.
Inside bars may represent a pause in the current move and may signal a reversal or a consolidation. Directional bars represent a continuation of the move (the market is still in the middle of the established trend). Outside bars represent a possibility of a broadening formation.
The principles of the Strat indicator (and thus the Strat technique) are as follows:
Time frame continuity: This is what I like to refer to as the invisible hand in my previous articles and books. Basically, when you have the same market regime (bullish or bearish) across the different time frames (quarterly, monthly, weekly, daily, etc.), you are more likely to have a profitable trade in case you trade in that same direction.
Broadening Formations: A broadening formation is a pattern where ranges continue to expand on both sides.
Inside bars: They are used to identify reversals.
Let’s create the indicator using Trading View’s coding language Pine Script. The output should look like this. A candlestick chart with numbers outlining information.
The numbers are made as follows:
Number 1 in green and below the price is an inside bullish bar.
Number 1 in red and above the price is an inside bearish bar.
Number 2 in green and below the price is a directional bullish up bar.
Number 2 in red and below the price is a directional bearish up bar.
Number 2 in green and above the price is a directional bullish down bar.
Number 2 in red and above the price is a directional bearish down bar.
Number 3 in green and below the price is an outside bullish bar.
Number 3 in red and above the price is an outside bearish bar.
The code used to create this indicator is as follows:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sofien-Kaabar
//@version=5
indicator("Strat Indicator", overlay = true)
inside_bar_red = high < high[1] and low > low[1] and close < open
inside_bar_green = high < high[1] and low > low[1] and close > open
directional_bar_up_red = high > high[1] and low > low[1] and close < open
directional_bar_up_green = high > high[1] and low > low[1] and close > open
directional_bar_down_red = high < high[1] and low < low[1] and close < open
directional_bar_down_green = high < high[1] and low < low[1] and close > open
outside_bar_red = high > high[1] and low < low[1] and close < open
outside_bar_green = high > high[1] and low < low[1] and close > open
plotchar(inside_bar_red, char = '1', location = location.abovebar, color = color.red)
plotchar(inside_bar_green, char = '1', location = location.belowbar, color = color.green)
plotchar(directional_bar_up_red, char = '2', location = location.belowbar, color = color.red)
plotchar(directional_bar_up_green, char = '2', location = location.belowbar, color = color.green)
plotchar(directional_bar_down_red, char = '2', location = location.abovebar, color = color.red)
plotchar(directional_bar_down_green, char = '2', location = location.abovebar, color = color.green)
plotchar(outside_bar_red, char = '3', location = location.abovebar, color = color.red)
plotchar(outside_bar_green, char = '3', location = location.belowbar, color = color.green)
In subsequent articles, I will discuss strategies and patterns used in tandem with the Strat indicator.
Summary
To sum up, what I am trying to do is to simply contribute to the world of objective technical analysis which is promoting more transparent techniques and strategies that need to be back-tested before being implemented. This way, technical analysis will get rid of the bad reputation of being subjective and scientifically unfounded.
I recommend you always follow the the below steps whenever you come across a trading technique or strategy:
Have a critical mindset and get rid of any emotions.
Back-test it using real life simulation and conditions.
If you find potential, try optimizing it and running a forward test.
Always include transaction costs and any slippage simulation in your tests.
Always include risk management and position sizing in your tests.
Finally, even after making sure of the above, stay careful and monitor the strategy because market dynamics may shift and make the strategy unprofitable.