OPEN-SOURCE SCRIPT

20-34 Dual Dot Alerts Only

Pine Script that uses dual Donchian Channels (20-period and 34-period) and places tiny blue dots above candles when the highest price touches any upper Donchian Channel and below candles when the lowest price touches any lower Donchian Channel, without displaying the channels themselves, you can use the code.

### Explanation of the Code:
1. **Indicator Declaration**: The script is named "Dual Donchian Channels Dots Only" and overlays on the price chart.
2. **Input for Lengths**: Users can set lengths for two Donchian Channels (20 and 34 periods).
3. **Calculating Bands**: The upper and lower bands are calculated using `ta.highest` and `ta.lowest` functions over the specified periods.
4. **Touch Conditions**:
- `upperTouch`: Checks if the highest price of the current candle touches either of the upper bands.
- `lowerTouch`: Checks if the lowest price of the current candle touches either of the lower bands.
5. **Plotting Dots**:
- A tiny blue dot is plotted above bars where `upperTouch` is true.
- A tiny blue dot is plotted below bars where `lowerTouch` is true.

### How to Use:
1. Copy this script into TradingView’s Pine Script editor.
2. Save it and add it to your chart.
3. You will see tiny blue dots appear above or below candles based on whether they touch any of the upper or lower Donchian Bands.

This setup provides a clear visual indication of price interactions with both Donchian Channels while keeping the chart uncluttered by hiding the channel lines.
Bands and Channels

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


Learning smoothly & executing confidently.

免责声明