PyFacts/README.md
Gourav Kumar aea6bf9b57 Some tests for Sharpe ratio
Also some corrections based identified during testing
2022-05-08 21:04:48 +05:30

1.3 KiB

Fincal

This module simplified handling of time-series data

The problem

Time series data often have missing data points. These missing points mess things up when you are trying to do a comparison between two sections of a time series.

To make things worse, most libraries don't allow comparison based on dates. Month to Month and year to year comparisons become difficult as they cannot be translated into number of days. However, these are commonly used metrics while looking at financial data.

The Solution

Fincal aims to simplify things by allowing you to:

  • Compare time-series data based on dates
  • Easy way to work around missing dates by taking the closest data points
  • Completing series with missing data points using forward fill and backward fill

Examples

To-do

Core features

  • Add setitem
  • Create emtpy TimeSeries object
  • Read from CSV
  • Write to CSV
  • Convert to dict
  • Convert to list of dicts

Fincal features

  • Sync two TimeSeries
  • Average rolling return
  • Sharpe ratio
  • Jensen's Alpha
  • Beta
  • Sortino ratio
  • Correlation & R-squared
  • Treynor ratio
  • Max drawdown

Pending implementation

  • Use limit parameter in ffill and bfill
  • Implementation of ffill and bfill may be incorrect inside expand, check and correct
  • Implement interpolation in expand