Skip to content

Commit

Permalink
Fix/improve documentation for users (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLD authored Sep 23, 2024
1 parent 78d9499 commit df4bb7a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
13 changes: 13 additions & 0 deletions qf_lib/containers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
This module offers a comprehensive set of containers for financial data analysis, including series, dataframes, data arrays, and futures-related objects.
Each container type is designed with specialized classes to handle various aspects of financial data, such as price series, return calculations, and futures contract management.
These classes streamline the processing and analysis of complex financial datasets, providing a robust framework for quantitative finance research.
Notes:
- When constructing a container object, the input data is typically expected to be in a wide format. For example:
- A `PricesSeries` object might be initialized with a DataFrame where each column represents the price history of a different asset.
- A `QFDataArray` can be created using multi-dimensional arrays to represent time, asset, and other axes of data.
"""
16 changes: 13 additions & 3 deletions qf_lib/data_providers/abstract_price_data_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,19 @@

class AbstractPriceDataProvider(DataProvider, metaclass=ABCMeta):
"""
An interface for data providers containing historical data of stocks, indices, futures
and other asset classes. This is a base class of any simple data provider (a data provider that is associated with
single data base, for example: Quandl, Bloomberg, Yahoo.)
Interface for data providers that supply historical data for various asset classes, including stocks, indices, and futures.
This base class is designed for simple data providers, which are linked to a single data source (e.g., Quandl, Bloomberg, Yahoo).
It defines the standard structure and methods that any specific data provider implementation must adhere to in order to access and retrieve historical market data.
Notes:
- When implementing the get_history method (which drivers a large portion of backtesting capabilities) careful consideration must be taken
to ensure the data is returned in the expected format depending on the specific input tickers and fields.
For Example:
- isinstance(tickers, str) and isinstance(fields, str) it is expected to return a PriceSeries object
- isinstance(tickers, str) and isinstance(fields, list) it is expected to return a PricesDataframe object
- otherwise it is expected to return a QFDataArray object
"""

def get_price(self, tickers: Union[Ticker, Sequence[Ticker]], fields: Union[PriceField, Sequence[PriceField]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@

class RobustCovariance:
"""
Creates a class used for vol forecasting and covariance matrix estimation
NOTE: this method has a tendency to make decrease the volatility
Class for volatility forecasting and covariance matrix estimation.
This class provides methods for estimating future volatility and the covariance matrix
of financial assets. Note that the forecasting methods implemented here may have a tendency
to reduce the estimated volatility.
Parameters
----------
Expand Down

0 comments on commit df4bb7a

Please sign in to comment.