Artificall

Follow the trend with PRT Bands

Finding a reliable indicator to follow the trend is challenging. Numeros of them give the trend but not signals. If you know Prorealtime, you have undoubtedly heard about the PRT Bands indicator. Natively implemented in the platform, it has been specially developed to follow the trend.

In this post, I will show you how to use the PRT Bands indicator. I will backtest several trading strategies you can use in your trading.

PRT Bands Strategy

What is PRT Bands?

PRT Bands is a visual indicator that simplifies the detection and follow-up of bullish markets. It is only available from the ProRealTime platform. PRT Bands may help you identify trend reversals, follow rising trends, measure the intensity of a trend, and find potential entry and exit points. This indicator is initially designed for stocks with high bullish potential, but it is perfectly employable with indexes like the Nasdaq.

How does the PRT Bands indicator work?

PRT Bands incudes a set of four technical indicators. They will allow you to open long entries on any asset and time unit.

Here are the four PRT Bands indicators:

PRTBandsUp

The PRTBandsUp indicator returns the high band value. It works like a resistance:

PRTBandsUp

PRTBandsDown

The PRTBandsDown indicator returns the low band value. It works like a support:

PRTBandsDown

PRTBandsmediumterm

The PRTBandsmediumterm indicator returns the middle-term line. It indicates the middle-term trend:

PRTBandsmediumterm

PRTBandsShortTerm

The PRTBandsShortTerm indicator returns the short-term line. It indicates the short-term trend:

PRTBandsShortTerm

The PRT Bands’ signals

The PRT Bands indicator can help you detect buying signals in the market and provides several possibilities for opening a position: starting the trend, trend continuation, and trend reversal.

You can build three types of buying signals: band breakout, line crossing, and line reversal. I will present to you the four following signals:

  1. High band breakout
  2. Descending channel breakup
  3. Trend lines crossing
  4. Bullish trend restarting

High band breakout

The high band of PRT Bands works like a resistance. You can consider it as a key level in a breakout strategy. The following code will detect the breakouts of the high band. You can run it in the dedicated editor to the indicator coding of the Prorealtime platform:

TopPRTBandBreakout = close CROSSES OVER PRTBandsUp

RETURN TopPRTBandBreakout

Here is an example of a high-band breakout of the PRT Bands indicator:

PRTBandsUp Breakout

Descending channel breakup

The PRT Bands indicator allows for the detection of an uptrend beginning. A bull trend begins when the price breaks up the high band of a descending channel. Here is the code for detecting the start of an uptrend. It checks the breakout of the high band and the channel’s bearish trend:

LongCrossingCondition = close CROSSES OVER PRTBandsUp
BearishCanal = PRTBandsDown[1] < PRTBandsDown[0]

TopBandBreakout = LongCrossingCondition AND BearishCanal

Here is an example of an entry opening of a new uptrend beginning:

PRTBandsUp breakout in a descending channel

Trend lines crossing

The short and middle trend lines of PRT Bands work like moving averages. You can use their crossing as a buying signal. The following code detects the overcrossing of the middle trend line by the short trend line of the PRT Bands indicator:

PRTBandsCrossingLines = PRTBandsShortTerm CROSSES OVER PRTBandsMediumTerm  

RETURN PRTBandsCrossingLines

Here is an example of an overcrossing of the middle-term line by the short-term line of the PRT Bands indicator:

PRTBands Crossing Lines

Bullish trend restarting

The short trend line obtained by the PRTBandsShortTerm instruction follows the price movement to reduce the noise. Sometimes, price consolidations occur during a bullish trend. A bullish channel with a bearish short trend line will express this case. A short-term line becoming positive would indicate the restarting of the uptrend.

The following code will detect the restarting of the uptrend:

ShortTermRestarting = PRTBandsShortTerm[2] > PRTBandsShortTerm[1] AND PRTBandsShortTerm[1] < PRTBandsShortTerm[0]

RETURN ShortTermRestarting

Here is an example of a restarting uptrend entry given by the short-term line:

PRTBands short-term restarting

Backtests of PRT Bands strategies

Now, I will show you how to use the PRT Bands indicator to build trading strategies and present four backtests:

  1. Uptrend continuation strategy
  2. Bearish trend reversal strategy
  3. Trend lines crossing strategy
  4. Uptrend restarting strategy

Uptrend continuation strategy

The bullish breakouts of the high bands allow for buying the market. This strategy will help you benefit from the continuation of the uptrend.

Code of the backtest

The following code will open a long position each time the price breaks up the high band of the PRT Bands indicator:

// * PRT Bands Uptrend continuation strategy * //
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
targetPercent = 5
stoplossPercent = 2

// PRT Bands long Signal
TopPRTBandBreakout = close CROSSES OVER PRTBandsUp

// Long entry opening condition
IF NOT LongOnMarket AND TopPRTBandBreakout THEN
  BUY numberOfContracts CONTRACTS AT MARKET
  SET TARGET %PROFIT targetPercent
  SET STOP %LOSS stoplossPercent
ENDIF

Result of the backtest

Here is the result of this trend continuation strategy using PRT Bands run on the Nasdaq in the 4-hour time unit. The success rate of the strategy is few at 38%, and the drawdown is deep in the 2022 year:

PRTBands uptrend continuation strategy

Strategy enhancement

The breakout of a resistance is a good buying signal. However, it is essential to see volume increase. That means numerous traders share the same point of view. You can use the following instructions to filter the breakouts with volume increase:

volumeIncreases = LinearRegressionSlope[20](Volume) > 0

The following code will detect the break up of the high band of the indicator joined with a volume increase:

// * PRT Bands Uptrend continuation strategy with Volumes * //
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
targetPercent = 5
stoplossPercent = 2

// PRT Bands long Signal
TopPRTBandBreakout = close CROSSES OVER PRTBandsUp

volumeIncreases = LinearRegressionSlope[20](Volume) > 0 

// Long entry opening condition
IF NOT LongOnMarket AND TopPRTBandBreakout AND volumeIncreases THEN
  BUY numberOfContracts CONTRACTS AT MARKET
  SET TARGET %PROFIT targetPercent
  SET STOP %LOSS stoplossPercent
ENDIF

Result of the enhanced backtest

Here is the result of the enhanced backtest. The success rate is now 45%, and the drawdown is two times lower than previously:

PRTBands uptrend continuation strategy enhanced

Bearish trend reversal strategy

The PRT Bands indicator can detect a bearish trend reversal. The buying signal is obtained when the price breaks up the top band of a bearish channel.

Code of the backtest

The following code will open long entries at the beginning of a new uptrend:

// * PRT Bands Bearish trend reversal strategy * //
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
targetPercent = 5
stoplossPercent = 2

// PRT Bands long Signal
BearishCanal = PRTBandsDown[1] < PRTBandsDown[0]
TopPRTBandBreakout = close CROSSES OVER PRTBandsUp

StartingTrend = BearishCanal AND TopPRTBandBreakout

// Long entry opening condition
IF NOT LongOnMarket AND StartingTrend THEN
  BUY numberOfContracts CONTRACTS AT MARKET
  SET TARGET %PROFIT targetPercent
  SET STOP %LOSS stoplossPercent
ENDIF

Result of the backtest

Here is the result of the backtest run on the Nasdaq in the 4-hour time unit. This strategy is the most profitable we can do with the PRT Bands indicator. However, we can note the success rate is 45% and the drawdown during the 2022 year:

PRT Bands Bearish trend reversal strategy

Strategy enhancement

As this strategy is a breakout type, we can apply a volume increase filter to improve the performance. The following code will detect breakups of the top band associated with a volume increase:

// * PRT Bands Bearish trend reversal strategy with Volumes* //
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
targetPercent = 5
stoplossPercent = 2

// PRT Bands long Signal
BearishCanal = PRTBandsDown[1] < PRTBandsDown[0]
TopPRTBandBreakout = close CROSSES OVER PRTBandsUp

StartingTrend = BearishCanal AND TopPRTBandBreakout

volumeIncreases = LinearRegressionSlope[20](Volume) > 0

// Long entry opening condition
IF NOT LongOnMarket AND StartingTrend AND volumeIncreases THEN
  BUY numberOfContracts CONTRACTS AT MARKET
  SET TARGET %PROFIT targetPercent
  SET STOP %LOSS stoplossPercent
ENDIF

Result of the enhanced backtest

The success rate is now 51%, but the gain is felt from 15 000€ to 10 000€. However, the number of entries is twice lower, the drawdown is strongly reduced, and the 2022 year is positive. This enhanced strategy is less profitable but less volatile and most robust to the hard market phases:

PRT Bands Bearish trend reversal strategy Enhanced

Trend lines crossing strategy

The PRT Bands indicator provides two trend lines: short-term and middle-term lines. A buying signal occurs when the short-term line crosses over the middle-term line. This strategy works like a moving average crossing.

Code of the backtest

The following code will open long entries after the short-term line crosses over the middle-term line of the PRT Bands indicator:

// * PRT Bands Trend lines crossing strategy * //
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
targetPercent = 5
stoplossPercent = 2

// PRT Bands long Signal
PRTBandsCrossingLines = PRTBandsShortTerm CROSSES OVER PRTBandsMediumTerm

// Long entry opening condition
IF NOT LongOnMarket AND PRTBandsCrossingLines THEN
  BUY numberOfContracts CONTRACTS AT MARKET
  SET TARGET %PROFIT targetPercent
  SET STOP %LOSS stoplossPercent
ENDIF

Result of the backtest

Here is the result of the PRT Bands crossing trend lines. The strategy delivers a gain of 13 632€ with a success rate of 41%. There is a deep drawdown during the 2022 year:

PRTBands Trend lines crossing strategy

Strategy enhancement

I decided to add a trend filter to enhance this strategy. I added a condition checking the uptrend of the short-term line:

// * PRT Bands Trend lines crossing strategy with positive trend * //
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
targetPercent = 5
stoplossPercent = 2

// PRT Bands long Signal
PRTBandsCrossingLines = PRTBandsShortTerm CROSSES OVER PRTBandsMediumTerm

trend = PRTBandsShortTerm[1] < PRTBandsShortTerm[0]

// Long entry opening condition
IF NOT LongOnMarket AND PRTBandsCrossingLines AND trend THEN
  BUY numberOfContracts CONTRACTS AT MARKET
  SET TARGET %PROFIT targetPercent
  SET STOP %LOSS stoplossPercent
ENDIF

Result of the enhanced backtest

The result of this strategy enhancement is limited. Only two losing trades have been eliminated. The profit and success rate are a bit better, but the drawdown is unchanged:

PRTBands Trend lines crossing strategy Enhanced

Uptrend restarting strategy

The PRT Bands indicator can detect a trend restarting thanks to the direction of the short-term trend line. The short-term trend line becoming positive again gives a buying signal.

Code of the backtest

The following code will open long entries when the short-term trend line becomes positive:

// * PRT Bands Uptrend restarting strategy * //
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
targetPercent = 5
stoplossPercent = 2

// PRT Bands long Signal
ShortTermRestarting = PRTBandsShortTerm[2] > PRTBandsShortTerm[1] AND PRTBandsShortTerm[1] < PRTBandsShortTerm[0]

// Long entry opening condition
IF NOT LongOnMarket AND ShortTermRestarting THEN
  BUY numberOfContracts CONTRACTS AT MARKET
  SET TARGET %PROFIT targetPercent
  SET STOP %LOSS stoplossPercent
ENDIF

Result of the backtest

The performance of this strategy is poor. The return is 10 940€ with a success rate of 34%. The equity curve is volatile with a very deep drawdown:

PRTBands Uptrend restarting strategy

Strategy enhancement

To enhance this strategy, I will implement a trend restarting validation. The candle following the trend restarting must be green to validate the signal. In addition, I added a trend filter: the 100-candle trend must be positive to avoid false signals:

Trend restarting validation

The following code will open long entries if the trend restarting is validated and if the 100-candle trend is positive:

// * PRT Bands Uptrend validated restarting strategy * //
// Risk Management
capital = 10000
numberOfContracts = ROUND(capital/close, 2)
targetPercent = 5
stoplossPercent = 2

// PRT Bands long Signal
ShortTermRestarting = PRTBandsShortTerm[2] > PRTBandsShortTerm[1] AND PRTBandsShortTerm[1] < PRTBandsShortTerm[0]

// Long entry opening condition
IF NOT LongOnMarket AND ShortTermRestarting THEN
  BUY numberOfContracts CONTRACTS AT MARKET
  SET TARGET %PROFIT targetPercent
  SET STOP %LOSS stoplossPercent
ENDIF

Result of the enhanced backtest

Here is the result of the enhanced trend restarting strategy. The strategy delivers a gain of 13 000€ with a success rate of 42%. The drawdown is strongly reduced during the 2022 year:

PRTBands Uptrend restarting strategy enhanced

PRT Bands strategy summary

Additionnal ressources

Here are some resources about the PRT Bands indicator:

Topic on Prorealcode
https://www.prorealcode.com/topic/prt-bands-trend-following-prorealtime/

Documentation
https://www.prorealcode.com/documentation/prtbandsup/
https://www.prorealcode.com/documentation/prtbandsdown/
https://www.prorealcode.com/documentation/prtbandsshortterm/
https://www.prorealcode.com/documentation/prtbandsmediumterm

French documentation
https://www.prorealtime.com/fr/manuel-aide/prorealtime-bands

Seizing the best trading opportunities

The Range Breaker will help you seize the best trading opportunities! It detects range breakouts, which are often followed by strong price movements. Thanks to this indicator, you will never miss a breakout again.

Exit mobile version