p2pasta

Price DEFI Categories against BTC & ETH

p2pasta 업데이트됨   
/* Work in progress. The indicator is not finished. *\

The indicator shows the pricing of 3 DEFI categories against 2 possible baselines, BTC and ETH.

To do:
* Make a simple array in the source code to enter and remove new projects to the category. -> Maybe can also make it so that the source code does not have to be altered (projects can be added through input etc.)
* Adjust weightings depending on project data but this is not as important since weightings are being priced in by the market.
* Try to find a way to update input to string instead of booleans. As of currently, I could not seem to use input strings into plot functions because of an error.
* and more. Leave some feedback, that would be highly appreciated!
릴리즈 노트:
V1.1

- Updated the title -> "DEFI against Majors" -> D.A.M 1.1
- Added subcategory 'Derivatives'
- Changed transparency (from 20 to 80) of the plot backgrounds
릴리즈 노트:
- Changed baseline default value to Ethereum
- Changed boolean input for baseline to choice between strings.
릴리즈 노트:
V1.2

- Updated user input. Added boolean (true/false) to give the option to disable certain categories.
- Added comments to the source code so it is easier to read for people that want to mess around with it.
릴리즈 노트:
V1.3

* Eco system mode
- Added most of the big DEFI projects from two spaces: Ethereum & Solana. I used the maps that can be found here: (https:// pentacle .ai)
- I chose to leave some out of the equation due to maturity of the chart; I can't really average a chart on 30 day lookback if it has just been listed 14 days capiche?

ETH DEFI SUPPORTED PROJECTS:
Compound, Harvest Finance, Yearn Finance, 0x, Aave, Badger DAO, Alpha Finance, Bancor Network, Curve Finance, Maker, Numeraire

SOL DEFI SUPPORTED PROJECTS:
Bonfida, Serum, Hxro


* Changed user input:
- Added seperators for convencience of sight/vision. Still debating whether I should leave or delete again.
- Added lookback (in days) as a reference point. Minimum value of 1 and maximum value of 30 days. On a lookback of 1 it is quite hard to react but you can spot new trends faster. Choose 30 lookback for a good overview of the last month. I advise to use inbetween 7 and 14 for optimal results.
- Added eco system mode which can be toggled on or off. Default value is off. What do you think? Should the indicator work from categories as a base or ecosystem as a base?
릴리즈 노트:
- Added new category 'liquid staking' containing $LDO, $FXS, $ANKR, $RPL & $STAFI
- Added $ALPACA to the 'lending/borrowing' category
- Added $GMX and $DYDX to the 'derivatives' category
- Added gradient coloring for better aesthetics :-)
- Fixed a bug where you could not disable single categories
릴리즈 노트:
  • Added a new function: In the newer version of the code, a new function named getSecurityData was added. This function takes two parameters, base and quote, and calculates the percentage change of the security (price) based on the provided parameters. This function is used to abstract away some of the repetitive code in the category calculations.
  • Modified baseline calculation: The baseline calculation was simplified by using the getSecurityData function for ETH against BTC and USD pairs. Previously, the calculation was done manually using security calls, but now it's done more efficiently with the new function.
  • Modified category calculations: The category calculations (e.g., Oracles, DEX, Lending/Borrowing, Derivatives, Liquid Staking) were updated to use the getSecurityData function instead of the previous security calls. This change reduced code duplication and made it easier to add new projects.
  • Refactored color handling in f_c_gradientAdvDec: The function f_c_gradientAdvDec now uses a new function f_colorNew to handle color and transparency calculations. This simplifies the code and improves readability.
  • Removed Eco mode related code: The older version of the code had an "Eco mode" option for showing the ecosystem plots. However, in the newer version, the "Eco mode" related code was removed, and only the ETH DEFI and SOL DEFI ecosystem calculations remain.
  • Updated plot visibility condition: The visibility conditions for each plot have been updated. In the newer version, plots are shown only when the corresponding category is enabled and the category_mode is also true. This allows users to toggle the visibility of individual categories.
  • Updated version number: The version number in the code has been updated to VERSION 1.5.
  • Updated comments and notes: The comments and notes were updated to reflect the changes and provide better clarity and instructions.

Overall, the newer version of the code introduces more abstraction through functions and improves the flexibility and maintainability of the indicator by allowing easier addition of new projects and better control over category visibility.
릴리즈 노트:
  • Upgraded to Pine Script v5: The script now takes advantage of the latest Pine Script features.
  • Baseline Security: The previous version only allowed for ETH or BTC as baseline securities. Now you can input any security as a baseline for comparison.
  • User-Selectable Categories: Enhanced user control over which categories to display. You can now toggle individual categories like Oracles, DEX, Lending/Borrowing, Derivatives, and Liquid Staking.

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?