
Beacon Indicator by NinjaTrader Live
Overview
The Beacon indicator is a dynamic support and resistance indicator that uses Bollinger Bands to identify key price levels and divides the Bollinger range into percentage-based zones. The indicator features intelligent line visibility that adapts based on price action.
Core Calculation Logic
Support and Resistance Detection
- Peak Detection: The indicator identifies pivot highs in the upper Bollinger Band
- When BB.Upper[1] > BB.Upper[2] AND BB.Upper[1] > BB.Upper[0], a minor peak is detected
- If this peak exceeds the previous major peak, it becomes the new resistance level
- Valley Detection: The indicator identifies pivot lows in the lower Bollinger Band
- When BB.Lower[1] < BB.Lower[2] AND BB.Lower[1] < BB.Lower[0], a minor valley is detected
- If this valley is lower than the previous major valley, it becomes the new support level
- Level Reset Logic: When a new major peak/valley is found:
- New Peak: Support resets to the lowest Bollinger Band value in the lookback period
- New Valley: Resistance resets to the highest Bollinger Band value in the lookback period
Line 50 Calculation and Changes
The 50 line represents the midpoint between support and resistance:
line50 = bbSupport + (bbResistance - bbSupport) * 0.5
When Line 50 Changes:
- Line 50 changes whenever either support or resistance levels are updated
- When line 50 changes from its previous value, ALL lines become visible and BeaconDir resets to 0
- This ensures traders see the new range structure immediately
Percentage Lines
The indicator divides the support-resistance range into three zones:
- 30 Line: bbSupport + range * 0.3 (30% from support)
- 50 Line: bbSupport + range * 0.5 (midpoint)
- 70 Line: bbSupport + range * 0.7 (70% from support)
Input Parameters
Parameter | Type | Range | Default | Description |
Bollinger Band Length | Integer | 1-55 | 20 | The period used for Bollinger Band calculation. Determines the lookback window for identifying peaks and valleys |
Bollinger Band Std Dev | Double | 0.25-10 | 3.0 | Standard deviation multiplier for Bollinger Bands. Higher values create wider bands and potentially wider support/resistance ranges |
Show All Lines | Boolean | true/false | false | When enabled, all lines remain visible regardless of price action or state |
Plot Descriptions
Plot | Color | Style | Description |
Resistance Level | Red | Dot | Upper boundary based on Bollinger Band peaks |
Support Level | Blue | Dot | Lower boundary based on Bollinger Band valleys |
70 Line | Red | Dot | Upper percentage level (70% from support) |
50 Line | Yellow | Dot | Midpoint between support and resistance |
30 Line | Blue | Dot | Lower percentage level (30% from support) |
Visibility Rules
- Initial State Reset
- When line 50 changes value, all lines become visible
- BeaconDir resets to 0
- Establishing Direction (BeaconDir = 0)
- If price breaks below 30 line: Hides 70 line and Resistance
- If price breaks above 70 line: Hides 30 line and Support
- Sets BeaconDir = 1
- Active Trading State (BeaconDir = 1)
- If price crosses 50 line (from either direction): Resets to show all lines
- If price exceeds Resistance: Hides Resistance line
- If price falls below Support: Hides Support line
- Line Removal Summary
- 30 Line: Hidden when price breaks above 70 line (bullish bias)
- 70 Line: Hidden when price breaks below 30 line (bearish bias)
- Support: Hidden when price breaks below it OR when establishing bullish bias
- Resistance: Hidden when price breaks above it OR when establishing bearish bias
Override Option
When "Show All Lines" is enabled, all visibility rules are bypassed, and all five lines remain visible at all times.
Disclosure
Futures trading and strategy trading involves substantial risk and the potential for loss of capital. The performance results of a trading strategy developed on the NinjaTrader platform may not be indicative of future real-time trading performance. Sample strategies and indicators provided by NinjaTrader, LLC are designed to teach strategy trading and development concepts. All NinjaScript code contained herein is provided by NinjaTrader, LLC and is for educational and demonstrational purposes only. You alone are responsible for the trading decisions that you make. You can find additional disclosure information on the NinjaTrader.com website.
Created By | NTEducationTeam |
NinjaTrader Version | 8 |
File Size | 7.4 KB |
Create Date | 06/13/2025 |
# of Downloads | 18 |
Importing to NinjaTrader 8 is Easy!
To import your 3rd party app or add-on to NinjaTrader, simply follow these 3 steps:
- Download the app or add-on file to your desktop
- From the NinjaTrader Control Center window, select the menu Tools > Import > NinjaScript Add-On…
- Select the downloaded file from your desktop
Questions?
Visit the NinjaScript File Sharing discussion in the NinjaTrader user forum to interact with fellow traders and the NinjaTrader support team.