PINE LIBRARY

formattingUtilities

已更新
Library "formattingUtilities"

toPercentageString(x, decimals)
  : Converts a decimal number into a string formatted as percentage.
  Parameters:
    x (float): (simple float): Float number to be converted
    decimals (int): (simple int): Number of decimals to apply
  Returns: : Returns a string with x as percentage.

toFactorString(x, decimals)
  : Converts a decimal number into a string formatted as Factor.
  Parameters:
    x (float): (simple float): Float number to be converted
    decimals (int): (simple int): Number of decimals to apply
  Returns: : Returns a string with x as a Factor.

toCurrencyString(x, decimals)
  : Converts a decimal number into a string formatted as currency.
  Parameters:
    x (float): (simple float): Float number to be converted
    decimals (int): (simple int): Number of decimals to apply
  Returns: : Returns a string with x as currency.

toNumberString(x, decimals)
  : Converts a decimal number into a string formatted as decimal.
  Parameters:
    x (float): (simple float): Float number to be converted
    decimals (int): (simple int): Number of decimals to apply
  Returns: : Returns a string with x as a decimal.

colorByAboveBelow(x, reference, above, below, equal)
  : Returns a different color if the reference is above, below or equal to x.
  Parameters:
    x (float): (simple float): The number that will be tested, above, below or equal.
    reference (float): (simple float): The reference for for determining if x is above, below or equal.
    above (color)
    below (color)
    equal (color)
  Returns: : The color returned if above, below or equal.
版本注释
v2

Added:
colorMap()
  : Returns a map with different colors
  Returns: : Returns a map with multiple colors
版本注释
v3
版本注释
v4

Added:
formatsMap()
  : Creates a map with multiple formats for different uses.
  Returns: : Returns a formatsMap which is a map with multiple formats.
版本注释
v5
版本注释
v6
版本注释
v7
版本注释
v8
版本注释
v9
版本注释
v10
版本注释
v11
formatting
AlgoTrader_Pro

Pine脚本库

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

免责声明