Price action is a trading methodology that has been around for ages and is very popular among the ever-growing trading community. Many retail and institutional traders often make use of the price action trading strategies to predict and analyze the price movements of financial assets in the short term, this is achieved by analysing historical price behaviour and trends.

Through this article, we will try to deepen our understanding of the price action trading concepts and we will also try to identify price action patterns that develop in real charts.

## What is price action trading?

The price action strategy is a trading practice where the utmost importance is given to the study of price movement & behaviour over time rather than depending on various technical indicators to anticipate the upcoming trend and take up relevant long/short positions.

Although most price action traders do not use common trading indicators such as the Moving Averages, Bollinger Bands or the RSI, it is not a mandatory practice and some traders may prefer to include a couple of indicators in their trading setups to increase the accuracy.

However, the weightage given to pure price movements would always be far greater than the weightage assigned for the technical indicators.

The most sought after trading set-ups that price action traders look for are the ones that offer the best possible risk-to-reward ratio.

These setups may include various kinds of emerging breakout patterns (eg: trendlines, flags, triangles, wedges), trend reversal patterns like the head and shoulder pattern, double tops, double bottoms, etc.

Apart from the above, it is also very important to be able to identify key levels such as the support and resistance zones and have a basic understanding of various candlestick pattern analyses.

## Popularity of price action trading

The vast majority of market participants strongly believe that forecasting asset prices is next to impossible because there are so many factors that can influence the prices of these assets. Indeed, it is very difficult to develop a perfect system that will work regardless of the ever-changing market cycles & trends.

However, it has been observed that asset price movements in the near term can at times be correctly estimated using a combination of past price data and some basic knowledge of technical analysis. This is precisely where the price action trading strategy comes into the picture.

Price action at its core is very simple and easy to grasp even by budding traders. Another plus point is that it works really well across multiple asset classes such as stocks, commodities and can even be applied in the forex and crypto markets.

But what makes this strategy stand out among the trading community is the fact that it helps traders feel more in control as they are scoping for trading opportunities based on their own interpretations of price action.

At the same time, the strategy also offers a ton of flexibility in aspects like position sizing, risk/reward management, entry and exit points, etc which can’t be easily achieved while one is following a standard rule-based trading system.

## Different types of charts

A simple line chart provides a summary of closing price data for an asset over a specified period of time. The following is an example of a simple line chart that displays Apple’s daily closing price data.

A drawback of the line chart is that other important data such as the opening price for the day, highest and lowest traded price are simply not included in the chart.

Thus for better technical analysis, candlestick/ bar charts are preferred over line charts as they include and represent this additional data that can be followed to precisely study the price movements during a specified time period.

The following is a Candlesticks chart which also illustrates the Open, High, Low, Close data at every interval.

A crisp understanding of how candlesticks are used to represent OHLC data is required to be able to spot and read price action in charts. If you wish to learn more about candlesticks you can visit this link.

## Understanding the market trend

### Downtrend

Whenever the price moves in a manner where it forms a series of Lower Highs and Lower Lows when compared to its previous swing high and swing low, we can say that there is an ongoing downtrend or Bearish trend in the asset prices.

### Uptrend

When prices continuously move to form a series of Higher Highs and Higher Lows in comparison to its previous swing high and swing low, we can conclude that the asset prices are in an Uptrend or Bullish trend.

### Sideways Trend

If the swing highs and swing lows tend to move within a horizontal range over time, the trend could be termed a Sideways Trend. Prices often move in a sideways direction during a consolidation phase. These phases could later give rise to a continuation of the existing uptrend/downtrend or sometimes may even indicate the possibility of a reversal in the overall trend.

## Concept of support and resistance

Resistance is an important level where the available supply tends to exceed the overall demand and this stops prices from increasing any further. In most cases, prices will face huge selling pressure and a sharp downtrend can be expected when the price reaches this zone.

The above figure displays a very strong resistance zone near the 2300 price band.

On the contrary, Support is an important price level where the demand for an asset exceeds the available supply and this stops prices from falling any further. In most cases, the asset may seem undervalued at a key support level, resulting in investors/traders buying into the asset and creating fresh long positions.

The above figure displays a key support/demand zone around the 160 price band and a strong resistance zone near the 360 price band. Watch how the price trend strongly reverses when it enters these important zones.

## Concept of trendlines

A trendline is a straight line that connects at least three swing highs or three swing lows and extends towards the future to act as a support or resistance zone. Most properties that are applicable to support and resistance zones can be witnessed at trendlines as well.

The above image shows us a trendline connecting swing highs from the year 2015 to the year 2020. As we can observe, the price was in a downtrend as it formed a series of lower highs and lower lows during the period.

## Identifying support and resistance using Python

The first step in our approach is to import necessary libraries and get the asset data.

We will be focusing on the close price data of HINDUNILVR.NS for performing the support and resistance analysis. We fetch the asset’s OHLCV data from Yahoo! Finance and store it in a dataframe as shown below.

The last 5 rows of our data can be displayed using the df.tail() command.

Output:

 Date Open High Low Close Adj Close Volume 2021-07-05 2499.000000 2513.399902 2485.050049 2499.050049 2499.050049 761700 2021-07-06 2490.000000 2497.949951 2469.000000 2472.500000 2472.500000 461782 2021-07-07 2458.000000 2490.800049 2445.850098 2481.649902 2481.649902 623145 2021-07-08 2462.199951 2469.750000 2438.449951 2447.550049 2447.550049 1114426 2021-07-09 2440.000000 2464.500000 2438.449951 2451.449951 2451.449951 538094

To get a visual representation of the close price data, we will use various functions of the matplotlib library.

Here’s the graph highlighting the close price of the asset:

Now since we have all our data in place, the next step is to identify the swing highs and the swing lows in the above price graph. An easier way to do this is to identify the local minima and local maxima points.

To identify the local minima and maxima points, we will first need to smoothen the price graph. This can be achieved using the savgol.filter function from the scipy.signal library. To learn more about this function, you can visit the documentation page here.

Next, we will plot and compare the normal close price graph with the smoothened close price graph.

To identify the local minima and local maxima points we have created two functions namely: the pythg() function and the loc_min_max() function.

The loc_min_max() function loops through all the points ranging from index 1 to -1.

If any given point is smaller than the previous point and the next point, it is a local minima. Similarly, if a point is greater than the previous point and next point, it is termed a local maxima.

You will notice that we may have many local minima and local maxima points if we follow the above logic. To avoid encountering this problem, we have defined the pythg() function. We use the pythg() function to compute the distance between the current point and the previous point along with the distance between the current point and the next point.

We select a point as a local minima or local maxima only if the distance between the current point and the next point is greater than half the distance between the current and previous points.

The following is the plotted result of the local minima and maxima points computed using the above functions.

In the next step, we will try to identify all potential support and resistance lines.

A potential support line would be a line that connects two or more swing lows (local minima points) whereas, a potential resistance line would be any line that connects two or more swing highs (local maxima points)

We will use the s_r_lines() function to fetch coordinates of all possible lines that pass through at least two known points from our minima_pts and maxima_pts datasets respectively.

Apart from identifying the coordinates for all potential support and resistance lines, we also calculate the Mean Squared Error of each line using the line_mse() function.

The mean squared error value helps us in gauging the overall deviation of all points present in the minima_pts or maxima_pts dataset from the identified support or resistance line.

The coordinates and MSE value for all potential support lines are saved in the array support_lines. Similarly, values for potential resistance lines are save in the array named resistance_lines.

Next, we will use the line_least_mse() function to iterate through all the data present in the support_lines and resistance_lines arrays respectively and fetch the line which has the least MSE value.

The data corresponding to the best support and resistance lines is displayed below.

(array([ 578.        , 1980.45256112]),
array([ 195.        , 1541.04549061]),
758.1751282695745)
(array([ 623.        , 2258.94408086]),
array([ 107.        , 1598.98845783]),
4601.941504515801)

Lastly, we will plot the support and resistance lines on the asset’s close price graph.

## Benefits and drawbacks of price action trading

### Benefits:

• It is very easy to understand and practice price action trading strategies, even if you do not have much experience in trading.
• Price action trading strategies work well across most financial assets such stocks, forex, crypto, etc. and are valid across all timeframes.
• You have the freedom to decide the entry and exit points for every trading setup based on your interpretation of the risk and reward.

### Drawbacks:

• You will have to spend a considerable amount of time studying charts, identifying patterns and scoping for various potential trading opportunities.
• At times, price action traders analysing the same chart may come up with contradictory interpretations.
• Automating price action trading strategies is difficult and hence, traders implementing it manually must have strong control over their emotions to be consistently profitable over a period of time.

### References

Alternatively, you can consider reading the books mentioned below:

## Conclusion

We have learnt about some basic aspects of price action and understood concepts such as support and demand zones, trendlines, etc. Price action strategies were even applied by traders back in days when personal computers did not exist.

Since then, price action trading has evolved over the years, and reading price charts has only become easier in recent times with the mass availability of free charting platforms that offer convenient tools to study price charts.