From 6052bbc26176a2ee53549af0f4d77f6e9554d5ac Mon Sep 17 00:00:00 2001 From: Bin Yang Date: Fri, 2 Apr 2021 17:22:04 -0400 Subject: [PATCH] auto update readme --- .github/workflows/wiki_gen_daily.yml | 7 ++- README.md | 88 +++++++++++++++++++--------- wiki_gen.py | 27 ++++++++- 3 files changed, 93 insertions(+), 29 deletions(-) diff --git a/.github/workflows/wiki_gen_daily.yml b/.github/workflows/wiki_gen_daily.yml index 1bbf7cf..d4351b0 100644 --- a/.github/workflows/wiki_gen_daily.yml +++ b/.github/workflows/wiki_gen_daily.yml @@ -34,4 +34,9 @@ jobs: with: path: "generated_wiki" env: - GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GIT_TOKEN }} \ No newline at end of file + GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GIT_TOKEN }} + + - name: Commit & Push changes + uses: actions-js/push@master + with: + github_token: ${{ secrets.GIT_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index bffa9c4..7f5e3f3 100644 --- a/README.md +++ b/README.md @@ -22,39 +22,73 @@ ___ # Trading ## Deep Learning ([Wiki](https://github.com/firmai/financial-machine-learning/wiki/deep_learning)) -- [Deep Learning](https://github.com/keon/deepstock) - Technical experimentations to beat the stock market using deep learning. -- [Deep Learning II](https://github.com/LiamConnell/deep-algotrading/tree/master/notebooks) - Tensorflow Regression. -- [Deep Learning III](https://github.com/Rachnog/Deep-Trading) - Algorithmic trading with deep learning experiments. -- [Deep Learning IV](https://github.com/achillesrasquinha/bulbea) - Bulbea: Deep Learning based Python Library. -- [LTSM GRU](https://github.com/RajatHanda/Finance-Forecasting) - Stock Market Forecasting using LSTM\GRU. -- [LTSM Recurrent](https://github.com/VivekPa/AIAlpha) - OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network. -- [ARIMA-LTSM Hybrid](https://github.com/imhgchoi/Corr_Prediction_ARIMA_LSTM_Hybrid) - Hybrid model to predict future price correlation coefficients of two assets. -- [Neural Network](https://github.com/VivekPa/IntroNeuralNetworks) - Neural networks to predict stock prices. -- [AI Trading](https://github.com/borisbanushev/stockpredictionai/blob/master/readme2.md) - AI to predict stock market movements. - +| repo | comment | created_at | last_commit | star_count | repo_status | rating | +|:---------------------------------------------------------------------------------------------------|:-------------------------------------------------------|:--------------------------|:--------------------------|:------------------------|:------------------------------------|:--------------------| +| [Stock-Prediction-Models](https://github.com/huseinzol05/Stock-Prediction-Models) | NEW | 12/18/17 10:49 | 1/5/21 10:31 | 3584.0 | :heavy_check_mark: | :star:x5 | +| [AI Trading](https://github.com/borisbanushev/stockpredictionai/blob/master/readme2.md) | AI to predict stock market movements. | 1/9/19 8:02 | 2/11/19 16:32 | 2852.0 | :heavy_multiplication_x: | :star:x5 | +| [FinRL-Library](https://github.com/AI4Finance-LLC/FinRL-Library) | NEW | 7/26/20 13:18 | 3/28/21 13:46 | 1780.0 | :heavy_check_mark: | :star:x5 | +| [Deep Learning IV](https://github.com/achillesrasquinha/bulbea) | Bulbea: Deep Learning based Python Library. | 3/9/17 6:11 | 3/19/17 7:42 | 1448.0 | :heavy_check_mark: | :star:x5 | +| [RLTrader](https://github.com/notadamking/RLTrader) | NEW | 4/27/19 18:35 | 10/17/19 16:25 | 1300.0 | :heavy_check_mark: | :star:x5 | + +
+ next 5 + | repo | comment | created_at | last_commit | star_count | repo_status | rating | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------|:-------------------------|:------------------------|:------------------------------------|:--------------------| +| [Deep Learning III](https://github.com/Rachnog/Deep-Trading) | Algorithmic trading with deep learning experiments. | 6/18/16 18:23 | 8/7/18 15:24 | 1262.0 | :heavy_multiplication_x: | :star:x5 | +| [Personae](https://github.com/Ceruleanacg/Personae) | NEW | 3/10/18 11:22 | 9/2/18 17:21 | 1142.0 | :heavy_multiplication_x: | :star:x5 | +| [Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020](https://github.com/AI4Finance-LLC/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020) | NEW | 7/26/20 13:12 | 1/21/21 18:11 | 542.0 | :heavy_check_mark: | :star:x4 | +| [awesome-deep-trading](https://github.com/cbailes/awesome-deep-trading) | curated list of papers/repos on topics like CNN/LSTM/GAN/Reinforcement Learning etc. Categorized as deep learning for now but there are other topics here. Manually maintained by cbailes | 11/26/18 3:23 | 1/1/21 9:41 | 528.0 | :heavy_check_mark: | :star:x4 | +| [Neural Network](https://github.com/VivekPa/IntroNeuralNetworks) | Neural networks to predict stock prices. | 9/10/18 6:34 | 11/21/18 7:39 | 488.0 | :heavy_multiplication_x: | :star:x4 | +
+ ## Reinforcement Learning ([Wiki](https://github.com/firmai/financial-machine-learning/wiki/reinforcement_learning)) -- [RL Trading](https://colab.research.google.com/drive/1FzLCI0AO3c7A4bp9Fi01UwXeoc7BN8sW) - A collection of 25+ Reinforcement Learning Trading Strategies - Google Colab. -- [RL](https://github.com/kh-kim/stock_market_reinforcement_learning) - OpenGym with Deep Q-learning and Policy Gradient. -- [RL II](https://github.com/deependersingla/deep_trader) - reinforcement learning on stock market and agent tries to learn trading. -- [RL III](https://github.com/samre12/deep-trading-agent) - Github - Deep Reinforcement Learning based Trading Agent for Bitcoin. -- [RL IV](https://github.com/jjakimoto/DQN) - Reinforcement Learning for finance. -- [RL V](https://github.com/gstenger98/rl-finance) - Building an Agent to Trade with Reinforcement Learning. -- [Pair Trading RL](https://github.com/shenyichen105/Deep-Reinforcement-Learning-in-Stock-Trading) - Using deep actor-critic model to learn best strategies in pair trading. +| repo | comment | created_at | last_commit | star_count | repo_status | rating | +|:------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------|:-------------------------|:-------------------------|:------------------------|:------------------------------|:--------------------| +| [RL Trading](https://colab.research.google.com/drive/1FzLCI0AO3c7A4bp9Fi01UwXeoc7BN8sW) | A collection of 25+ Reinforcement Learning Trading Strategies -Google Colab. | nan | nan | nan | :heavy_check_mark: | | +| [RL](https://github.com/kh-kim/stock_market_reinforcement_learning) | OpenGym with Deep Q-learning and Policy Gradient. | 10/4/16 14:42 | 12/23/16 7:34 | 712.0 | :heavy_check_mark: | | +| [RL III](https://github.com/samre12/deep-trading-agent) | Github -Deep Reinforcement Learning based Trading Agent for Bitcoin. | 9/21/17 17:05 | 4/13/18 16:33 | 575.0 | :heavy_check_mark: | | +| [RL V](https://github.com/gstenger98/rl-finance) | Building an Agent to Trade with Reinforcement Learning. | 1/16/19 0:43 | 3/19/20 20:28 | 32.0 | :heavy_check_mark: | | +| [Pair Trading RL](https://github.com/shenyichen105/Deep-Reinforcement-Learning-in-Stock-Trading) | Using deep actor-critic model to learn best strategies in pair trading. | 5/18/17 16:47 | 5/18/17 16:56 | 241.0 | :heavy_check_mark: | | + +
+ next 5 + | repo | comment | created_at | last_commit | star_count | repo_status | rating | +|:-------------------------------------------------------------------|:------------------------------------------------------------------------------------|:-------------------------|:-------------------------|:------------------------|:------------------------------|:--------------------| +| [RL IV](https://github.com/jjakimoto/DQN) | Reinforcement Learning for finance. | 10/21/16 2:47 | 4/7/17 8:11 | 140.0 | :heavy_check_mark: | | +| [RL II](https://github.com/deependersingla/deep_trader) | reinforcement learning on stock market and agent tries to learn trading. | 6/11/16 7:27 | 1/22/18 14:35 | 1340.0 | :heavy_check_mark: | | +
+ ## Other Models ([Wiki](https://github.com/firmai/financial-machine-learning/wiki/other_models)) -- [Mixture Models I](https://github.com/BlackArbsCEO/Mixture_Models) - Mixture models to predict market bottoms. -- [Mixture Models II](https://github.com/BlackArbsCEO/mixture_model_trading_public) - Mixture models and stock trading. -- [Scikit-learn Stock Prediction](https://github.com/robertmartin8/MachineLearningStocks) - Using python and scikit-learn to make stock predictions. -- [Fundamental LT Forecasts](https://github.com/Hvass-Labs/FinanceOps) - Research in investment finance for long term forecasts. -- [Short-Term Movement Cues](https://github.com/anfederico/Clairvoyant) - Identify social/historical cues for short term stock movement. -- [Trend Following](http://inseaddataanalytics.github.io/INSEADAnalytics/ExerciseSet2.html) - A futures trend following portfolio investment strategy. - +| repo | comment | created_at | last_commit | star_count | repo_status | rating | +|:-----------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------|:-------------------------|:-------------------------|:------------------------|:------------------------------|:--------------------| +| [Trend Following](http://inseaddataanalytics.github.io/INSEADAnalytics/ExerciseSet2.html) | A futures trend following portfolio investment strategy. | nan | nan | nan | :heavy_check_mark: | | +| [Scikit-learn Stock Prediction](https://github.com/robertmartin8/MachineLearningStocks) | Using python and scikit-learn to make stock predictions. | 2/12/17 4:50 | 2/4/21 3:48 | 919.0 | :heavy_check_mark: | | +| [Fundamental LT Forecasts](https://github.com/Hvass-Labs/FinanceOps) | Research in investment finance for long term forecasts. | 7/22/18 8:14 | 2/17/21 14:39 | 379.0 | :heavy_check_mark: | | +| [Mixture Models I](https://github.com/BlackArbsCEO/Mixture_Models) | Mixture models to predict market bottoms. | 3/20/17 18:54 | 4/25/17 23:35 | 31.0 | :heavy_check_mark: | | +| [Short-Term Movement Cues](https://github.com/anfederico/Clairvoyant) | Identify social/historical cues for short term stock movement. | 9/12/16 18:38 | 8/29/18 20:27 | 2157.0 | :heavy_check_mark: | | + +
+ next 5 + | repo | comment | created_at | last_commit | star_count | repo_status | rating | +|:---------------------------------------------------------------------------------------------|:---------------------------------------------|:--------------------------|:-------------------------|:------------------------|:------------------------------|:--------------------| +| [Mixture Models II](https://github.com/BlackArbsCEO/mixture_model_trading_public) | Mixture models and stock trading. | 12/11/17 17:05 | 5/13/20 23:50 | 166.0 | :heavy_check_mark: | | +
+ ## Data Processing Techniques and Transformations ([Wiki](https://github.com/firmai/financial-machine-learning/wiki/data_processing_techniques_and_transformations)) -- [Advanced ML](https://github.com/BlackArbsCEO/Adv_Fin_ML_Exercises) - Exercises too Financial Machine Learning (De Prado). -- [Advanced ML II](https://github.com/hudson-and-thames/research) - More implementations of Financial Machine Learning (De Prado). - +| repo | comment | created_at | last_commit | star_count | repo_status | rating | +|:-------------------------------------------------------------------------------|:--------------------------------------------------------------------------|:-------------------------|:-------------------------|:------------------------|:------------------------------|:--------------------| +| [Advanced ML II](https://github.com/hudson-and-thames/research) | More implementations of Financial Machine Learning (De Prado). | nan | nan | nan | :heavy_check_mark: | | +| [Advanced ML](https://github.com/BlackArbsCEO/Adv_Fin_ML_Exercises) | Exercises too Financial Machine Learning (De Prado). | 4/25/18 17:22 | 1/16/20 17:25 | 958.0 | :heavy_check_mark: | | + +
+ next 5 + | repo | comment | created_at | last_commit | star_count | repo_status | rating | +|-------------------|----------------------|-------------------------|--------------------------|-------------------------|--------------------------|---------------------| +
+ # Portfolio Management ## Portfolio Selection and Optimisation ([Wiki](https://github.com/firmai/financial-machine-learning/wiki/portfolio_selection_and_optimisation)) diff --git a/wiki_gen.py b/wiki_gen.py index e20222a..70140b4 100644 --- a/wiki_gen.py +++ b/wiki_gen.py @@ -22,9 +22,10 @@ def get_wiki_rating(input_rating): return '{}'.format(result_text) -def generate_wiki_per_category(output_path): +def generate_wiki_per_category(output_path, update_readme: bool = True): """ + :param update_readme: :param output_path: """ repo_df = get_repo_list() @@ -44,6 +45,7 @@ def generate_wiki_per_category(output_path): 'rating': category_df['rating'] }) # add color for the status + formatted_df = formatted_df.sort_values(by=['rating', 'star_count'], ascending=False).reset_index(drop=True) formatted_df['repo_status'] = formatted_df['repo_status'].apply(lambda x: get_wiki_status_color(x)) formatted_df['rating'] = formatted_df['rating'].apply(lambda x: get_wiki_rating(x)) formatted_df.columns = ['{}'.format(x) for x in formatted_df.columns] @@ -54,6 +56,29 @@ def generate_wiki_per_category(output_path): f.write(formatted_df.to_markdown(index=False)) print('wiki generated in [{}]'.format(output_path_full)) + if update_readme: + check_str = '[PLACEHOLDER:{}]'.format(clean_category_name) + all_read_me = '' + with open(os.path.join(PROJECT_ROOT_DIR, 'README.md')) as f: + all_read_me = f.read() + if check_str not in all_read_me: + print(f'section {check_str} not found') + continue + + # only display top 5, then expandable for extra 5 + with open(os.path.join(PROJECT_ROOT_DIR, 'README.md'), 'w') as f: + table_str = formatted_df.iloc[:5].to_markdown(index=False) + collapsible_str = """ + +
+ next 5 + {} +
+ """.format(formatted_df.iloc[5:10].to_markdown(index=False)) + new_str = table_str + collapsible_str + s = all_read_me.replace(check_str, new_str) + f.write(s) + if __name__ == '__main__': local_path = os.path.join(PROJECT_ROOT_DIR, 'generated_wiki')