TJalam

Crypto Index Percentage Gain

TJalam Cập nhật   
This script calculates the percentage gain from the left-most visible candle for multiple cryptocurrency symbols and plots all of them on the chart.

Description:
The "Crypto Index Percentage Gain" indicator calculates the percentage gain from the left-most visible candle for a selection of cryptocurrency symbols. It utilizes the PineCoders VisibleChart library to access the high, low, close, and open prices of the visible chart range.

The user can customize the symbols to include in the calculation by enabling or disabling the corresponding input options. `_open` represents the open price, `_close` represents the close price, and `_gain` represents the calculated percentage gain. The formula used is (close - open) / open * 100 to calculate the percentage change between the open and close prices.

The calculated percentage gains for each symbol are plotted on the chart using different colors and line widths, providing an overview of the relative performance of the symbols.

Usage:

Add the "Crypto Index Percentage Gain" indicator to your trading view chart by searching it in indicator search bar or star it , it will show on your favourite indicators .
Configure the symbols and visibility options using the input parameters.
The indicator will calculate and display the percentage gain for each selected symbol based on the left-most visible candle on the chart.

Code Explanation:

The script imports the PineCoders VisibleChart library for accessing the visible chart range.
It defines a function `f_pcr()` to calculate the percentage gain for a given symbol.
Input options are provided to enable or disable symbols and set their visibility.
Symbols are defined using `input.symbol()` and the percentage gains are calculated using `request.security()`.
The calculated percentage gains for each symbol are plotted on the chart using different colors and line widths.

thanks to @PineCoders for VisibleChart library.
Phát hành các Ghi chú:
added comments

An enthusiast trader. I code my strategies in pine script.DM me for any Info.
Buy me coffee at:
paypal : tabrejalam786007@gmail.com
BTC : 15zY6PUsrV55UQvcfaSqk5hJexKZAwhpcK
TRC20: TPutH6FDYg6bJFF7xCjesp4n44qrMnizc7
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 đồ?