# Probability Cones

A probability cone is an indicator that forecasts a statistical distribution from a set point in time into the future.

Features
• Forecast a Standard or Laplace distribution.
• Change the how many bars the cones will lookback and sample in their calculations.
• Set how many bars to forecast the cones.
• Let the cones follow price from a set number of bars back.
• Anchor the cones and they will not update from their last location.
• Show or hide any set of cones.
• Change the deviation used of any cone's upper or lower line.
• Change any line's color, style, or width.
• Change or toggle the fill colors between any two cone lines.

Basic Interpretations
• First, there is an assumption that the distribution starting from the cone's origin, based on the number of historical bars sampled, is likely to represent the distribution of future price.
• Price typically hangs around the mean.
• About 68% of price stays within the first deviation cones.
• About 95% of price stays within the second deviation cones.
• About 99.7% of price stays within the third deviation cones.
• When price is between the first and second deviation cones, there is a higher probability for a reversal.
• However, strong momentum while above or below the first deviation can indicate a trend where price maintains itself past the first deviation. For this reason it's recommended to use a momentum indicator alongside the cones.
• There is no mean reversion assumption when price deviates. Price can continue to stay deviated.
• It's recommended that the cones are placed at the beginning of calendar periods. Like the month, week, or day.
• Be mindful when using the cones on various timeframes. As the lookback setting, which selects the number of bars back to load from the cone's origin, will load the number of bars back based on the current timeframe.

Second Deviation Strategy
How to react when price goes beyond the second deviation is contingent on your trading position.
• If you are holding a losing trade and price has moved past the second deviation, it could be time to stop trading and exit.
• If you are holding a winning trade and price has moved past the second deviation, it would be best to look at exit strategies to capitalize on the outperformance.
• If price has moved beyond the second deviation and you hold no position, then do not open any new trades.
Notes de version:
• Update cone input setting labels with "Upper" and "Lower" prefixes.
Notes de version:
• Add Anchor Type input. Select between placing the origin based on bars or a date selection.
• New Select Date to Place Cones input. When Anchor Type is set to Select Date, the input will anchor and start the cone's origin from a selected date.
• Add @RicardoSantos to Acknowledgements for Date Select feature contribution. Thank you!
Notes de version:
• Fix: OriginAnchor and OriginAnchorSub switch update.
Notes de version: Recommended update! Remove and readd the indicator to your charts.
• Resolve error: "The study references too many candles in history (5001)."
Notes de version: New cone anchor feature and quality-of-life inputs/tooltips update.
• Add "Higher Timeframe" to Anchor Type input. Anchor the cones to the beginning of a higher timeframe automatically.
• Add "Anchor Offset" input. Only effects the Higher Timeframe Anchor Type. Set to 1 by default. Offsets the cones to the right or left of the anchor position. Left is a positive number, right is negative.
• Change "Anchor Cones to Bars Back" input to "Lock Cones to Anchor Type". Tooltip reflects change.
• Update "Distribution" input tooltip.
• Update "Bar Forecast" input tooltip. Gives instructions on how to get forecasts past 70 bars.
• Add "Enable Fills" input tooltip.
• Update the Mean Settings section input layout.
What is the purpose of off-setting the Higher Timeframe anchor from its original anchor point?
When forecasting a period it is helpful to make the desired anchor point of the cone itself out of sample. This is especially noticeable using the Higher Timeframe Anchor Type. If the cones are anchored to the first candle of a period, and that candle is highly volatile, then that volatile candle will significantly alter the cones in spread and direction. It is arguably safer, at least certainly a more consistent practice for interpretations, to offset the cones so that they're not in sample of the desired forecast period.

Joe Baus
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?