Financial data warehouse and backtesting framework
1
stars
1
forks
source link
Financial Data Warehouse
High Level Logical Flow:
- Entry Point Class
- collects/reads/encapsulates all the settings/configurations for a single BackTest instance
- output: instance of Back Test Config Class
- Back Test Config Class
- Stores all the settings/parameters/configurations required by the Back Test Class
- Start Date, End Date, Stock List,...?
- Data Getter Class
- input: instance of Back Test Class
- Use info from input to know what data is required then queries some data source (csv file, database, internet, whatever)
- output: instance(s) Price Series Class
- Price Series Class
- Maybe just a Pandas array, maybe this isn't needed
- Crystal Ball Class
- input: instance of Price Series Class
- generates buy or don't buy signals for each stock for each day
- output: instance(s) Buy Signal Series
- Buy Signal Series
- Maybe just a Panada array, maybe this isn't needed
- Balancer Class
- input: instance(s) Buy Signal Series
- implements daily re-balancing of holdings according input
- output: instance Portfolio Class
- Portfolio Class
- all sorts of analytics
- overall return calculation
- volatility
- Sharpe Ratio
- daily return calculations
Stock Trading Strategy Backtesting
Trade Signal
Trade Signal Collection
Back Test Bot object
Member variables:
- sell every thing we bought yesterday at today's prices
- determine % change in stock price of all stocks bought yesterday
- determine % change of holding
- yesterdays allocation * % change of stock price
- determine which stocks are a buy at today's prices
- for each stock crystal ball says whether or not to buy
- determine today's allocation for the buys
- 1 / count of buys signals
- hold stocks. go to tomorrow.