WinkyTwinki

Hi-Lo World

This script plots the highs/lows from multiple timeframes onto the same chart to help you spot the prevailing long-term, medium-term and short-term trends.

List of timeframes included:
  • Year
  • Month
  • Week
  • Day
  • 4 Hour
  • Hour
You can select which timeframes to plot by editing the inputs on the Format Object dialog.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

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.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
study("Hi-Lo World", overlay=true)

y_color = red       // Color used to plot yearly highs/lows
m_color = purple    // Color used to plot monthly highs/lows
w_color = blue      // Color used to plot weekly highs/lows
d_color = aqua      // Color used to plot daily highs/lows
h4_color = green    // Color used to plot 4-hourly highs/lows
h_color = lime      // Color used to plot hourly highs/lows

plot_y = input(title="Year", type=bool, defval=true)        // plot yearly highs/lows
plot_m = input(title="Month", type=bool, defval=true)       // plot monthly highs/lows
plot_w = input(title="Week", type=bool, defval=true)        // plot weekly highs/lows
plot_d = input(title="Day", type=bool, defval=true)         // plot daily highs/lows
plot_h4 = input(title="4 Hour", type=bool, defval=false)    // plot 4-hourly highs/lows
plot_h = input(title="Hour", type=bool, defval=false)       // plot hourly highs/lows

// Get highs/lows
high_y = security(tickerid, "12M", high)
low_y = security(tickerid, "12M", low)
high_m = security(tickerid, "M", high)
low_m = security(tickerid, "M", low)
high_w = security(tickerid, "W", high)
low_w = security(tickerid, "W", low)
high_d = security(tickerid, "D", high)
low_d = security(tickerid, "D", low)
high_h4 = security(tickerid, "240", high)
low_h4 = security(tickerid, "240", low)
high_h = security(tickerid, "60", high)
low_h = security(tickerid, "60", low)

// Plot highs/lows
high_y_plot = plot(plot_y ? high_y : na, color=y_color, linewidth=4)
low_y_plot = plot(plot_y ? low_y : na, color=y_color, linewidth=4)
high_m_plot = plot(plot_m ? high_m : na, color=m_color, linewidth=3)
low_m_plot = plot(plot_m ? low_m : na, color=m_color, linewidth=3)
high_w_plot = plot(plot_w ? high_w : na, color=w_color, linewidth=2)
low_w_plot = plot(plot_w ? low_w : na, color=w_color, linewidth=2)
high_d_plot = plot(plot_d ? high_d : na, color=d_color)
low_d_plot = plot(plot_d ? low_d : na, color=d_color)
high_h4_plot = plot(plot_h4 ? high_h4 : na, color=h4_color)
low_h4_plot = plot(plot_h4 ? low_h4 : na, color=h4_color)
high_h_plot = plot(plot_h ? high_h : na, color=h_color)
low_h_plot = plot(plot_h ? low_h : na, color=h_color)
fill(high_y_plot, low_y_plot, color=y_color)
fill(high_m_plot, low_m_plot, color=m_color)
fill(high_w_plot, low_w_plot, color=w_color)
fill(high_d_plot, low_d_plot, color=d_color)
fill(high_h4_plot, low_h4_plot, color=h4_color)
fill(high_h_plot, low_h_plot, color=h_color)