OPEN-SOURCE SCRIPT
[TehThomas] - Displacement Candles

Overview:
This PineScript is designed to detect and visualize significant price movements, called displacements, on a trading chart. It's particularly useful for traders who want to identify potential trend changes or strong market sentiment quickly.
How the Script Works
User Input:
The script allows users to set a custom threshold for displacement detection and choose colors for bullish and bearish movements.
Displacement Detection Function:
Pine Script®
This function calculates the percentage change between the current and previous price.
If the change exceeds the set threshold, it's considered a displacement.
Bullish and Bearish Detection:
Pine Script®
Identifies whether the displacement is bullish (price increase) or bearish (price decrease).
Candle Coloring:
Pine Script®
Changes the color of candles based on the detected displacement type.
Usefulness and Applications:
This script is particularly handy for traders who want to cut through market noise and focus on significant price movements. It's versatile enough to be used across different trading strategies and can be a valuable addition to a trader's technical analysis toolkit.
It's a very easy script and not alot to mention. If you see any improvements please let me know.
This PineScript is designed to detect and visualize significant price movements, called displacements, on a trading chart. It's particularly useful for traders who want to identify potential trend changes or strong market sentiment quickly.
How the Script Works
User Input:
The script allows users to set a custom threshold for displacement detection and choose colors for bullish and bearish movements.
Displacement Detection Function:
isDisplacement(series, threshold) =>
percentage_change = math.abs(series - series[1]) / series[1] * 100
percentage_change > threshold
This function calculates the percentage change between the current and previous price.
If the change exceeds the set threshold, it's considered a displacement.
Bullish and Bearish Detection:
bullish_displacement = isDisplacement(close, threshold) and close > close[1]
bearish_displacement = isDisplacement(close, threshold) and close < close[1]
Identifies whether the displacement is bullish (price increase) or bearish (price decrease).
Candle Coloring:
barcolor(bullish_displacement ? bullish_color : bearish_displacement ? bearish_color : na)
Changes the color of candles based on the detected displacement type.
Usefulness and Applications:
- Trend Identification: Helps in quickly spotting potential trend changes or continuations.
- Volatility Analysis: Provides a visual representation of market volatility.
- Entry and Exit Signals: Can be used to identify potential entry or exit points for trades.
- Market Sentiment: Offers insights into the strength of bullish or bearish sentiment.
- Customizable Sensitivity: The adjustable threshold allows traders to fine-tune the indicator based on the asset's typical volatility.
- Visual Clarity: By changing candle colors, it provides a clear, at-a-glance view of significant price movements.
- Complementary Tool: Can be used alongside other technical indicators for confirmation of signals.
- Multiple Timeframe Analysis: Applicable across different timeframes to suit various trading styles (day trading, swing trading, etc.).
- Educational Purpose: Helps new traders understand and visualize significant price movements in the market.
- Backtesting: Can be incorporated into strategy backtests to assess its effectiveness in different market conditions.
This script is particularly handy for traders who want to cut through market noise and focus on significant price movements. It's versatile enough to be used across different trading strategies and can be a valuable addition to a trader's technical analysis toolkit.
It's a very easy script and not alot to mention. If you see any improvements please let me know.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
𝟔 𝐘𝐄𝐀𝐑𝐒 𝐄𝐗𝐏𝐄𝐑𝐈𝐄𝐍𝐂𝐄𝐃 𝐓𝐑𝐀𝐃𝐄𝐑
💎 Free Signals
t.me/codeandcandle
✅ Best Crypto Propfirm 5% discount
bit.ly/Hyrotrader
🎁 Free trading Discord community
bit.ly/TehThomas
💎 Free Signals
t.me/codeandcandle
✅ Best Crypto Propfirm 5% discount
bit.ly/Hyrotrader
🎁 Free trading Discord community
bit.ly/TehThomas
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
𝟔 𝐘𝐄𝐀𝐑𝐒 𝐄𝐗𝐏𝐄𝐑𝐈𝐄𝐍𝐂𝐄𝐃 𝐓𝐑𝐀𝐃𝐄𝐑
💎 Free Signals
t.me/codeandcandle
✅ Best Crypto Propfirm 5% discount
bit.ly/Hyrotrader
🎁 Free trading Discord community
bit.ly/TehThomas
💎 Free Signals
t.me/codeandcandle
✅ Best Crypto Propfirm 5% discount
bit.ly/Hyrotrader
🎁 Free trading Discord community
bit.ly/TehThomas
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。