PROTECTED SOURCE SCRIPT

MultiTimeframe Candles for Full Time Frame Continuity Analysis

تم تحديثه
In honor of Rob Smith (R.I.P), the creator of TheStrat, I decided to try to figure out how to make an indicator that graphically shows you the price levels and movements on higher timeframes.

The goal is to have full timeframe continuity with TheStrat. Ideally when you are analyzing the lower time, you want it to be in continuity with the higher time frames.

How to Use It:

All you have to do is put on the indicator the number of times you desire.

So if you want the hourly, the daily, the weekly, and the monthly, then you have to just put on the indicator 4 times--once for each timeframe.

Then you go into each one you put on the chart and go to the drop down menu where you choose the timeframe you want displayed.

In the future, I'll do a video to show you exactly how that works, but I think you guys can figure it out.
ملاحظات الأخبار
Found a goof.

12M is the Year.

60M is the 5-Year Chart
ملاحظات الأخبار
Well, I goofed on the code.

There is no 5-year (60 month) chart on TV.

I eliminated it as a dropdown choice.

Sorry for that error.

Thanks.
ملاحظات الأخبار
In honor of Rob Smith (R.I.P), the creator of TheStrat, I decided to try to figure out how to make an indicator that graphically shows you the price levels and movements on higher timeframes.

The goal of TheStrat is to trade with full timeframe continuity.

How the Script Works

1. User Input Configuration
Code:
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")


The timeframe_opt input lets users pick a custom timeframe, such as 1 minute or 1 month. The default is 60 minutes. The show_hl option allows users to toggle the visibility of high/low markers on the custom candles.

2. Detecting a New Candle for the Selected Timeframe
Code:
is_new_candle = (time(timeframe_opt) != time(timeframe_opt)[1])

A new candle in the selected timeframe is detected when the timestamp for the current bar in the chosen timeframe differs from the previous bar.

3. Variable Initialization for Open, High, Low, and Close Offsets
pinescript
Copy code
var float open_offset = na
var float high_offset = na
var float low_offset = na
var float close_offset = na
var line ln = na
These variables store the custom candle's open, high, low, and close values, relative to the current custom timeframe.
4. Calculating Candle Values
Code:
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


When a new candle starts:

open_offset is set to the current bar's open price.
high_offset, low_offset, and close_offset are calculated relative to this open price.
For subsequent bars within the same candle:

The high and low offsets are updated based on the highest high and lowest low.
The close offset is recalculated continuously.

5. Plotting the Custom Timeframe Candle
Code
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
)

A custom candle is plotted using plotcandle().
Color: If the close price is greater than or equal to the open price, the candle is green; otherwise, it is red.
Borders and wicks are colored black.

6. Plotting High and Low Markers
Code:
l ? 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)


If the show_hl option is enabled, the high and low markers are plotted as black circles.

7. Drawing Dashed Line for New Candles on Intraday Timeframes
Code:
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
)

For new intraday candles, a dashed line is drawn at the start of the candle to visually mark it on the chart.

8. Displaying the Selected Timeframe in a Table
pinescript
Code:
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
)

A table is created at the top-right corner of the chart, displaying the selected timeframe. The table updates only when a new candle starts.

How to Use It:

Ideally when you are analyzing the lower time, you want it to be in continuity with the higher time frames.

All you have to do is put the indicator on the number of timeframes you want to monitor.

So if you want the hourly, the daily, the weekly, and the monthly, then you have to just put on the indicator 4 times--once for each timeframe.

Then you go into each one you put on the chart and go to the drop-down menu where you choose the timeframe you want displayed.
ملاحظات الأخبار
In tribute to Rob Smith (R.I.P.), creator of TheStrat, I developed a tool designed to make it easier for traders to visually monitor price levels and movements across multiple timeframes. The primary goal of this tool is to align with TheStrat's focus on trading with full timeframe continuity—the concept of ensuring that trends and price action on smaller timeframes remain in sync with higher ones.

This indicator offers an intuitive way to keep an eye on multiple timeframes by plotting meaningful visual markers directly on your chart.

---

Key Features and Benefits

1. Custom Timeframe Selection:
- Choose from an array of timeframes ranging from minutes to months, giving you complete flexibility in your market analysis.
- Quickly switch between different timeframes (e.g., 1-hour, daily, or weekly) to track continuity across varying levels.

2. Visual Representation of High/Low Markers:
- Enable or disable the display of high and low points to better understand price ranges and reversals.
- These markers allow you to spot key turning points on different timeframes, facilitating better entry or exit decisions.

3. Enhanced Candle Visualization:
- Displays candles with precise price levels aligned to your chosen timeframe, giving a clearer view of price trends.
- Candles are color-coded to reflect price movement: green when the close is higher than the open and red when it’s lower, helping you quickly identify bullish or bearish conditions.

4. **Table Display for Quick Reference:**
- A table positioned on your chart shows the selected timeframe, ensuring you always know which period you’re monitoring.
- This feature is particularly helpful when working with multiple indicators across several timeframes.

---

How to Use This Indicator

Monitor Multiple Timeframes Simultaneously:
- Place the indicator on your chart multiple times—once for each timeframe you want to follow (e.g., hourly, daily, weekly, monthly).
- For each instance, select the desired timeframe from the drop-down menu to ensure that you’re tracking the right period.

Achieve Timeframe Continuity:
- By aligning lower timeframes with higher ones, this tool helps you confirm trends, detect reversals, and avoid trades that go against the broader market movement.

---

Why This Indicator is Valuable for Traders

This tool simplifies a core principle of TheStrat—full timeframe continuity—by visually representing price action across multiple timeframes in a clear and actionable way. It removes the guesswork and helps traders stay in sync with market momentum, regardless of the timeframe they are analyzing.

This solution offers flexibility, clarity, and speed, enabling traders to quickly grasp critical movements and improve decision-making. Whether you are a scalper focusing on intraday moves or a swing trader watching weekly trends, this tool empowers you to maintain alignment with the overall market structure.

In essence, it brings the power of TheStrat to your fingertips by offering precise and easy-to-read visual aids, allowing you to seamlessly apply Rob Smith’s philosophy to your trading.
ملاحظات الأخبار
In tribute to Rob Smith (R.I.P.), creator of TheStrat, I developed a tool designed to make it easier for traders to visually monitor price levels and movements across multiple timeframes. The primary goal of this tool is to align with TheStrat's focus on trading with full timeframe continuity—the concept of ensuring that trends and price action on smaller timeframes remain in sync with higher ones.

This indicator offers an intuitive way to keep an eye on multiple timeframes by plotting meaningful visual markers directly on your chart.

---

Key Features and Benefits

1. Custom Timeframe Selection:
- Choose from an array of timeframes ranging from minutes to months, giving you complete flexibility in your market analysis.
- Quickly switch between different timeframes (e.g., 1-hour, daily, or weekly) to track continuity across varying levels.

2. Visual Representation of High/Low Markers:
- Enable or disable the display of high and low points to better understand price ranges and reversals.
- These markers allow you to spot key turning points on different timeframes, facilitating better entry or exit decisions.

3. Enhanced Candle Visualization:
- Displays candles with precise price levels aligned to your chosen timeframe, giving a clearer view of price trends.
- Candles are color-coded to reflect price movement: green when the close is higher than the open and red when it’s lower, helping you quickly identify bullish or bearish conditions.

4. Table Display for Quick Reference:
- A table positioned on your chart shows the selected timeframe, ensuring you always know which period you’re monitoring.
- This feature is particularly helpful when working with multiple indicators across several timeframes.

---

How to Use This Indicator

Monitor Multiple Timeframes Simultaneously:
- Place the indicator on your chart multiple times—once for each timeframe you want to follow (e.g., hourly, daily, weekly, monthly).
- For each instance, select the desired timeframe from the drop-down menu to ensure that you’re tracking the right period.

Achieve Timeframe Continuity:
- By aligning lower timeframes with higher ones, this tool helps you confirm trends, detect reversals, and avoid trades that go against the broader market movement.

---

Why This Indicator is Valuable for Traders

This tool simplifies a core principle of TheStrat—full timeframe continuity—by visually representing price action across multiple timeframes in a clear and actionable way. It removes the guesswork and helps traders stay in sync with market momentum, regardless of the timeframe they are analyzing.

This solution offers flexibility, clarity, and speed, enabling traders to quickly grasp critical movements and improve decision-making. Whether you are a scalper focusing on intraday moves or a swing trader watching weekly trends, this tool empowers you to maintain alignment with the overall market structure.

In essence, it brings the power of TheStrat to your fingertips by offering precise and easy-to-read visual aids, allowing you to seamlessly apply Rob Smith’s philosophy to your trading.
Candlestick analysisChart patternsCyclesftfcmtfcmulti-timeframe-analysisstratthestrattimeframecontinuity

نص برمجي محمي

تم نشر هذا النص البرمجي بمصدر غير مفتوح ويمكنك استخدامه بحرية. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني. لا يمكنك مشاهدة أو تعديل كود المصدر الخاص به.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟

إخلاء المسؤولية