Benefit from the bullish acceleration

The stock you have scrutinized for months has just broken a high. You had hesitated, expecting an entry point, and now it’s too late. But is it really too late to buy? The highest breakout is certainly the most simple and profitable signal you should know. It will help you benefit from the bullish acceleration.

In this post, I will discuss the highest breakout strategy. I will present the code of an indicator and backtests, allowing the automatization of this strategy on Prorealtime. You will learn how to set up the highest breakout strategy for stocks, ETFs, and indexes.

Highest Breakout Strategy Prorealtime

What is the highest breakout?

The highest breakout happens when the price closes above its highest. The highest breakout strategy consists of buying the market when the price breaks at its highest. This strategy is simple, but there are some subtilities. It is necessary to distinguish between the historical highest and the last highest.

Historical highest

The historical highest represents the highest price of an asset since its initial public offering. A historical highest breakout is rare on a cycle asset but frequent on a growth share.

The following picture shows the historical highest of the S&P 500 since its creation:

Historical highest

Latest highest

The latest highest corresponds to the highest price in a period, which can be a hundred candles or 52 weeks.

The following picture shows the latest highest of the S&P 500 on 100 candles:

Highest

What highest to choose in a breakout strategy?

You will use the latest highest to build the highest breakout strategy. You will need to determine the calculation period to detect the highest breakout. Habitually, the best periods are 50, 100, and 200 candles.

Highest breakout indicator

I will present you with an indicator that detects the highest breakouts on any asset in any time unit. It will return a buying signal when the price breaks up the highest of a determined period.

Code of highest breakout detection

You can run this indicator’s source code on the Prorealtime platform. It will display a green arrow when the price breaks up the highest of a 100-candle period:

// Highest breakout calculation periode
HighBreakoutLength = 100

// Highest breakout detection
isHighBreakout = close > highest[HighBreakoutLength][1]

// Highest breakout drawing
IF isHighBreakout THEN
  DRAWARROW(barindex-1, close) COLOURED(0, 255, 0, 255)
ENDIF

RETURN highest[HighBreakoutLength] as "Highest", lowest[LowBreakoutLength] as "Lowest"

Example of highest breakout detections

Here are examples of 100-candle highest breakouts on the S&P500 in the weekly timeframe:

Highest Breakout Detection

Backtest of the highest breakout strategy

Now, I will backtest the highest breakout strategy using the ProOrder interface provided by the Prorealtime platform. I will implement the indicator in a backtest to automatize the buying and selling orders.

Code of the highest breakout backtest

The following code will open a long entry each time the price breaks up the highest on a period of 50 candles. The system will open positions for a value of 10000€, place a stop order at 10%, and a target at 20%:

// * Highest Breakout Strategy
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
stoplossPercent = 10
targetPercent = 20

// Highest Breakout Signal
highestPeriod = 50
HighestBreakout = close > highest[highestPeriod][1]

IF NOT LongOnMarket AND HighestBreakout THEN
BUY numberOfContracts CONTRACTS AT MARKET
  SET STOP %LOSS stoplossPercent
  SET TARGET %PROFIT targetPercent
ENDIF

Result of the highest breakout backtest

Here is the result of the highest breakout backtest run on the S&P500 in the daily timeframe. This strategy made 42 665€ with a success rate of 58%. The drawdown is low regarding the runup.

highest breakout backtest

Enhancement of the highest breakout strategy

The highest breakout strategy performs well, but you can improve it. Several ways allow trading strategy enhancement. In the case of a breakout strategy, the main areas for improvement are the signal validation, the fundamental trend, and the volume increase.

Breakout validation

Validating the breakout of a highest, range, or another figure is an excellent way to eliminate false signals. A breakout is validated when the candle following the breakout closes in the same direction. A bullish breakout is validated if the next candle closes above the breaking candle. In this case, the buying signal is confirmed.

The following picture shows a validated highest breakout:

Highest Breakout Validation

The following source code checks the highest breakout validation:

// Validated Highest Breakout Signal
highestPeriod = 50
HighestBreakout = close[1] > highest[highestPeriod][2] AND close > close[1]

Trend filter

It is essential to follow the trend to improve your trading performance. Buying a bull market or selling a bear market will significantly increase your success rate. Implementing a trend filter can eliminate long entry openings in a bear market.

The following picture shows a linear regression line reflecting the trend:

Trend filter

The following source code will check the trend on 100 candles is bullish:

// Trend filter
trend = LinearRegressionSlope[100](close) > 0

Volume increase

The increase in volume during a breakout expresses a consensus about the signal’s validity. Substantial volumes associated with a bullish breakout indicate that numerous traders think the price will rise. Ensuring the volume increases during a breakout is an excellent way to validate the signal.

The following picture shows an increase in volume occurring with the highest breakout:

Volume increase

The following source code will check the volume increases on the last five candles:

// Volume filter
volumeIncreases = LinearRegressionSlope[5](Volume) > 0

Code of the improved highest breakout strategy

The following source code implements the three enhancing filters I presented. The strategy will open long entries after a validated highest breakout in an uptrend with strong volumes:

// * Highest Breakout Strategy with a Trend and Volume Filter
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
stoplossPercent = 10
targetPercent =  20

// Validated Highest Breakout Signal
highestPeriod = 50
HighestBreakout = close[1] > highest[highestPeriod][2] AND close > close[1]

// Trend filter
trend = LinearRegressionSlope[100](close) > 0

// Volume filter
volumeIncreases = LinearRegressionSlope[5](Volume) > 0

Filters = trend and volumeIncreases

IF NOT LongOnMarket AND HighestBreakout AND Filters THEN
BUY numberOfContracts CONTRACTS AT MARKET
  SET STOP %LOSS stoplossPercent
  SET TARGET %PROFIT targetPercent
ENDIF

Backtest of the improved highest breakout strategy

Here is the improved highest breakout strategy run on four assets: SP500, Nasdaq, Dax40, and Bitcoin.

S&P 500

Here is the result of the improved highest breakout strategy, run on the SPDR S&P 500 ETF in the daily timeframe:

SP500 highest breakout strategy

Nasdaq

Here is the result of the improved highest breakout strategy, run on the SPDR Technology Select Sector ETF in the daily timeframe:

Nasdaq highest breakout strategy

Dax 40

Here is the result of the improved highest breakout strategy, run on the Dax 40 in the 15-minute timeframe:

Dax 40 highest breakout strategy

Bitcoin

Here is the result of the improved highest breakout strategy, run on Bitcoin in the 15-minute timeframe:

Bitcoin highest breakout strategy

Apple

Here is the result of the improved highest breakout strategy, run on the Apple stock in the daily timeframe. Note I positioned the target at 50% and the stop loss at 20%:

Higest Breakout AAPL

Microsoft

Here is the result of the improved highest breakout strategy, run on the Microsoft stock in the daily timeframe. Note I positioned the target at 50% and the stop loss at 20%:

Higest Breakout MSFT

Highest breakout strategy summary