Metadata-Version: 2.1
Name: backtest-pkg
Version: 0.1.2
Summary: A package for backtesting portfolio strategies and trading signals
Home-page: UNKNOWN
Author: Andy Hu
Author-email: andyhu2014@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown

This package serves two backtesting scenarios:
1. Portfolio Backtest:
   1. The portfolio class is the main object for portfolio backtesting.
   A portfolio is defined by a pd.DataFrame of weights or shares. 
   The formate of pd.DataFrame should be rebalance dates as index and security tickers as columns. 
   The end date of the backtest period is encouraged to be specified. If not, the last day available in price data is used.
   2. The benchmark of the portfolio is encouraged to specify.
   It can be a pd.DataFrame of weights or a portfolio class. 
   You can set benchmark weight/portfolio in benchmark variable when the testing portfolio is initialized.
   Or set it to the benchmark attribute of the testing portfolio.
   3. Before backtest, use 'set_price(price_data)' method to specify price data. 
   Backtest result can be generated by 'backtest()' method.
   4. The backtest performance is in 'port_total_ret' attribute.
   5. You can also visualize the result by  'plot_performance()', or have a summary by 'performance_summary()'
   6. More information about the definitions of performance metrics:
   Annualized is assumed to have 250 trading days. 
   Active return is the difference of total return from portfolio to benchmark for the whole period. 
   Active risk is the standard deviation of daily active return multiply square root of trading days in the period. 
   Information Ratio is active return divided by active risk.

2. Trading Strategy Backtest:
(Under development)





