Previous Candle Range indicatorPrimary Functions:
Display the high, low, open, and close of the previous candle from a selected timeframe
Show a 50% level (midpoint between high and low)
Optionally show customizable percentage levels (e.g., 61.8% Fibonacci level)
Help identify:
Support and resistance zones
Breakout levels
Potential reversal points
Stop-loss and take-profit placements
🎨 Visual Design
Line Color Style Width Description
-----------------------------------------------------------------------------------------------------------------
High White (25% opacity) Dashed 1 Previous candle's highest price
Low White (25% opacity) Dashed 1 Previous candle's lowest price
Open Green (#13ab22) Solid 2 Previous candle's opening price (bullish candle)
Close Green (#13ab22) Solid 2 Previous candle's closing price (bullish candle)
Open Red (#af5c4c) Solid 2 Previous candle's opening price (bearish candle)
Close Red (#af5c4c) Solid 2 Previous candle's closing price (bearish candle)
50% Level Blue (#0d6aec) Dashed 1 Midpoint between high and low
Custom Level Gre (#b0d837) Dashed 1 User-defined percentage level
-----------------------------------------------------------------------------------------------------------------
How It Works
1. Timeframe Logic
The indicator detects if the current chart timeframe is smaller than the selected reference timeframe
Lines are only displayed when the current chart is at or below the selected timeframe
Example: If "D" is selected, lines show on charts ≤ Daily timeframe
2. Candle Data Retrieval
Uses request.security() to fetch OHLC data from the selected timeframe
Always gets the previous candle (not the current)
Updates when a new candle forms on the selected timeframe
4. Line Management
Lines extend 19 bars forward from their start point
Old lines are deleted when a new candle forms
Lines are hidden when chart timeframe > selected timeframe
Best Practices
✅ When to Use
Multi-timeframe analysis: Identify key levels from higher timeframes
Swing trading: Use daily/weekly levels for swing positions
Day trading: Use 1H/4H levels for intraday trades
Scalping: Use 5m/15m levels for quick trades
⚠️ Important Notes
Lines extend 19 bars forward - adjust if needed
Weekly and Monthly timeframes ignore weekends for accuracy
The indicator works best with clear price action
Combine with other indicators for confirmation
The combination of the 50% level and customizable percentage levels makes it suitable for various trading styles, from scalping to swing trading.
Created by: Awab_Hassan
Indicator




