Collections
Collections.Collections
— Module=Collections= module
Collections.AssetCollection
— TypeA type representing a collection of asset instances.
data
This type is used to store and manage a collection of asset instances. Each instance is linked to an asset and an exchange identifier. Elements from AssetCollection
can be accessed using getindex
and setindex!
which accepts different types including ExchangeID
, AbstractAsset
, AbstractString
, MatchString
, or a combination of base, quote currency, and exchange. Iterating over the collection only iterates over the instances within.
TimeTicks.DateRange
— TypeMakes a date range that spans the common minimum and maximum dates of the collection.
DateRange(
ac::Collections.AssetCollection;
...
) -> TimeTicks.DateRange
DateRange(
ac::Collections.AssetCollection,
tf;
skip_empty
) -> TimeTicks.DateRange
The DateRange
function takes the following parameters:
ac
: an AssetCollection object which encapsulates a collection of assets.tf
(optional): a TimeFrame object that represents a specific time frame. If not provided, the function will calculate the date range based on all time frames in the AssetCollection.skip_empty
(optional, default is false): a boolean that indicates whether to skip empty data frames in the calculation of the date range.
Collections.bqe
— MethodDispatch based on either base, quote currency, or exchange.
Collections.flatten
— MethodReturns a dictionary of all the OHLCV dataframes present in the asset collection.
flatten(
ac::Collections.AssetCollection
) -> SortedDict{TimeFrames.TimeFrame, Vector{DataFrames.DataFrame}, Base.Order.ForwardOrdering}
The flatten
function takes the following parameter:
ac
: an AssetCollection object which encapsulates a collection of assets.
The function returns a SortedDict where the keys are TimeFrame objects and the values are vectors of DataFrames that represent OHLCV (Open, High, Low, Close, Volume) data. The dictionary is sorted by the TimeFrame keys.
Collections.iscashable
— MethodChecks that all assets in the universe match the cash currency.
iscashable(
c::Instruments.AbstractCash,
ac::Collections.AssetCollection
) -> Bool
The iscashable
function takes the following parameters:
c
: an AbstractCash object which encapsulates a representation of cash.ac
: an AssetCollection object which encapsulates a collection of assets.
Collections.prettydf
— MethodPretty prints the AssetCollection DataFrame.
prettydf(
ac::Collections.AssetCollection;
full
) -> DataFrames.DataFrame
The prettydf
function takes the following parameters:
ac
: an AssetCollection object which encapsulates a collection of assets.full
(optional, default is false): a boolean that indicates whether to print the full DataFrame. If true, the function prints the full DataFrame. If false, it prints a truncated version.