Struct

Asset

These structs contain the price or return values, the timestamp information, the scaling factor to annualize the returns, the frequency of returns, the id, and the exchange the asset is traded on.

If AssetReturn(ticker::String,from::TimeType,to::TimeType,freq::String) is called data is automatically downloaded using YFinance.jl and the exchange, freq, and scale are automatically stored/calculated. The package calculates the scale assuming 252 trading days in a year. Furthermore, the exchange is important to accurately aggregate intra-day data (the trading hours in a day are different for exchanges across the world).

PerformanceAnalytics.AssetPriceType
AssetPrice(ticker::String,from::TimeType,to::TimeType,freq::String;exchange_local_time=true)

Generates a AssetPrice struct using YFinance.jl.

Arguments

  • ticker the Yahoo Finance ticker
  • from a start time/date (either a ::Date or ::DateTime)
  • to a end time/date (either a ::Date or ::DateTime)
  • freq the frequency of data. One of "3mo","1mo","1wk","5d","1d",1h","90m","60m","30m","15m","5m","2m","1m"
  • exchangelocaltime use the local time of the exchange as the timestamp (defaults to true)

Returns

AssetPrice

source
PerformanceAnalytics.AssetReturnType
AssetReturn(x::AssetPrice)

Calculates the return from the price series of the AssetPrice and returns a AssetReturn.

source
AssetReturn(ticker::String,from::TimeType,to::TimeType,freq::String)

Generates a AssetReturn struct using YFinance.jl. Internally calls AssetPrice and then calculates returns from the price series.

Arguments

  • ticker the Yahoo Finance ticker
  • from a start time/date (either a ::Date or ::DateTime)
  • to a end time/date (either a ::Date or ::DateTime)
  • freq the frequency of data. One of "3mo","1mo","1wk","5d","1d",1h","90m","60m","30m","15m","5m","2m","1m"
  • exchangelocaltime use the local time of the exchange as the timestamp (defaults to true)

Returns

AssetReturn

source

Accessing Items

Base.valuesFunction
Base.values(x::AssetPrice)

Returns a vector of prices of the asset.

source
Base.values(x::AssetReturn)

Returns a vector of returns of the asset.

source
PerformanceAnalytics.scaleFunction
scale(x::AssetPrice)

Returns the scaling number for the asset. Used to for annualization.

source
scale(x::AssetReturn)

Returns the scaling number for the asset. Used to for annualization.

source