Specification - Functions
TFire.constituents_continuous
— Methodconstituents_continuous(tickers::Vector{String}, dates_vect::Vector{Tuple{D,D}},
resolution::String) where {D<:Union{Date,DateTime}}
resolution::String)
Constructs ConstituentsConstinues from a list of tickers and a
TFire.constituents_continuous
— Methodconstituents_continuous(tickers::Vector{String}, eval_dates::Vector{D},
extend_back::Integer; resolution="1d") where {D<:Union{Date,DateTime}}
Constructs a ConstituentsContinuous from a vector of tickers, evaluation dates, and an extend back period. The extend back determines how far before each evaluation date to include data. The resolution determines the type of the eval_dates and how to calculate the extend back.
TFire.extend_sfdb_constituents!
— Methodextend_sfdb_constituents!(rc::ConstituentsContinuous{D,T}; extend_first=Day(0),
extend_last=Day(0)) where {D<:Date,T<:SFDBSpecification}
extend_last=Day(0))
Extends the date range for each ticker in the given ConstituentsContinuous with SFDBSpecification by shifting the start date back by extend_first
and the end date forward by extend_last
. Doesnt extend past current date.
TFire.extend_sfdb_constituents!
— Methodextend_sfdb_constituents!(rc::ConstituentsContinuous{D,T}; extend_first=Day(0),
extend_last=Day(0)) where {D<:DateTime,T<:SFDBSpecification}
extend_last=Day(0))
Extends the date range for each ticker in the given ConstituentsContinuous with SFDBSpecification by shifting the start date back by extend_first
and the end date forward by extend_last
.
TFire.preset_data_fields
— Methodpreset_data_fields(sym::Symbol, s::Type{S}) where S <: SpecificationType
Presets the data fields for a CollectionSpecification based on the symbol sym. Allows selecting common preset configurations like :normal, :reduced etc.
TFire.sfdb_constituents
— Methodsfdb_constituents(cons::ConstituentsDiscrete{CollectionSpecification})
Converts a ConstituentsDiscrete with CollectionSpecification to one with SFDBSpecification by collapsing the date ranges for each ticker on each date into a single range from the start of the day to the end of the day.
TFire.sfdb_constituents
— Methodsfdb_constituents(cons::ConstituentsContinuous{D,CollectionSpecification}) where {D<:Union{Date,DateTime}}
Converts a ConstituentsContinuous with CollectionSpecification to one with SFDBSpecification by collapsing the date ranges for each ticker into a single range from the earliest start date to the latest end date.
TFire.specification_external
— Methodspecification_external(spec::Specification{C,T}) where {C<:AssetConstituents,T<:SFDBSpecification}
Converts a Specification with SFDBSpecification to one with ExternalSpecification by converting the constituents to use ExternalSpecification and converting the data fields to use non logarithmized versions.
TFire.specification_sfdb
— Methodspecification_sfdb(spec::Specification{C,T}; extend_first=Day(1000),
extend_last=Day(1000)) where {C<:ConstituentsContinuous,T<:CollectionSpecification}
Converts a Specification with CollectionSpecification to one with SFDBSpecification by collapsing the date ranges for each ticker into a single range from the earliest start date to the latest end date.
TFire.trading_datetimes
— Methodtrading_datetimes(dates::Vector{Date}; opening_hours="")
Constructs a TradingDates
object containing the trading datetimes for the given vector of dates.
The opening_hours
parameter can be used to specify the trading hours. If set to "NY", the trading hours will be set to the NYSE opening hours. Otherwise, the trading hours will be set to the full day from midnight to 11:59 PM.
Args: dates::Vector{Date}: The vector of dates to get the trading datetimes for. opening_hours::String="": Specifies the trading hours to use. Can be "NY" for NYSE hours or left empty for full day.
Returns: TradingDates: An object containing the trading datetimes for the given dates.