TJalam

Crypto Index Percentage Gain

TJalam מעודכן   
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.
הערות שחרור:
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
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יכולים להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.

רוצה להשתמש בסקריפ זה בגרף?