TimeFormattingLibraryLibrary "TimeFormattingLibrary"
Time formatting functions: formating functions to make timestrings more human readable friendly (for both fixed time and time-elapsed).
Also functions for last and first instance in month of day of week input.
Also a function for identifying bank holiday Mondays.
timeFormatFxn(showDayOfWeek, showDayOfMonth, showMonth, showYear, showHrMin, _time, _timezone)
converts time into readable format
Parameters:
showDayOfWeek (bool) : if you want to show day of week (i.e. Mon, Tues etc)
showDayOfMonth (bool) : if you want to show day number of month with superscript ordinals (i.e. 1ˢᵗ, 2ⁿᵈ, etc)
showMonth (bool) : if you want to show the month (i.e. Jan, Feb, etc)
showYear (bool) : if you want to show the year (i.e. 2023)
showHrMin (bool) : if you want to show time in 24hr clock format
_time (int) : is the unix time (i.e. time or time_close)
_timezone (string) : the user timezone input as string (e.g. "America/New_York", "UTC-5", "GMT+0530")
Returns: time date string
timeElapsedFxn(timespan)
converts timespan into readable format
Parameters:
timespan (int) : is the length of time in milliseconds to be converted into a human readable string
Returns: timespan string (whether it be a for showing 'time-elapsed' or for showing a 'countdown timer')
isFirstXdayofmonth(_dayofweek)
gives bool result for when first occurence in month of the day-of-week input
Parameters:
_dayofweek (int) : (can be integer 1-7 or can be dayofweek variable; i.e. dayofweek.wednesday)
isLastXdayofmonth(_dayofweek)
gives bool result for when last occurence in month of the day-of-week input
Parameters:
_dayofweek (int) : (can be integer 1-7 or can be dayofweek variable; i.e. dayofweek.wednesday)
wasBankHolidayMonday()
gives bool result for if yesterday was a bank holiday monday. Only for use with with request.security() function, see example code below
Bankholiday
BEST USA Bank Holidays HelperHello traders
This is a quick helper displaying the US bank holidays labels 1 day before the actual bank holiday date
Useful to be reminded when it's better to not trade as the big "whales" aren't trading either - and are probably drinking cocktails on their yachts in the Caribbeans island
This is my way of saying that, the days where the USA are off, the derivatives like indices aren't likely to give big opportunities
Of course, big move might happen but statistically, we're better off going to the Caribbeans islands as well (or preparing for the next trading day)
Bonus
The indicator displays in fuschia (never knew how to write that word properly without checking google first...) the 2019 US bank holidays
Best regards and enjoy your cocktails today :)
Dave