gain indicator

Key features of the indicator include:
Dynamic Percentage Levels: The indicator automatically calculates and displays horizontal lines corresponding to predefined percentage levels, both positive and negative, ranging from -5% to +5%.
Previous Candle Close: The percentage calculations are anchored to the closing price of the previous candle, providing a consistent reference point for analysis.
Clear Visual Representation: The percentage levels are represented by horizontal lines extending to the right edge of the chart. The lines are color-coded (green for positive percentages, red for negative percentages) for easy interpretation.
Customizable Appearance: The indicator offers customization options, allowing users to adjust the line thickness and the display of percentage labels.
No Labels by Default: The indicator is designed to display only the horizontal lines by default, without any percentage labels, providing a clean and uncluttered chart view.
In summary, the "Percentage Ruler" indicator is a valuable tool for traders seeking a straightforward way to visualize percentage-based price levels relative to the previous candle's close. It aids in identifying potential support and resistance zones and estimating possible price movements based on historical data.
The horizontal lines of the percentage ruler have been converted into rays extending infinitely to the right.
Updated the line.new() function to use extend.right, ensuring that the lines no longer have a fixed endpoint.
Improved label positioning to align with the new ray structure.
Enhanced readability and chart clarity by preventing unnecessary overlapping of previous lines.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Để truy cập nhanh vào biểu đồ, hãy thêm tập lệnh này vào mục yêu thích của bạn — tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Để truy cập nhanh vào biểu đồ, hãy thêm tập lệnh này vào mục yêu thích của bạn — tìm hiểu thêm tại đây.