PINE LIBRARY

offline_detection Library

imagen

Description:
Boolean and alert functions that check if the latest user-selected symbol 'sym' has started printing. Alerts trigger by bar close.

Usage:
Mainly for 24/7 crypto exchanges. If an exchange you have alerts on goes offline, the alerts will not trigger. The offline alert is an alert to alert you of that. It's best to create the alerts while on "CRYPTOCAP:TOTAL" because it has the least downtime. The exchange you want alerts on is controlled by the 'sym' parameter. The alerts need to be enabled yourself.

Limitations:
The alerts may be triggered by no volume in a bar, so it's best to set it on timeframes higher than 1 minute. Alerts are not enabled in libraries so the functions must be imported or copied into another script. alert.freq cannot be changed by input because it becomes a series string in a function. dynamic_requests must be true to export functions using `request.*()` calls.

Example:


Library "offline_detection"
Creates alerts for the user-selected symbol by checking if its latest bar is current by comparing it against another chart.

isItDown(sym)
  Checks if 'sym' is offline by requesting time of 'sym'.
  Parameters:
    sym (simple string): (const string) The user-selected symbol in the form of "PREFIX:TICKER".
  Returns: True if time of 'sym' is not available.

isItDownNoSpam(sym)
  Checks if 'sym' is offline by requesting time of 'sym' once.
  Parameters:
    sym (simple string): (const string) The user-selected symbol in the form of "PREFIX:TICKER".
  Returns: True if time of 'sym' is not available and it was available in the previous bar close.

isItUp(sym)
  Checks if 'sym' is online after being offline by using isItDown().
  Parameters:
    sym (simple string): (const string) The user-selected symbol in the form of "PREFIX:TICKER".
  Returns: True if time of 'sym' is available in the current bar but wasn't prior.

offlineAlert(sym)
  Checks if isItDown() is true.
  Parameters:
    sym (simple string): (const string) The user-selected symbol in the form of "PREFIX:TICKER".
  Returns: An alert when the symbol is not online and the time in UTC. This will continue triggering every bar close until the symbol is online.

offlineAlertNoSpam(sym)
  Checks if isItDown() is true.
  Parameters:
    sym (simple string): (const string) The user-selected symbol in the form of "PREFIX:TICKER".
  Returns: An alert when the symbol is not online and the time in UTC.

onlineAlert(sym)
  Checks if isItUp() is true.
  Parameters:
    sym (simple string): (const string) The user-selected symbol in the form of "PREFIX:TICKER".
  Returns: An alert when the symbol is now online and the time in UTC.

warningsign()
  Checks if the current chart is "CRYPTOCAP:TOTAL".
  Returns: A reminder on the chart.
alertsdebuggingofflinetimesessions

Biblioteca Pine

Siguiendo fielmente el espíritu TradingView, el autor ha publicado este código Pine como una biblioteca de código abierto, permitiendo que otros programadores de Pine en nuestra comunidad lo utilicen de nuevo. ¡Olé por el autor! Puede utilizar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero tenga en cuenta que la reutilización de este código en una publicación se rige por las Normas internas.


My published indicators: tradingview.com/u/NeoButane/

Sorry if I haven't replied to your message yet, I'm a bit backlogged :)
También en:

Exención de responsabilidad