I think buying the dip is one of the most challenging strategies. It requires a great deal of caution. When I buy the dip in the stock market, sometimes I am right, sometimes I am wrong. I made costly mistakes, but I had taken excellent deals. I will show you how to buy the dip from long-term investment and give you the source code of my signal system working on the Prorealtime platform.

How to buy the dip

Description of the buy the dip strategy

The strategy I will present is what I do with my money. I developed this strategy after many years of tests and observations. I am not saying that my approach is the best, but it gave me profitable returns.

My buy-the-dip strategy consists of four stages:

  1. Choosing adapted assets
  2. Macroeconomic analysis
  3. Technical analysis
  4. Building a position

These steps allow me to decide when I can start to buy the dip and if I can continue to buy. They help me to shape my entry openings and stay rational. I leave no room for emotions during a bear market.

I. Choosing adapted assets to buy the dip

As I previously explained in the “What ETFs to buy during a bear market?” post, certain assets are more adapted to buy a bear market.

It would be best if you gave preference to these three categories of assets for buying the dip:

  1. The main indexes like the S&P 500, the Dow Jones, or the Euro Stocks 50.
  2. The defensive ETFs with a low beta, like “Personal & Household Goods” or “Food & Beverage”.
  3. The stocks with excellent fundamentals like Procter & Gamble or Colgate-Palmolive.

In this post, I chose to operate the Dow Jones to build a position in a dip. I would warn against buying the dip on the high-volatile or bad-fundamentals assets. I experienced this acutely in the oil companies I described here: “How did I lose 10 000$ in five minutes?“.

II. Macroeconomic analysis

Before buying the dip, I try to understand why the market is falling and what macroeconomics data I need to watch to make an investment decision.

Identify the bear market root cause

Buy the dip means buying a bear market. A bear market has two dimensions: its duration and its depth. The first thing I do is to identify why the market falls. I try to know if the reason will persist long-term or be episodic. Then, I evaluate the severity of this event. This stage is crucial because it will help me to decide whether to start a position construction or not.

If the cause of the bear market is transient, I will rapidly begin to build a position. If it is persistent, I prefer to wait several quarters. If the severity of the situation is low, I will start buying the market after it touches the first main support. I prefer to wait until the market bounces on lower support if the severity is high.

Summary table depending on the type of events:

Short durationLong duration
LOW SEVERITYBuying the firsts supportsWait one quarter
HIGH SEVERITYBuying the third/four supportsWait several quarters

What are the key macroeconomic indicators to watch?

There are numerous macroeconomics data. You will be flooded by information if you try to analyze all indicators. You have to focus on the indicators that most impact the market. These key indicators change over time, depending on the economic paradigm. In the past, investors monitored the Michigan Consumer Sentiment Index and the employment rate most. The most critical macroeconomic indicators today are inflation and FED benchmark interest rates.

What is inflation?

As mentioned by Jean-Claude Trichet, former of the European Central Bank, we can synthesize inflation by the variation of the unit cost of production. The unit cost of production is the total amount of expenses incurred by a company to produce a certain quantity of goods or services and then divide the total amount by the quantity produced. This unit cost integrates all a company spends to produce a good or deliver a service like wages, raw materials, and energy.

Monitoring the sensitive assets to inflation

Certain assets are sensitive to inflation. That is the case with agricultural raw materials, precious and semi-precious metals like gold and silver, and energy like oil. The price of these assets tends to increase during inflationist periods and decrease during deflationist periods.

The following chart shows the gold & silver industry prices and the consumer price index:

Gold silver industry versus consumer price index

The macroeconomics data are monthly or quarterly updated. But the gold and silver price is available in real-time. You can watch the gold price to monitor inflation.

Example of a macroeconomic analysis

Here is the last macroeconomic analysis I made for the second 2022 quarter.

Unit labor cost

You can monitor the unit labor cost on the OECD website: https://data.oecd.org/fr/lprdty/couts-unitaires-de-main-d-uvre.htm

The following graphic shows the unit labor cost from 1996 until 2022:

Unit labot cost

The pandemic crisis caused an unprecedented instability in the labor cost. The current level (2022-Q2) is slightly higher than the pre-crisis level.

Gold price

The gold price appears to have started a bearish trend since April 2022, which is deflationist:

gold peak price
Gold 2022 peak

Oil price

Each economic situation is particular. In the current period, the oil price variation strongly impacted inflation. Watch this asset is important to know if the inflation peak is passed.

The peak in the oil price appears to be over, and the price has decreased since June 2022:

WTI peak price
WTI 2022 peak

Wheat price

The wheat price has strongly decreased since its Mai 2022 peak:

wheat peak price
Wheat 2022 peak

Macroeconomic summary for the 2022-Q2

  • The price increase, exacerbated by the Ukraine war, triggered the stock market collapse at the beginning of 2022. Inflation is the root cause of the market decline.
  • Since the second quarter of 2022, gold, silver, oil, and wheat prices have significantly declined. It seems that some American companies intend to dismiss employees in the next quarter.

Regarding these observations, I consider that the inflation peak is passed. Then I activated my buy-the-dip strategy I will present to you in the technical analysis paragraph. However, I stay prudential because the war in Ukraine is not finished.

III. Technical analysis

It is unnecessary to process a deeply technical analysis when it comes to investing from a long-term perspective. However, ignoring what the market was doing in a buy-the-dip case would be dangerous. It is essential to globally watch what the market is doing and identify the most important supports.

Defining the best time unit

As I exposed in the “10 golden rules for buying the dip” post, the most reliable time units to buy the dip are weekly and monthly. They allow better to identify the global trend and the main supports. These time units are insensitive to the market noise, which helps avoid false buying and selling signals.

Identifying the main supports

To localize the main supports, I primarily use the Fibonacci monthly pivots and the historically highest and lowest. The pivot points are price levels corresponding to critical supports and resistances. The market is often reactive to these price levels. They can be calculated in all time units, but the monthly time unit is perfectly adapted to the buy-the-dip strategy.

Pivot points calculation

Pivot = ( H + B + C ) / 3

R3 = Pivot + 1.000 x ( H – L )
R2 = Pivot + 0.618 x ( H – L )
R1 = Pivot + 0.382 x ( H – L )

S1 = Pivot - 0.382 x ( H – L )
S2 = Pivot - 0.618 x ( H – L )
S3 = Pivot - 1.000 x ( H – L )

In the previous formula, H corresponds to highest, B to lowest, and C to close.

Source code to the pivot points calculation

The following source code is executable on the Prorealtime platform :

//------------------------------------------------------//
// * FIBONACCI PIVOT POINTS * //
Once lastMonthBarIndex = 0
Once monthlyHigh = undefined
Once monthlyLow = undefined
Once monthlyPivot = undefined
Once monthlyR1 = undefined
Once monthlyS1 = undefined
Once monthlyR2 = undefined
Once monthlyS2 = undefined
Once monthlyR3 = undefined
Once monthlyS3 = undefined

If Month<>Month[1] then

  duration = BarIndex - lastMonthBarIndex

  IF duration <= 0 THEN
    duration = 1
  ENDIF

  monthlyHigh = Highest[duration](High)[1]
  monthlyLow = Lowest[duration](Low)[1]
  lastMonthBarIndex = BarIndex
   
  monthlyPivot = (monthlyHigh + monthlyLow + Close[1]) / 3

  // FIBONACCI SUPPORTS
  monthlyS1 = monthlyPivot - .382 * (monthlyHigh - monthlyLow) 
  monthlyS2 = monthlyPivot - .618 * (monthlyHigh - monthlyLow) 
  monthlyS3 = monthlyPivot -  1 * (monthlyHigh - monthlyLow) 

Endif

Monthly pivot on the Dow Jones

The following chart shows the area where the price closes under the thirty monthly support:

Monthly supports Dow Jones

Buying conditions under the support

Now I will create the condition to open an entry under the monthly pivots. The following source code checks the price closes under the third monthly pivot :

conditionPivotFibo = close =< monthlyS3

Evaluating the falling force

I never open an entry if the market too brutally crosses a support. When the market is strongly bearish, it breaks most of the supports. Although this is a posteriori obvious, it is hard to predict where the market will bounce. An excellent way to avoid opening a position during a significant drop involves implementing a volatility indicator into your strategy. It is sufficient to wait until the market calms down before opening an entry.

Volatility checking source code

You have to ensure the market has not broken the support too brutally. Numerous technical indicators can measure volatility. One of the most straightforward is the Bollinger bands. It draws inferior and superior bands around the price. These bands are standard deviations. The crossing of these bands expresses abnormal volatility increasing.

Bollinger Bands
Bollinger bands on the Dow Jones

The following source code checks the price does not cross these bands before opening an entry:

// * BOLLINGER BANDS * //
dev = 2 //quantity of deviation
avg = average[20](close) //mean
BollingUp = avg + std[20](close)*dev //Bollinger Up value
BollingDown = avg - std[20](close)*dev //Bollinger Up value

conditionVolatility = close < BollingUp AND close > BollingDown

Buy the dip signal system

I am going to present to you a backtest of a buy-the-dip strategy. This strategy is purely technical. It will give you buying signals during the dips without macroeconomic states. You will have to process this verification before opening a position. The source code of this signal system is runnable on the Prorealtime platform. It works like an indicator.

Source code of my buy the dip strategy

The technical conditions I use to buy the dip are simple: I open an entry only if the price closes under monthly support and if the volatility is not excessive. The following source code sends a buying signal if the price closes under the third monthly pivot and if the price has not broken the Bollinger bands:

//------------------------------------------------------//
// *** BUY TH DIP STRATEGY ***
//------------------------------------------------------//
// Signal initialization
SIGNAL = 0
//------------------------------------------------------//
// * BOLLINGER BANDS * //
dev = 2 //quantity of deviation
avg = average[20](close) //mean
BollingUp = avg + std[20](close)*dev //Bollinger Up value
BollingDown = avg - std[20](close)*dev //Bollinger Up value

conditionVolatility = close < BollingUp AND close > BollingDown

//------------------------------------------------------//
// * FIBONACCI PIVOT POINTS * //
Once lastMonthBarIndex = 0
Once monthlyHigh = undefined
Once monthlyLow = undefined
Once monthlyPivot = undefined
Once monthlyR1 = undefined
Once monthlyS1 = undefined
Once monthlyR2 = undefined
Once monthlyS2 = undefined
Once monthlyR3 = undefined
Once monthlyS3 = undefined

If Month<>Month[1] then

  duration = BarIndex - lastMonthBarIndex

  IF duration <= 0 THEN
    duration = 1
  ENDIF

  monthlyHigh = Highest[duration](High)[1]
  monthlyLow = Lowest[duration](Low)[1]
  lastMonthBarIndex = BarIndex
   
  monthlyPivot = (monthlyHigh + monthlyLow + Close[1]) / 3

  // FIBONACCI SUPPORTS
  monthlyS1 = monthlyPivot - .382 * (monthlyHigh - monthlyLow)
  monthlyS2 = monthlyPivot - .618 * (monthlyHigh - monthlyLow)
  monthlyS3 = monthlyPivot -  1 * (monthlyHigh - monthlyLow)

Endif

//conditionPivotFibo = close =< monthlyS2
conditionPivotFibo = close =< monthlyS3

//------------------------------------------------------//
// *** ENTRY OPENING **//
IF conditionVolatility AND conditionPivotFibo THEN
  SIGNAL = 1
ENDIF

RETURN SIGNAL AS "BUYTHEDIP"

Buy the dip strategy backtesting

The following chart shows the dip openings on the Dow Jones index:

buy the dip backtesting
buy the dip entries on the Dow Jones

Buy the dip strategy analysis

This purely technical buy-the-dip strategy works as expected. It gives buying signals when the market breaks a monthly pivot if the volatility is not excessive.

If you run the previous source code for a long period, you will see that the strategy opened up during the 2008 crash too soon. I seriously studied this problem with many trading strategies. I never find a technical indicator capable of predicting a market crash. Outside the corona crash that was particularly violent, it is impossible to differentiate a dip from the starting of a market crash. That is why I integrated the macroeconomic analysis into my strategy.

IV. Building a position during a dip

I use this buy-the-dip strategy like a signal system. I start to build a position in a dip only if the macroeconomic and technical are met. I discretionary decide to take the buying signal or not. Sometimes I leave a bit of time before opening an entry. I will buy the dip if the market and macroeconomics are still valid. If the conditions deteriorate, I will stop to buy the market. That allows me to manage my risk exposure depending on the evolution of the situation. I set fixed the entry size, habitually between 500€ and 1000€. The maximum size of my position is around 10000€ by assets. I prefer to take time to build a position before completing a line. Depending on the asset, I open new entries each month or quarter.

I am building a position on the Euro stocks 50, the “Personal & Household Goods” and the “Food & Beverage” ETFs. I did not take all the signals sent by my system for some weeks. On the following chart, the blue line corresponds to my entry price on the Personal & Household Goods ETF:

Personal & Household Goods position construction

Buy the dip Summary

Buying the dip needs to be prudent. Here is the synthesis of the stages to buy the dip:

  1. Evaluating the severity of the bear market cause.
  2. Identify the main supports and wait for a decrease in market volatility.
  3. Focusing on main indexes or defensive assets.
  4. Building a position progressively, depending on the evolution of the market.

Building a profitable long-term portfolio

If you liked this post, I invite you to subscribe to my free long-term investment newsletter. Each month, you will receive the list of the best stocks to watch that my quantitative algorithm discovered on the New York Stock Exchange.

Leave a Reply