PINE LIBRARY

MyLibrary001

By dmatrajt888
Updated
Library "MyLibrary001"
Library for calculating the number of bars in the last X trading days

BarsInLastXDays(numTradingDays)
  BarsInLastXDays
@description Calculates the number of bars in the last X trading days
  Parameters:
    numTradingDays (int): int Number of trading days to consider
  Returns: tuple(float, float) A tuple with the number of bars and the bar duration
Release Notes
v2

Added:
BarsInLastXDaysXXX(numTradingDays)
  Parameters:
    numTradingDays (int)
Release Notes
v3

Added:
InTimeRange(my_start, my_finish, my_time)
  Parameters:
    my_start (int)
    my_finish (int)
    my_time (int)

isWithinLastInterval(my_time, my_time1)
  Parameters:
    my_time (int)
    my_time1 (int)

Removed:
BarsInLastXDaysXXX(numTradingDays)
Release Notes
v4

Added:
CloseToEarnings(max_days)
  Parameters:
    max_days (int)
Release Notes
v5
Release Notes
v6

Added:
CheckAndTriggerManualSignals(open_time, close_time, signals)
  Parameters:
    open_time (int)
    close_time (int)
    signals (array<string>)
Release Notes
v7

Added:
TestAlertAndStrat(jsonLONG)
  Parameters:
    jsonLONG (simple string)
Release Notes
v8

Updated:
TestAlertAndStrat(jsonLONG)
  Parameters:
    jsonLONG (string)
Release Notes
v9

Updated:
TestAlertAndStrat(jsonLONG, jsonSHORT, long)
  Parameters:
    jsonLONG (string)
    jsonSHORT (string)
    long (bool)
Release Notes
v10

Added:
ServerAlert(symbol, strategy_name, action, price)
  Parameters:
    symbol (string)
    strategy_name (string)
    action (string)
    price (float)
Release Notes
v11
Release Notes
v12
alerts

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.

Disclaimer