Biên tập viên chọn
OPEN-SOURCE SCRIPT

Timeframe Loop

13 185
The Timeframe Loop publication aims to visualize intrabar price progression in a new, different way.
ảnh chụp nhanh


🔶 CONCEPTS and USAGE

I got inspiration from the Pressure/Volume loop, which is used in Mechanical Ventilation with Critical Care patients to visualize pressure/volume evolution during inhalation/exhalation.
ảnh chụp nhanh

The main idea is that intrabar prices are visualized by a loop, going to the right during the first half and returning to the left towards its closing point. Here, the main chart timeframe (CTF) is 4 hours, and we see the movements of eight 30-minute lower timeframe (LTF) periods, highlighted by four yellow dots/lines (first 2 hours -> "Right") and four blue dots/lines (last 2 hours <- "Left"):
ảnh chụp nhanh

🔹 BTF

If "Show Lowest TF" is enabled, the LTF is split into another lower TF (BTF - "Base TF"); in this case, the 30-minute LTF is split into 10 parts of 3 minutes (BTF):
ảnh chụp nhanh

Enabling "Loop Lowest TF" will enable the BTF to react similarly to the largest loop; from halfway, it will return to its startpoint:
ảnh chụp nhanh

Here is a more detailed example:
ảnh chụp nhanh

🔹 Mini-Candles

The included option "Mini-Candles" will bring even more detail, showing the LTF as Japanese candlesticks with user-defined colors and adjustable body width; in this example, the mini-candles associated with the first half (yellow lines/dots) are green/red, while blue/fuchsia in the second half (blue lines/dots):


CTF 10 minutes, LTF 1 minute, BTF 5 seconds
ảnh chụp nhanh
One can see the detailed intrabar price progression in one glance.


CTF 5 minutes, LTF 1 minute, BTF 5 seconds
ảnh chụp nhanh

If the LTF/BTF ratio, divided by two, results in a non-integer number, the right side will be a vertical line instead of just a turning point. In that case, the smaller, most right blue loop will be situated at the right of that line.
  • 10 minutes / 1 minute = 10 -> 10 / 2 =    5 parts
  •    5 minutes / 1 minute =   5 ->   5 / 2 = 2.5 parts



🔶 SETTINGS

🔹 Timeframes
  • Lower Timeframe 1
  • Lower Timeframe 2


No need to worry about the order of both timeframes; BTF will be the lowest TF of the 2, LTF the highest; both have to be lower than the main chart TF (CTF); otherwise, it will result in the error: "`Lower Timeframes` should be lower than current chart timeframe".

ảnh chụp nhanh
The ratio LTF / BTF should be equal or higher than 2; otherwise, this error will show: "`Lower Timeframe` should minimally be twice the `Base (smallest) Timeframe`"

Lastly, the ratio CTF / BTF should be lower than 500; otherwise, this error will pop up: "`Current Chart timeframe` / `Lower Timeframe` should be less than 500."

I have tried to capture runtime errors as best I could. If one should be triggered (red exclamation mark next to the title), it is best to increase the lowest TF.

🔹 Options
  • Show Lowest TF: Show BTF progression.
  • Loop Lowest TF: Enabling will let the BTF line return halfway.
  • Show Mini-Candles
  • Show Steps


"Show Steps" can be useful to see how the script works, where the location of the current price is compared against the position of the left (L) and right (R) labels:
ảnh chụp nhanh

🔹 Style
ảnh chụp nhanh

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.