TJalam

Crypto Index Percentage Gain

TJalam Atualizado   
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.
Notas de Lançamento:
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
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?