Library "Tosch Market Sessions"
Returns if the NYSE, London SE, Tokyo SE are open
@function Returns if the NYSE (US), London SE (GB), Tokyo SE (JP) are open
bus, bgb, bjp - bool: true if the corresponding exchange is open
count - int: count of how many exchanges are open at the moment
ccolor - color: color that...
personal Library for line and box built in functions
get x1,y1,x2,y2 in a tuple
x : TODO: line
Returns: tuple of x1,y1,x2,y2
Create line with only the y1 value(when line == na) or all
when line != na set x1,y1,x2,y2 individually just 1 or all
- use just the line value to set the x2 to...
This library is a Pine Script™ programmer’s tool containing a variety of time related functions to calculate or measure time, or format time into string variables.
`formattedTime()`, `formattedDate()` and `formattedDay()`
Pine Script™, like many other programming languages, uses timestamps in UNIX format, expressed as the...
A collection of custom tools & utility functions commonly used with my scripts.
getDecimals() Calculates how many decimals are on the quote price of the current market
Returns: The current decimal places on the market quote price
truncate(float, float) Truncates (cuts) excess decimal places
float : _number The...
This scripts shows you some time sessions such as NY open, NY mid, London Open and Daily Close for UTC - 0
It also plots resistance and support based on the last 15 candles but you can change it in settings.
Collection of filters that related with time like sessions and datetime ranges.
All existing session functions I found in the documentation e.g. not na(time(timeframe.period, sessionTimes))
are not suitable for strategies, since the execution of the entries and the exits are delayed by one bar.
Thus I created this library to overcome this...
This library was intended to Get price of given time.input
Credits to TradingView for CAGR Custom Range.
: Get OHLC price of given time.input
: : Time (t) must be using time.input
Returns: : OHLC
: Get HLC price of given time.input
: : Time (t) must...
@description Library for sampling high timeframe (HTF) historical data at an arbitrary number of HTF bars back, using a single security() call.
The data is fixed and does not alter over the course of the HTF bar. It also behaves consistently on historical and elapsed realtime bars.
‼ LIMITATIONS: This library function depends on...
Function to automatically set session times for symbols and eventually timezone.
Useful mainly for futures contracts, to differentiate between pit and overnight sessions, and for 24 hours symbols if you want to "create" sessions for them
This library only returns correct session times to the calling script and does nothing by itself...
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.
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....
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.
TODO: Provide today's date based on UNIX time
Use pinescript v4 functions such as year(), month() and dayofmonth().
Use pinescript v5 function such as switch.
Export as string variables.
Not using any match function such as math.floor.
█ KNOWN ISSUES
Date for Day display...
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...
Utility functions to handle time in Pine Script
Returns an int that corresponds to a timeframe string:
"1" => 1
"5" => 5
"10" => 10
"15" => 15
"30" => 30
"60" => 60
"H1" => 60
"H4" => 240
"1D" => 1440
Returns the number of bars...