OPEN-SOURCE SCRIPT
Güncellendi HalfTrend Long/Short Signal Engine [BigBeluga]

HalfTrend Long/Short Signal Engine [BigBeluga] is an institutional-grade trend tracking toolkit built for TradingView. It filters out minor market noise to deliver definitive, non-repainting long and short entry signals based on asset volatility and structural swing pivots.
Instead of displaying standard lag-heavy moving averages, this system uses an adaptive directional engine to lock onto clean trend lines and overlay automatic risk-management matrices directly onto your chart. It calculates real-time win rates and scans multiple assets simultaneously so you can trade with systematic statistical backup.
🔵 MAIN ENGINE & MARKET CALCULATION MECHANICS
1. Pure HalfTrend Price Filter Matrix
2. Automated Risk Matrix & Multi-Asset Scanner
Pine Script®
🔵 WHY IT IS USEFUL
🔵 HOW TO USE THE SYSTEM
Streamline your trade execution, manage portfolio risk systematically, and screen multiple sectors at once with the HalfTrend Long/Short Signal Engine workspace.
Instead of displaying standard lag-heavy moving averages, this system uses an adaptive directional engine to lock onto clean trend lines and overlay automatic risk-management matrices directly onto your chart. It calculates real-time win rates and scans multiple assets simultaneously so you can trade with systematic statistical backup.
🔵 MAIN ENGINE & MARKET CALCULATION MECHANICS
1. Pure HalfTrend Price Filter Matrix
- Swing Pivot Trackers: The engine scans local high and low data using an adjustable lookback filter (Amplitude) to find actual structural swing points rather than temporary price spikes.
- Volatility-Adjusted Bands: It establishes dynamic outer channel boundaries using a 100-period Average True Range calculation divided by two (ATR/2). The total channel width automatically scales using your custom risk buffer parameter (Channel Deviation).
- Regime Flip Architecture: The system locks into a Bullish Regime when price crosses above structural highs, shifting the main tracking baseline to Green. When price slips below structural lows, it forces a Bearish Regime and changes the tracking baseline to Red.
2. Automated Risk Matrix & Multi-Asset Scanner
- Algorithmic Trade Execution: The moment a new trend regime initializes, the engine projects a strict trade tracking matrix showcasing an entry line, a clear stop-loss boundary, and three tiered profit targets (TP1, TP2, and TP3).
- Live Performance Dashboard: An integrated on-screen table calculates real-time historical metrics, tracking active wins, losses, current target risk-to-reward ratios ($1:3$), and overall system win rate percentages.
- Screener Security Matrix: The background engine leverages real-time multi-asset queries to stream concurrent trend statuses for five separate configurable symbols directly into a secondary visual dashboard.
🔵 WHY IT IS USEFUL
- Elimination of Market Noise: Standard moving averages constantly whip back and forth during consolidations. The HalfTrend calculation filters out minor intraday fluctuations, only shifting when a definitive structural high or low is broken.
- Mathematical Execution Blueprint: It takes the emotion out of trade management. Every signal comes equipped with dynamic, visually mapped stop losses and a $1:3$ risk-reward profit map that fills with real-time gradient paths.
- Macro Market Synchronicity: The multi-asset side-panel allows you to keep an eye on major market drivers (like BTC, ETH, Gold, or major FX pairs) simultaneously, ensuring your trades line up with broader institutional market direction.
🔵 HOW TO USE THE SYSTEM
- Trading Long Breakouts: When the system transitions from a bearish regime into a bullish regime, a GreenLONG label will print beneath the breakout candle. Execute your position at the white entry line, setting your dynamic stop-loss boundary inside the red risk gradient.
- Trading Short Breakdowns: Monitor the system for a shift into a bearish regime, indicated by a RedSHORT label appearing above the asset price. Execute short orders relative to the entry line and utilize the upper red gradient zone to map your protective risk ceiling.
- Managing Exits and Targets: Take partial profits sequentially as the asset price moves through the Green target lines (TP1, TP2, and TP3). If a sudden trend reversal prints an opposing signal before your final targets are satisfied, the script automatically triggers a reversal exit rule to preserve accumulated gains.
Streamline your trade execution, manage portfolio risk systematically, and screen multiple sectors at once with the HalfTrend Long/Short Signal Engine workspace.
Sürüm Notları
- Added Channel Deviation color Transparency input at the style sectionSürüm Notları
Update: Accurate Win-Rate & Breakeven LogicThis update fixes the dashboard's performance metrics by eliminating double-counting and introducing breakeven logic. Because the Take Profit 1 (TP1) and Stop Loss (SL) are set at an equal distance, a trade that hits TP1 but later reverses to hit the SL results in a net-zero profit.
The script now correctly identifies these "scratch trades." Instead of logging them as both a win and a loss (which inflates the data), the update removes them from the counters entirely. This ensures your win rate reflects true, realized profitability rather than vanity metrics.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
🔵Gain access to our powerful tools : bigbeluga.com/tv
🔵Join our free discord for updates : discord.com/invite/FuW63RKgdc
All scripts & content provided by BigBeluga are for informational & educational purposes only.
🔵Join our free discord for updates : discord.com/invite/FuW63RKgdc
All scripts & content provided by BigBeluga are for informational & educational purposes only.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
🔵Gain access to our powerful tools : bigbeluga.com/tv
🔵Join our free discord for updates : discord.com/invite/FuW63RKgdc
All scripts & content provided by BigBeluga are for informational & educational purposes only.
🔵Join our free discord for updates : discord.com/invite/FuW63RKgdc
All scripts & content provided by BigBeluga are for informational & educational purposes only.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
