Collections

PlanarCore.TimeTicks.DateRangeType

Makes a date range that spans the common minimum and maximum dates of the collection.

DateRange(
    ac::PlanarCore.Collections.InstrumentCollection;
    ...
) -> PlanarCore.TimeTicks.DateRange
DateRange(
    ac::PlanarCore.Collections.InstrumentCollection,
    tf;
    full,
    kwargs...
) -> PlanarCore.TimeTicks.DateRange

The DateRange function takes the following parameters:

  • ac: an InstrumentCollection 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 InstrumentCollection.
  • skip_empty (optional, default is false): a boolean that indicates whether to skip empty data frames in the calculation of the date range.
source
PlanarCore.Collections._daterange_fullFunction

Makes a date range that spans the union (earliest start to latest end) of the collection.

_daterange_full(
    ac::PlanarCore.Collections.InstrumentCollection;
    ...
) -> PlanarCore.TimeTicks.DateRange
_daterange_full(
    ac::PlanarCore.Collections.InstrumentCollection,
    tf;
    kwargs...
) -> PlanarCore.TimeTicks.DateRange

The daterange function returns a DateRange covering the earliest available timestamp and the latest available timestamp across all assets' OHLCV data in the InstrumentCollection.

Parameters:

  • ac: the InstrumentCollection
  • tf (optional): a TimeFrame. If not provided, it is inferred from the first asset instance
source
PlanarCore.Collections.flattenMethod

Returns a dictionary of all the OHLCV dataframes present in the asset collection.

flatten(
    ac::PlanarCore.Collections.InstrumentCollection;
    noempty
) -> SortedDict{TimeFrames.TimeFrame, Vector{DataFrames.DataFrame}, Base.Order.ForwardOrdering}

The flatten function takes the following parameter:

  • ac: an InstrumentCollection 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.

source
PlanarCore.Collections.iscashableMethod

Checks that all assets in the universe match the cash currency.

iscashable(
    c::PlanarCore.Instruments.AbstractCash,
    ac::PlanarCore.Collections.InstrumentCollection
) -> Bool

The iscashable function takes the following parameters:

  • c: an AbstractCash object which encapsulates a representation of cash.
  • ac: an InstrumentCollection object which encapsulates a collection of assets.
source
PlanarCore.Collections.prettydfMethod

Pretty prints the InstrumentCollection DataFrame.

prettydf(
    ac::PlanarCore.Collections.InstrumentCollection;
    full
) -> DataFrames.DataFrame

The prettydf function takes the following parameters:

  • ac: an InstrumentCollection 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.
source