Inspired by Rob Smith (R.I.P), creator of TheStrat, this indicator visually represents price levels and movements across higher timeframes—ensuring full timeframe continuity in trading analysis. Below is a refined breakdown of its functionality and application.
How the Script Works
1. User Input Configuration
_timeframe_opt = input.timeframe("60", "Select Timeframe", options=["1", "3", "5", "15", "30", "60", "240", "D", "W", "M", "3M", "12M"])_
_show_hl = input.bool(false, "Show Hi/Lo")_- Customizable Timeframe: Users select from 1-minute to 12-month intervals (default: 60 minutes).
- Toggle High/Low Markers: Optional display of extreme price points on custom candles.
2. New Candle Detection
_is_new_candle = (time(timeframe_opt) != time(timeframe_opt)[1])_- Triggers when the timestamp of the current bar differs from the previous bar in the selected timeframe.
3. Variable Initialization
var float open_offset = na
var float high_offset = na
var float low_offset = na
var float close_offset = na
var line ln = na- Stores OHLC values relative to the custom timeframe’s open price.
4. Candle Value Calculation
if is_new_candle
open_offset := open
high_offset := high - open_offset
low_offset := low - open_offset
close_offset := close - open_offset
else
high_offset := math.max(high - open_offset, high_offset[1])
low_offset := math.min(low - open_offset, low_offset[1])
close_offset := close - open_offset- New Candle: Sets open price and calculates offsets.
- Same Candle: Updates high/low based on extreme values; adjusts close continuously.
5. Plotting Custom Candles
plotcandle(
open_offset - open_offset, high_offset, low_offset, close_offset,
title="Custom Timeframe Candle",
color=(close_offset >= 0 ? color.green : color.red),
bordercolor=color.black, wickcolor=color.black, editable=true
)- Colors: Green (bullish) or Red (bearish).
- Black borders/wicks for clarity.
6. High/Low Markers
plot(show_hl ? high_offset : na, color=color.black, style=plot.style_circles, linewidth=1)
plot(show_hl ? low_offset : na, color=color.black, style=plot.style_circles, linewidth=1)- Optional black circles mark extremes when enabled.
7. Dashed Line for Intraday Candles
if is_new_candle and timeframe.isintraday
ln := line.new(
bar_index, 2.22, bar_index, -2.22,
xloc=xloc.bar_index, color=color.new(color.black, 45),
style=line.style_dashed, width=1, extend=extend.both
)- Visual cue for new intraday candles.
8. Timeframe Display Table
var table tf_table = table.new(position = position.top_right, columns = 1, rows = 1, frame_color = color.gray, frame_width = 1, border_width = 1)
if is_new_candle
table.cell(
tf_table, 0, 0, "Timeframe: " + timeframe_opt,
text_color = color.white, text_halign = text.align_center
)- Dynamic table updates at the chart’s top-right corner.
How to Use It
- Lower-Timeframe Analysis: Ensure alignment with higher timeframes (e.g., hourly, daily, weekly).
- Indicator Placement: Add the indicator once per monitored timeframe (e.g., 4 instances for hourly/daily/weekly/monthly).
- Timeframe Selection: Customize each instance via the dropdown menu.
👉 Master MultiTimeframe Trading with this indicator for seamless market analysis.
FAQ
Q1: Why is timeframe continuity important?
A1: Aligning lower and higher timeframes reduces false signals and confirms trend strength.
Q2: Can I use this for crypto trading?
A2: Yes! The flexible timeframe options suit volatile assets like Bitcoin.
Q3: How do I avoid cluttering my chart?
A3: Limit to 3–4 key timeframes and adjust transparency/colors for clarity.
👉 Optimize Your Strategy Today—unlock higher timeframe insights effortlessly.