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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
𝟔 𝐘𝐄𝐀𝐑𝐒 𝐄𝐗𝐏𝐄𝐑𝐈𝐄𝐍𝐂𝐄𝐃 𝐓𝐑𝐀𝐃𝐄𝐑
💎 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
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
𝟔 𝐘𝐄𝐀𝐑𝐒 𝐄𝐗𝐏𝐄𝐑𝐈𝐄𝐍𝐂𝐄𝐃 𝐓𝐑𝐀𝐃𝐄𝐑
💎 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
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.