The TradingViewLegend is a custom NinjaTrader indicator that creates an interactive, TradingView-style chart legend overlay displaying all active indicators on your chart. This sophisticated tool features a collapsible panel that can be positioned in any corner of the chart, showing real-time indicator values, market status (open/closed), and providing interactive controls for each indicator including visibility toggles (eye icon), settings access (gear icon), and removal buttons (X icon). The legend automatically adjusts its width based on content, supports custom styling options for colors and fonts, and includes a right-click context menu for additional controls, making it an essential tool for traders who want quick access to manage multiple indicators without cluttering their charts.
Several known issues affect the indicator’s functionality: the visibility toggle feature has problems with shaded areas (regions) created by indicators like Draw.Region(), which don’t hide properly on the first attempt – users must press F5 to refresh the chart for these elements to hide correctly. Additionally, compatibility issues exist with certain indicators that may produce errors when attempting to interact with them through the legend, particularly those with complex drawing objects or non-standard implementations. The indicator also has occasional rendering glitches where text may overlap or buttons may not respond on the first click, requiring a chart refresh to restore proper functionality. These limitations stem from the complex interaction between the legend overlay and NinjaTrader’s native indicator rendering system, particularly when dealing with custom drawing objects and real-time updates.
Sharing this in the hopes that NT8 adds this feature to the next update. I love NT8, but the fact that this isn’t standard is a significant limitation of the platform.
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.