Editors' picks
OPEN-SOURCE SCRIPT

Breakout Probability (Expo)

Updated
Overview

Breakout Probability is a valuable indicator that calculates the probability of a new high or low and displays it as a level with its percentage. The probability of a new high and low is backtested, and the results are shown in a table— a simple way to understand the next candle's likelihood of a new high or low. In addition, the indicator displays an additional four levels above and under the candle with the probability of hitting these levels.

The indicator helps traders to understand the likelihood of the next candle's direction, which can be used to set your trading bias.


Calculations

The algorithm calculates all the green and red candles separately depending on whether the previous candle was red or green and assigns scores if one or more lines were reached. The algorithm then calculates how many candles reached those levels in history and displays it as a percentage value on each line.


Example

In this example, the previous candlestick was green; we can see that a new high has been hit 72.82% of the time and the low only 28.29%. In this case, a new high was made.

snapshot



Settings

  • Percentage Step
    The space between the levels can be adjusted with a percentage step. 1% means that each level is located 1% above/under the previous one.

  • Disable 0.00% values
    If a level got a 0% likelihood of being hit, the level is not displayed as default. Enable the option if you want to see all levels regardless of their values.

  • Number of Lines
    Set the number of levels you want to display.

  • Show Statistic Panel
    Enable this option if you want to display the backtest statistics for that a new high or low is made. (Only if the first levels have been reached or not)




Any Alert function call

An alert is sent on candle open, and you can select what should be included in the alert. You can enable the following options:

  • Ticker ID
  • Bias
  • Probability percentage
  • The first level high and low price




How to use

  • This indicator is a perfect tool for anyone that wants to understand the probability of a breakout and the likelihood that set levels are hit.

  • The indicator can be used for setting a stop loss based on where the price is most likely not to reach.

  • The indicator can help traders to set their bias based on probability. For example, look at the daily or a higher timeframe to get your trading bias, then go to a lower timeframe and look for setups in that direction.




-----------------
Disclaimer

The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.

All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.

My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Release Notes
Improvements!

  • The visualization of the probability levels is enhanced with a background color.
backtestbiasbreakoutbreakoutstrategyCandlestick analysischartanalysisforecastingprobabilitystatisticsstrategywinrate

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer