Calendar
Finter Trading day Calendar Guide
Finter is proud to offer a new, free-to-use feature for our users: the Trading day Calendar. Access to trading day information is often restricted and difficult to obtain, but we believe in providing our users with the tools they need without any cost. The trading day data is updated weekly to ensure you have the most current information at your fingertips.
Import Statements
To take advantage of the Trading day Calendar, you'll need to import the necessary functions and classes. Here's how you can do it:
Available Exchanges
The Calendar feature currently supports the following exchanges: krx
and us
. For all functions, unless specified otherwise, the default exchange
argument is set to krx
.
Code
The Code
class is an enum that helps categorize the days according to the trading status. It is used in conjunction with other functions to filter the days based on the trading activity. You can retrieve all the enum members and their corresponding values using the following sample code:
iter_trading_days
The iter_trading_days
function is useful for generating a list of all the trading days within a specified date range. It filters out weekends and holidays, providing only the days when the market was open for trading. You can input dates as integers, strings, or datetime
objects as shown in the sample code below:
iter_holidays
The iter_holidays
function is particularly useful for identifying days when the market is closed for reasons other than weekends, such as public holidays or special market closures.
iter_days
By providing the desired enum value from Code
, the iter_days
function allows you to filter the days to get a list of dates that match the trading day type you are interested in.
TradingDay
The TradingDay
class is a powerful tool for navigating through trading days. Whether you need to find the previous, next, or a specific number of days away from a given trading day, this class provides methods to easily calculate those dates.
last_close
: Returns the most recent closed trading day. Thedate
argument must be in the format%Y%m%d%H%M%S
.upcoming_close
: Returns the nearest upcoming trading day closure. Thedate
argument must be in the format%Y%m%d%H%M%S
.next
: Returns the next trading day after the given date.prev
: Returns the trading day before the given date.day_delta
: Returns the trading day that isn
business days away from the given date, wheren
can be positive or negative.
Note that using TradingDay.last_close
and TradingDay.upcoming_close
with a %Y%m%d
format will result in an error:
Finter is committed to enhancing your financial data experience. We continuously strive to provide you with the most accurate and up-to-date information, so you can make informed decisions with confidence.
Last updated