- 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.
- 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 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.
- Update cone input setting labels with "Upper" and "Lower" prefixes.
- 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!
- Fix: OriginAnchor and OriginAnchorSub switch update.
- Resolve error: "The study references too many candles in history (5001)."
- 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.
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.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.