Electrified

SessionInfo

Electrified Actualizado   
Library "SessionInfo"
Utility functions for session specific information like the bar index of the session.

inSession(spec) Returns true if the current bar is in the session specification.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
  Returns: True if the current is in session; otherwise false.

minutesToLen(minutes, multiple) Converts the number of minutes to a length to be used with indicators.
  Parameters:
    minutes: The number of minutes.
    multiple: The length multiplier.
  Returns: math.ceil(minutes * multiple / timeframe.multiplier)

bar(spec, res) Returns the intraday bar index. May not always map directly to time as a bars can be skipped.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = "1440").
  Returns: The integer index of the bar of the session.

isFirstBar(spec, res) Returns true if the current bar is the first one of the session.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = "1440").
  Returns: True if the current bar is the first one of the session.

wasLastBar(spec, res) Returns Returns true if the previous bar was the last of the session.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = "1440").
  Returns: True if was the last bar of the session.
Notas de prensa:
v2

Added:
maxBars(spec, res) Returns maximum (usual) number of bars per day.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = "1440").
  Returns: The max (usual) number of bars per day.

maxMinutes(spec, res) Returns maximum (usual) number of minutes per day.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = "1440").
  Returns: The max (usual) number of minutes per day.

daysToBars(spec, res) Returns the number of bars equal to the number of days based upon usual session length.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = "1440").
  Returns: The number of bars representing the number of days.
Notas de prensa:
v3

Added:
isIn(spec) Returns true if the current bar is in the session specification.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
  Returns: True if the current is in session; otherwise false.

isBefore(spec, res) Returns true if the bar is before before the session (default = regular) opens.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = timeframe.period).
  Returns: True if before the session.

isAfter(spec, res) Returns true if the bar is before before the session (default = regular) opens.
  Parameters:
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = timeframe.period).
  Returns: True if before the session.

firstBarOfDay(daysBack, spec, res) Returns the number bars in the past to find the first bar of the session of a given day.
  Parameters:
    daysBack: The number of days in the past to count the bars.
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = "1440").
  Returns: The number bars in the past to find the first bar of the session of a given day.

Removed:
inSession(spec) Returns true if the current bar is in the session specification.
Notas de prensa:
v4

Added:
lastBarOfDay(daysBack, spec, res) Returns the number bars in the past to find the last bar of the session of a given day.
  Parameters:
    daysBack: The number of days in the past to count the bars.
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = "1440").
  Returns: The number bars in the past to find the last bar of the session of a given day.
Notas de prensa:
v5
Notas de prensa:
v6
Fixed bug in array initialization.
Notas de prensa:
v7
Fixed bug in firstBarOfDay
Notas de prensa:
v8 Improved timeframe detection and response.
Notas de prensa:
v9 param name change and improved runtime error messages

Updated:
firstBarOfDay(daysPrior, spec, res) Returns the number bars in the past to find the first bar of the session of a given day.
  Parameters:
    daysPrior: The number of days in the past to count the bars.
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = '1440').
  Returns: The number bars in the past to find the first bar of the session of a given day.

lastBarOfDay(daysPrior, spec, res) Returns the number bars in the past to find the last bar of the session of a given day.
  Parameters:
    daysPrior: The number of days in the past to count the bars.
    spec: session.regular (default), session.extended or other time spec.
    res: The resolution (default = '1440').
  Returns: The number bars in the past to find the last bar of the session of a given day.
Notas de prensa:
v10 Corrected issue with .maxBars()
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.