TrendLines Breaker

TrendLines Breaker Documentation [EN]

The TrendLines Breaker indicator detects bullish and bearish breakouts of trendlines on the Prorealtime platform.

The indicator displays buy and short-sell signals on the price chart. It also displays price targets and stop-losses. You can configure the indicator to refine the results.

The TrendLines Breaker indicator user manual includes the following sections:

Installing the indicator

Before installing the TrendLines Breaker indicator, you will need to purchase a license or subscribe to the trial version. The indicator is available on the Prorealcode marketplace at this address:

https://market.prorealcode.com/product/trendline-break-indicator-screener

Installing the TrendLines Breaker indicator is quick and easy. Just follow the usual installation procedure described on this page:

https://market.prorealcode.com/how-to-install-my-product-in-prorealtime

Launching the indicator

After installing the license on your Prorealtime platform, the indicator will be available in the indicators & trading systems window in the “ProRealCode MarketPlace” section.

To access the indicators window, click on the “Price” icon located on the price chart window, then on “Add indicator…”:

TrendLines Breaker Indicator Adding

To access the indicator, refer to the “ProRealCode MarketPlace” section or type “TrendLines Breaker” in the search bar.

Click on the “TrendLines Breaker” indicator to display it on the price window:

TrendLines Breaker Indicator Selection

Indicator Configuration

The TrendLines Breaker indicator is fully configurable. You can choose the type of trendlines and signals, apply filters, set the price target level, and change the display.

Accessing the Control Panel

To access the indicator control panel, you need to click on the indicator tab located at the top of the price chart window and then click on “Configure“:

TrendLines Breaker Indicator Setting

The indicator configuration window will open and allow you to configure it according to your wishes:

TrendLines Breaker indicator Setting Window

Selecting trendlines

You can display bearish or bullish trendlines by checking the “Falling Lines” and “Rising Lines” boxes:

TrendLines Breaker Trend Lines Setting

Trendline length

You can set the length of the trendline construction with the “Line Length” parameter. You can also extend their length with the “Line Extension” parameter:

TrendLines Breaker Trend Lines Length Setting

Signal selection

The indicator detects four types of signals:

  1. Breakouts
  2. Validated breakouts
  3. Retests
  4. Validated retests

You can choose the type(s) of signals you want by checking the boxes of your choice:

TrendLines Breaker Signals Setting

Trend Filters

The indicator contains a trend filter that allows you to display the lines appearing in the trend or against the trend:

  • Click on the “in the Trend” checkbox to display the lines in the trend.
  • Click on the “Reversal” checkbox to display the lines against the trend.
TrendLines Breaker Trend Filter Setting

Volume Filter

You can filter the breakout signals if volumes accompany them. To do this, click on the “with Volumes” checkbox:

TrendLines Breaker Volume Filter Setting

Divergence Filter

You can filter the breakout signals if they occur in a divergence. To do this, click on the “with Divergence” checkbox:

TrendLines Breaker Divergence Filter Setting

Price Target and Safety Stop

The indicator automatically calculates the price targets and stop-loss levels based on the technical configuration.

  • You can display these levels by checking the “Take Profit” and “Stop-Loss” checkboxes.
  • You can adjust these levels with the “TP Level” and “SL Level” parameters.
TrendLines Breaker Take Profit Stop-Loss Setting

Display Configuration

The indicator allows you to configure the display of trend lines and price targets:

Display OptionsDefinitions
Falling Line ColorColor of falling trend lines
Rising Line ColorColor Color of rising trend lines
Line ThicknessThickness of trend lines
Font SizeSize of the font used to display targets and stoploss

Starting Year

You can determine the year from which the indicator will start looking for trend lines with the “Starting Year” checkbox:

TrendLines Breaker Divergence Starting Year Setting

Create a trading alert

The Prorealtime platform allows trading alert creations. You can use the TrendLines Breaker indicator to create alerts for bullish or bearish breakouts of trendlines.

Here are the steps you will need to follow to create an alert:

1. Configure the indicator

Before creating an alert, you must configure the TrendLines Breaker indicator. The Prorealtime platform will rely on your chosen configuration to send you alerts.

If you have defined trendlines with a length of fifty periods with the validation of breakouts and volumes, the platform will trigger alerts only for this configuration.

In this example, I will create an alert that will be triggered if the price breaks up the weekly descending trendline on the Adobe stock:

TrendLine Breakout Alert Stock Prorealtime

Note that I extended the length of the trendline to be sure to have a signal. Here is the indicator configuration for this alert:

TrendLine Breakout Alert Setting Prorealtime

2. Open the alerts window

To set up an alert, you must open the alerts window. To do this, you must right-click on the price chart and click on “Create a new alert“:

TrendLine Breakout Create Alert Prorealtime

3. Select the TrendLines Breaker indicator

You must select the TrendLines Breaker indicator so that the Prorealtime alert system uses the signals returned by this indicator:

Trendline Breakout Alert Indicator Selection

4. Set the values

The TrendLines Breaker indicator returns 1 when there is a bullish breakout and -1 when there is a bearish breakout. If you want to create an alert on bullish breakouts, you must choose the “equal” sign and set a value of “1“:

Trendline Breakout Alert Indicator Value Setting

5. Manage triggers

The trigger part allows you to choose the time frame of the alerts. In this example, the platform will send alerts once a day in case of a bullish breakout:

Trendline Breakout Indicator Alert Properties

Note: You can write a message describing the signal in the comment box.

6. Create the alert

After checking your alert settings, you must click on the “Create Alert” button:

Trendline Breakout Indicator Alert Creation

Backtesting a strategy

You can integrate the indicator into a backtest to test a configuration. To do this, you must use the “CALL” function:

myBreakout, myTakeProfit, myStopLoss = CALL "TrendLines Breaker"[1, 0, 5, 15, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 1, 2, 4, 2015](close)

Calling the indicator in a backtest

You must pass the indicator parameters to call the indicator in a backtest. I created a code example to help you integrate the indicator into a strategy. The variables’ names are the same as those of the indicator.

The following code will call the TrendLines Breaker indicator. It will open long positions after the bullish breakout of the bearish obliques:

//--------------------------------------------------------//
// *** TrendLines Breaker Backtest Example - S&P 500 4-hour *** //
//--------------------------------------------------------//
// Author: Vivien Schmitt
// Website: https://artificall.com
// Indicator: TrendLine Breaker
// Description: https://artificall.com/trendlines-breaker/
// Marketplace: https://market.prorealcode.com/product/trendline-break-indicator-screener/
//--------------------------------------------------------//

DEFPARAM CUMULATEORDERS = False
DEFPARAM PRELOADBARS = 1000

//--------------------------------------------------------//
// *** POSITION SIZE *** //
//--------------------------------------------------------//
// Capital to invest
ONCE CapitalToInvest = 10000
// Minimum number of contracts
ONCE NumberOfContractsMin = 1
// Position Size
NumberOfContracts = MAX(ROUND(CapitalToInvest / Close, 2), NumberOfContractsMin)

//--------------------------------------------------------//
// *** SETTING BLOCK *** //
//--------------------------------------------------------//
// Type of lines
ONCE FallingLines = 1
ONCE RisingLines = 0
// Length 
ONCE LineLength = 5
ONCE LineExtension = 15
// Signals
ONCE breakout = 1
ONCE ValidatedBreakout = 0
ONCE Retest = 0
ONCE ValidatedRetest = 0
// Trend filters
ONCE intheTrend = 0
ONCE Reversal = 0
// Strength filters
ONCE withVolumes = 0
ONCE withDivergence = 0
// Take profit
ONCE TakeProfit = 1
ONCE TPLevel = 2
// Stop-loss
ONCE StopLoss = 1
ONCE SLLevel = 1
// Display options
ONCE FallingColor = 0
ONCE RisingColor = 0
ONCE LineThickness = 0
ONCE FontSize = 0
// Starting year
ONCE StartingYear = 2010

myBreakout, myTakeProfit, myStopLoss = CALL "TrendLines Breaker"[FallingLines, RisingLines, LineLength, LineExtension, breakout, ValidatedBreakout, Retest, ValidatedRetest, intheTrend, Reversal, withVolumes, withDivergence, TakeProfit, TPLevel, StopLoss, SLLevel, FallingColor, RisingColor, LineThickness, FontSize, StartingYear](close)

// Conditions pour ouvrir une position acheteuse
IF NOT LongOnMarket AND myBreakout THEN
  // Target price
  Set Target Price myTakeProfit
  // Stop-Loss price
  Set Stop Price myStopLoss
  // Buying order
  BUY NumberOfContracts CONTRACTS AT MARKET
ENDIF

Backtest Result

Here is the result of the previous code running on the SPDR S&P 500 Trust ETF in the 4-hour time frame:

TrendLines Breaker backtest sp500 4-hour

TrendLines Breaker Screener

The TrendLines Breaker market scanner will allow you to find real-time trendline breakout opportunities. You can apply it to predefined or personal lists. It works with all the asset classes in all time frames.

Installing the screener

The screener associated with the indicator will be installed automatically with the indicator. You will find it in the ProScreener window of the Prorealtime platform.

To access the screener, you must proceed as follows:

1. Open the ProScreener window

    You can open the ProScreener window by clicking on “Display” then “ProScreener“, or by using the shortcut “Ctrl-E“:

    ProScreener Open Window

    2. Open the screener management window

      Click on the “Create or Modify a screener” wrench in the ProScreener window:

      ProScreener Window create modify screener

      3. Select the TrendLines Breaker screener

        Click on the “TrendLines Breaker Scan” screener located in the list of screeners:

        ProScreener Management Window Select Screener

        Screener Configuration

        The screener settings are the same as the indicator, except for the display options that are not useful for the scanner:

        TrendLines Breaker Screener Setting

        The screener is configured with the indicator’s default settings. However, you can configure it according to your needs.

        1. Selecting Trend Lines

          You can select either falling or rising trend lines by checking the “Falling Lines” and “Rising Lines” boxes:

          TrendLines Breaker Screener Setting Lines

          2. Length of trend lines

            You can define the construction length of trend lines with the “Length” parameter. You can also extend their length with the “Extension” parameter:

            TrendLines Breaker Screener Setting Line Length

            3. Signal Selection

            The indicator detects four types of signals:

            • Breakouts
            • Validated Breakouts
            • Retests
            • Validated Retests

            You can choose the type(s) of signals you want by checking the boxes of your choice:

            TrendLines Breaker Screener Setting Signals

            4. Trend Filters

            You can filter the appearance of obliques based on the trend:

            • Click on the “in the Trend” option to display the lines in the trend.
            • Click on the “Reversal” option to display the lines against the trend.
            TrendLines Breaker Screener Setting Trend Filter

            5. Volume Filter

              You can filter breakout signals only if volumes accompany them. To do this, click on the “with Volumes” option:

              TrendLines Breaker Screener Setting Volume

              6. Divergence Filter

                You can filter breakout signals only if they occur in a divergence. To do this, click on the “with Divergence” option:

                TrendLines Breaker Screener Setting Divergence

                You can now close the screener configuration window.

                Timeframe and asset list

                You can set the time unit and asset list on the “ProScreener Management” window.

                Choice of time unit

                You can choose the time unit in which the screener will search for opportunities:

                ProScreener Management Window Timeframe

                Select an asset list

                You must select a list on which you want to search for opportunities:

                ProScreener Management Window List

                Launch the screener

                You can now launch the screener by clicking on the “Run ProScreener” button:

                ProScreener Management Window Run

                Screener result

                The opportunities detected by the screener will appear in a list:

                TrendLine Break Scanner Prorealtime
                Share this Doc

                TrendLines Breaker Documentation [EN]

                Or copy link

                CONTENTS