Helpers for calculating time
getTimeOffset(interval, amount) Returns the length in ms for the given amount of the given interval.
interval : Interval to calculate, for example "D" or "60".
amount : Number of intervals for which to calculate the time range in ms.
Returns: The number of ms in the amount of the...
Utils for time series
tradingDaysTillEndOfMonth() Calculates how many full trading days left until the end of the current month. (It doesn't take into account market holidays)
Returns: int series of the remaining trading days until the end of the month.
Library & function(s) which generates a moving average that stays locked to users desired time preference.
TODO - Add functionality for more moving average types. IE: smooth, weighted etc...
time_locked_ma(close, length=1, timeframe='days', type='ema')
Will generate a 1 day exponential moving average that will stay consistent...
This library is a collection of weapons that will help us win the war against the market.
isNewbar(res, timezone) Checks if the res is in new bar at the current timeframe
res : - resolution of the bar to check if new
timezone : - timezone of the resolution
Returns: ch: - 1=true, 0=false
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.
spec : session.regular (default), session.extended or other time spec.
Returns: True if the current is in session; otherwise false.
Method to find the number of days in a given month of year.
days_in_month(year, month) Method to find the number of days in a given month of year.
year : int, year of month, so we know if year is a leap year or not.
month : int, month number.
Methods to stringify date/time, altho there is already builtin support for it.
datetime(unixtime) a stringified date stamp at specified unix time.
unixtime : int unix timestamp.
date_(unixtime) a stringified date stamp at specified unix time.
unixtime : int unix timestamp....