RicardoSantos

BinaryDecimalConversion

RicardoSantos Wizard Actualizado   
Library "BinaryDecimalConversion"
Converts decimal to and from binary.

to_binary(number) convert integer to binary string
Parameters:
  • number: int, value to convert.
Returns: string

to_decimal(binary) Converts a binary in a string to decimal.
Parameters:
  • binary: string, binary number in a string.
Returns: int
Notas de prensa:
v2 Binary shift methods, they are a bit demanding tho :s .

Added:
leftshift_logical(x, n)
  Shift the bits of an integer to the left.
  Parameters:
    x: int . Value to shift.
    n: int . Number of zeros to append to x.
  Returns: int.
Notas de prensa:
v3 missed some exports..

Added:
rightshift_logical(x, n)
  Shift the bits of an integer to the right.
  Parameters:
    x: int . Value to shift.
    n: int . Number of bits to remove at the right of x.
  Returns: int.

leftshift_arithmetic(x, n)
  Shift the bits of an integer to the left.
  Parameters:
    x: int . Value to shift.
    n: int . Number of zeros to append to x.
  Returns: int.
leftshift_arithmetic () {
reference:
stackoverflow.com/qu...nary-shift-in-python

rightshift_arithmetic(x, n)
  Shift the bits of an integer to the right.
  Parameters:
    x: int . Value to shift.
    n: int . Number of bits to remove at the right of x.
  Returns: int.
Notas de prensa:
v4 correcting a greasy finger :P, /lastonehesaid..

Updated:
leftshift_arithmetic(x, n)
  Shift the bits of an integer to the left.
  Parameters:
    x: int . Value to shift.
    n: int . Number of zeros to append to x.
  Returns: int.
Biblioteca Pine

Siguiendo el verdadero espíritu de TradingView, el autor de este código de Pine lo ha publicado como biblioteca de código abierto, para que el resto de programadores de Pine de esta comunidad puedan volver a utilizarlo. ¡Un hurra por el autor! Puede utilizar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero debe ceñirse a lo establecido en las Normas internas.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar esta biblioteca?

Copie la siguiente línea y péguela en su script.