OPEN-SOURCE SCRIPT
업데이트됨

Visible Range

71
Overview This is a precision tool designed for quantitative traders and engineers who need exact control over their chart's visual scope. Unlike standard time calculations that fail in markets with trading breaks (like A-Shares, Futures, or Stocks), this indicator uses a loop-back mechanism to count the actual number of visible bars, ensuring your indicators (e.g., MA60, MA200) have sufficient sample data.

Why use this? If you use multi-timeframe layouts (e.g., Daily/Hourly/15s), it is critical to know exactly how much data is visible.

The Problem: In markets like the Chinese A-Share market (T+1, 4-hour trading day), calculating Time Range / Timeframe results in massive errors because it includes closed market hours (lunch breaks, nights, weekends).

The Solution: This script iterates through the visible range to count the true bar_index, providing 100% accurate data density metrics.

Key Features

True Bar Counting: Uses a for loop to count actual candles, ignoring market breaks. perfect for non-24/7 markets.

Integer Precision: Displays time ranges (Days, Hours, Mins, Secs) in clean integers. No messy decimals.

Compact UI: Displays information in a single line (e.g., View: 30 Days (120 Bars)), default to the Top Right corner to save screen space.

Fully Customizable: Adjustable position, text size, and colors to fit any dark/light theme.

Performance Optimized: Includes max_bars_back limits to prevent browser lag on deep history lookups.

Settings

Position: Default Top Right (can be moved to any corner).

Max Bar Count: Default 5000 (Safety limit for loop calculation).
릴리즈 노트
Minor bug fixes and enhancement

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.