DI2XAI: Dashboard for Intelligent Investment with eXplainable AI
Description
This dataset includes the Python source code and the MySQL code of DI2XAI (a Dashboard for Intelligent Investment with eXplainable AI) for creating the database and run the simulator over historic data of real stock data downloaded from Yahoo Finance and included in Cache to not overpass Yahoo Finance limits. The dashboard has a two-fold objective. Firstly, practitioners, investors or traders can learn by testing their trading strategies based on some existing indicators and other novel indicators provided by the simulator. They can directly operate with a user interface or program the strategy by extending NPC (Non-player Carachter) class and implementing the appropriate methods to automate the strategy. Then they can test their strategy in real historic data in different random time intervals and assess their profitability in a fast way. Secondly, DI2XAI is also used as a backtesting simulation environment to compare different trading strategies by running competitions of different trading strategies in a representative number of different historic data. DI2XAI was designed with the purpose of integrating eXplainable AI (XAI) in the human loop of learning and testing strategies. Initially, it included the possibility of explaining some basic machine learning (ML) based strategies by plotting different Shapley Additive Explanations (SHAP) plots such as barplot or beeswarm and other charts as confusion matrices. Currently, we are using DI2XAI for the application of novel XAI methods such as the definition of interpretable time-series decomposition in the estimation of different investor role types, for which we have a scientific article under evaluation. The main architecture, purpose and usage of DIXAI was originally described in the available article about DI2XAI (for now in available preprint version) included in the links. Anyone can use DI2XAI for backtesting of investment or trading strategies. We thank that researchers and practitioners cite any of our related articles and this dataset when using DI2XAI for their research or activity.
Files
Steps to reproduce
You need to have installed Python with all the required libraries (including but not only yfinance, ipywidgets, plotly, pandas, numpy, os) and any MySQL installation (we used the MySQL integrated installation in XAMPP). Create the database running the SQL scripts for respectively creating the database (DB) user, the DB, and the views, all of them in the “mysql” folder of this dataset. Open the folder “python” of this dataset with any preferred Python editor/executor (we used Visual Studio). Execute “Main.ipynb” notebook and run the only cell to start the simulator. You can start any Npcs to compete with. Apply your strategy from the user interface. Remember that you can use tickers but with the exact notation of Yahoo Finance (which you can check online). Delete any data in any cache whenever you want to update the data (e.g. the last downloaded data from Yahoo Finance for any specific stock to have more recent data). You can program any new strategy extending NPC class (you have plenty examples in other classes starting with “Npc”). Using “Competition.py” you can establish and run any competition among different strategies.
Institutions
- Universidad Complutense de MadridMadrid, Madrid