common

enums

expiration_date_field.ExpirationDateField

Enumeration representing different expiration dates for futures contracts.

frequency.Frequency

Frequency enumeration.

price_field.PriceField

Represents one of the data fields that corresponds to OHLC and Volume.

security_type.SecurityType

Enum which denotes the type of the security, that the ticker is representing e.g.

quandl_db_type.QuandlDBType

An enumeration.

exceptions

broker_exceptions.BrokerException

Exception thrown when a Broker's operation fails.

broker_exceptions.OrderCancellingException

Order couldn't be cancelled (e.g.

future_contracts_exceptions.NoValidTickerException

Exception raised when there is no valid specific Ticker for a certain FutureTicker at a given point in time.

risk_parity_boxes

ChangeDirection

An enumeration.

RiskParityBoxes

RiskParityBoxesFactory

Makes timeseries for risk parity boxes.

tickers

Ticker

Representation of a security.

BloombergTicker

Representation of Bloomberg tickers.

HaverTicker

Haver tickers representation.

QuandlTicker

Representation of Quandl tickers.

CcyTicker

Representation of Cryptocurrency tickers.

PortaraTicker

Representation of Portara tickers.

timeseries_analysis

return_attribution_analysis.ReturnAttributionAnalysis

Class used for calculating metrics of performance attribution.

risk_contribution_analysis.RiskContributionAnalysis

Calculates risk contribution metrics.

utils

Classes

confidence_interval.analytical_cone_base.AnalyticalConeBase

confidence_interval.analytical_cone.AnalyticalCone

confidence_interval.analytical_cone_oos.AnalyticalConeOOS

dateutils.date_format.DateFormat

Class defining date formats (as strings).

dateutils.timer.Timer

Timer object which is a component in IOC.

dateutils.timer.RealTimer

Timer which gives the real current time.

dateutils.timer.SettableTimer

Timer object which doesn't give the real current time, but is "faking" it (current time can be set).

factorization.data_models.data_model.DataModel

Class grouping the results of factorization.

factorization.data_models.data_model_input.DataModelInput

Class storing an input data from which FactorizationDataModel is built.

factorization.data_models.rolling_window_estimation.RollingWindowsEstimator

Class for estimating parameters of rolling windows.

factorization.data_presenters.data_presenter.DataPresenter

Class used for presenting the data stored in the FactorizationDataModel.

factorization.data_presenters.rolling_data_presenter.RollingDataPresenter

Class used for presenting the data stored in the RollingFactorizationDataModel.

factorization.factors_identification.elastic_net_factors_identifier.ElasticNetFactorsIdentifier

Class used for identifying factors in the model with Elastic Net method (with Cross-validation).

factorization.factors_identification.elastic_net_factors_identifier_simplified.ElasticNetFactorsIdentifierSimplified

Class used for identifying factors in the model with Elastic Net method (with Cross-validation).

factorization.factors_identification.stepwise_factor_identifier.StepwiseFactorsIdentifier

Class used for identifying factors in the model with Stepwise Regression (with Forward Feature Selection).

factorization.manager.FactorizationManager

Facade class for factorization.

miscellaneous.consecutive_duplicates.Method

An enumeration.

returns.is_return_stats.InSampleReturnStats

Stores values of stats used to build confidence interval (Cone Chart)

volatility.drift_independent_volatility.DriftIndependentVolatility

volatility.volatility_forecast.VolatilityForecast

Creates class used for vol forecasting: describes the volatility forecast configuration as well as the input and output data (output is created and assigned by calling one of the class methods).

volatility.volatility_manager.VolatilityManager

VolatilityManager uses rolling window to asses the historical volatility of a series.

data_cleaner.DataCleaner

Cleans data which is partially incomplete, e.g.

Functions

close_open_gap.close_open_gap.close_open_gap

Calculates price changes during the night gap (opening price compared to closing price from the previous day).

dateutils.common_start_and_end.get_common_start_and_end

Finds the first and last valid dates (with a value different than NaN) for each column and then returns the latest of starting dates and the soonest ending date.

dateutils.date_to_string.date_to_str

Converts date object into string.

dateutils.get_quarter.get_quarter

Retrieves the quarter that the specified date is in.

dateutils.get_values_common_dates.get_values_for_common_dates

Gets list/tuple of series/dataframes (possibly mixed) and finds the common dates for all of them.

dateutils.iso_to_gregorian.iso_to_gregorian

Gregorian calendar date for the given ISO year, week and day.

dateutils.string_to_date.str_to_date

Converts string into date object.

dateutils.to_days.to_days

Converts Timedelta variable into number of days (expressed as float).

miscellaneous.annualise_with_sqrt.annualise_with_sqrt

Annualises samples of given frequency by multiplying each value by the square-rooted number of samples in a year for a given frequency.

miscellaneous.average_true_range.average_true_range

Calculates the average true range.

miscellaneous.consecutive_duplicates.drop_consecutive_duplicates

Removes consecutive duplicates (e.g.

miscellaneous.function_name.get_function_name

While called inside a function or a class method it returns the name of the function/method that called it as a string.

miscellaneous.kelly.kelly

Calculates the value of the Kelly Criterion (the fraction of money that should be invested) for the series of returns/prices.

miscellaneous.kelly.kelly_binary

Calculates the value of the Kelly Criterion (the fraction of money that should be invested) for a bet that has two possible outcomes.

miscellaneous.periods_list.periods_list_from_bool_series

Uses a timeseries containing boolean values to create periods of True values.

miscellaneous.to_list_conversion.convert_to_list

Converts a given value to list if necessary and returns information if the conversion was necessary.

miscellaneous.volume_weighted_average_price.volume_weighted_average_price

Aggregates prices in the prices_tms by calculating the average weighted price for each period.

numberutils.is_finite_number.is_finite_number

Checks if the given variable is number and if it is finite.

ratios.calmar_ratio.calmar_ratio

Calculates the Calmar ratio for a given timeseries of returns.

ratios.gain_to_pain_ratio.gain_to_pain_ratio

Calculates the gain to pain ratio for a given timeseries of returns.

ratios.information_ratio.information_ratio

The function calculates information ratio based on monthly returns.

ratios.omega_ratio.omega_ratio

Omega Ratio - The Omega Ratio is a measure of performance that doesn't assume a normal distribution of returns.

ratios.sharpe_ratio.sharpe_ratio

Calculates the Sharpe Ratio for a given timeseries of returns and given frequency.

ratios.sorino_ratio.sorino_ratio

Calculates the Sorino ratio for a given timeseries of returns.

returns.annualise_total_return.annualise_total_return

Calculates Annualised Rate of Return.

returns.avg_drawdown.avg_drawdown

Finds the average drawdown for the given timeseries of prices.

returns.avg_drawdown_duration.avg_drawdown_duration

Finds the average duration of a drawdown for the given timeseries of prices.

returns.beta_and_alpha.beta_and_alpha_full_stats

Calculates alpha and beta of the series versus the benchmark series.

returns.cagr.cagr

Returns the Compound Annual Growth Rate (CAGR) calculated for the given series.

returns.convert_dataframe_frequency.convert_dataframe_frequency

Converts each column in the dataframe to the specified frequency.

returns.custom_returns_aggregating.aggregate_returns

Aggregates returns using custom start dates and end dates.

returns.cvar.cvar

Calculates Conditional Value at Risk for a given percentage.

returns.drawdown_tms.drawdown_tms

Calculates the timeseries of the same dates as prices_tms, which contains the drawdown value for each date.

returns.get_aggregate_returns.get_aggregate_returns

Aggregates returns by week, month, or year.

returns.index_grouping.get_grouping_for_frequency

Returns a proper grouping function which can then be applied in the series.groupby() or dataframe.groupby().

returns.list_longest_drawdowns.list_longest_drawdowns

Analyses the specified series and finds the top count longest drawdowns.

returns.list_of_max_drawdowns.list_of_max_drawdowns

Finds the values of individual maximum drawdowns and the duration of each drawdown.

returns.log_to_simple_return.log_to_simple_return

Converts logarithmic return to corresponding simple return.

returns.max_drawdown.max_drawdown

Finds maximal drawdown for the given timeseries of prices.

returns.return_distribution_helpers.get_cone_chart

Helper function to plot simulated paths together with significant lines (like expectation)

returns.return_distribution_helpers.generate_random_paths

Generates random paths.

returns.return_distribution_helpers.generate_random_log_paths

Equivalent of generate_random_paths, but uses log Returns instead

returns.simple_to_log_return.simple_to_log_return

Converts simple return to the corresponding logarithmic return.

returns.sqn.sqn

Calculates the SQN = mean return of trade / std(returns of trades).

returns.sqn.sqn_for100trades

Calculates the SQN = mean return of trade / std(returns of trades) * sqrt(100)

returns.sqn.avg_nr_of_trades_per1y

Calculates average number of trades per year for a given data-frame of trades.

returns.tail_events.tail_events

Gets tail events of the benchmark and corresponding events in the examined timeseries.

technical_analysis.utils.ta_series

Function created to allow using TA-Lib functions with QFSeries.

volatility.get_volatility.get_volatility

Calculates a volatility for the given series of returns or prices.

volatility.intraday_volatility.intraday_volatility

Calculates annualised volatility from intraday samples of given interval.

volatility.rolling_volatility.rolling_volatility

Calculates the rolling volatility for the given series of returns.