faiyaz7283

Guage

faiyaz7283 已更新   
Library "Gauge"

The gauge library utilizes a gaugeParams object, encapsulating crucial parameters for gauge creation. Essential attributes include num (the measured value), min (the minimum value equating to 100% on the gauge's minimum scale), and max (the maximum value equating to 100% on the gauge's maximum scale). The size attribute (defaulting to 10) splits the scale into increments, each representing 100% divided by the specified size.

The num value dynamically shifts within the gauge based on its percentage move from the mathematical average between min and max. When num is below the average, the minimum portion of the scale activates, displaying the appropriate percentage based on the distance from the average to the minimum. The same principle applies when num exceeds the average. The 100% scale is reached at either end when num equals min or max.

The library offers full customization, allowing users to configure color schemes, labels, and titles. The gauge can be displayed either vertically (default) or horizontally. The colors employ a gradient, adapting based on the number's movement. Overall, the gauge library provides a flexible and comprehensive tool for visualizing and interpreting numerical values within a specified range.
版本注释:
v2 - Added 'keyAlign' to gaugeParams.
版本注释:
v3 - Added titleSize, keySize, and labelSize to gaugeParams.
版本注释:
v4 - Version updates for imported libraries
版本注释:
v5 - Versions updated for imported libraries.

Faiyaz Haider
Pine脚本库

本着真正的TradingView精神,作者将此Pine代码以开源脚本库发布,以便我们社区的其他Pine程序员可以重用它。向作者致敬!您可以私下或在其他开源出版物中使用此库,但在出版物中重用此代码受网站规则约束。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想使用这个脚本库吗?

复制以下行并将其粘贴到您的脚本中。