# ML for Trading - 2<sup>nd</sup> Edition
This [book](https://www.amazon.com/Machine-Learning-Algorithmic-Trading-alternative/dp/1839217715?pf_rd_r=GZH2XZ35GB3BET09PCCA&pf_rd_p=c5b6893a-24f2-4a59-9d4b-aff5065c90ec&pd_rd_r=91a679c7-f069-4a6e-bdbb-a2b3f548f0c8&pd_rd_w=2B0Q0&pd_rd_wg=GMY5S&ref_=pd_gw_ci_mcx_mr_hp_d) aims to show how ML can add value to algorithmic trading strategies in a practical yet comprehensive way. It covers a broad range of ML techniques from linear regression to deep reinforcement learning and demonstrates how to build, backtest, and evaluate a trading strategy driven by model predictions.
In four parts with **23 chapters plus an appendix**, it covers on **over 800 pages**:
- important aspects of data sourcing, **financial feature engineering**, and portfolio management,
- the design and evaluation of long-short **strategies based on supervised and unsupervised ML algorithms**,
- how to extract tradeable signals from **financial text data** like SEC filings, earnings call transcripts or financial news,
- using **deep learning** models like CNN and RNN with market and alternative data, how to generate synthetic data with generative adversarial networks, and training a trading agent using deep reinforcement learning
<p align="center">
<a href="https://www.amazon.com/Machine-Learning-Algorithmic-Trading-alternative/dp/1839217715?pf_rd_r=GZH2XZ35GB3BET09PCCA&pf_rd_p=c5b6893a-24f2-4a59-9d4b-aff5065c90ec&pd_rd_r=91a679c7-f069-4a6e-bdbb-a2b3f548f0c8&pd_rd_w=2B0Q0&pd_rd_wg=GMY5S&ref_=pd_gw_ci_mcx_mr_hp_d">
<img src="https://ml4t.s3.amazonaws.com/assets/cover_toc_gh.png" width="75%">
</a>
</p>
This repo contains **over 150 notebooks** that put the concepts, algorithms, and use cases discussed in the book into action. They provide numerous examples that show
- how to work with and extract signals from market, fundamental and alternative text and image data,
- how to train and tune models that predict returns for different asset classes and investment horizons, including how to replicate recently published research, and
- how to design, backtest, and evaluate trading strategies.
> We **highly recommend** to review the notebooks while reading the book; they are usually in executed state and often contain additional information that the space constraints of the book did not permit to include.
## What's new in the 2<sup>nd</sup> Edition?
First and foremost, this [book](https://www.amazon.com/Machine-Learning-Algorithmic-Trading-alternative/dp/1839217715?pf_rd_r=VMKJPZC4N36TTZZCWATP&pf_rd_p=c5b6893a-24f2-4a59-9d4b-aff5065c90ec&pd_rd_r=8f331266-0d21-4c76-a3eb-d2e61d23bb31&pd_rd_w=kVGNF&pd_rd_wg=LYLKH&ref_=pd_gw_ci_mcx_mr_hp_d) demonstrates how you can extract signals from a diverse set of data sources and design trading strategies for different asset classes using a broad range of supervised, unsupervised, and reinforcement learning algorithms. It also provides relevant mathematical and statistical knowledge to facilitate the tuning of an algorithm or the interpretation of the results. Furthermore, it covers the financial background that will help you work with market and fundamental data, extract informative features, and manage the performance of a trading strategy.
From a practical standpoint, the 2nd edition aims to equip you with the conceptual understanding and tools to develop your own ML-based trading strategies. To this end, it frames ML as a critical element in a process rather than a standalone exercise, introducing the end-to-end ML for trading workflow from data sourcing, feature engineering, and model optimization to strategy design and backtesting.
More specifically, the ML4T workflow starts with generating ideas for a well-defined investment universe, collecting relevant data, and extracting informative features. It also involves designing, tuning, and evaluating ML models suited to the predictive task. Finally, it requires developing trading strategies to act on the models' predictive signals, as well as simulating and evaluating their performance on historical data using a backtesting engine. Once you decide to execute an algorithmic strategy in a real market, you will find yourself iterating over this workflow repeatedly to incorporate new information and a changing environment.
<p align="center">
<img src="https://i.imgur.com/kcgItgp.png" width="75%">
</p>
The [second edition](https://www.amazon.com/Machine-Learning-Algorithmic-Trading-alternative/dp/1839217715?pf_rd_r=GZH2XZ35GB3BET09PCCA&pf_rd_p=c5b6893a-24f2-4a59-9d4b-aff5065c90ec&pd_rd_r=91a679c7-f069-4a6e-bdbb-a2b3f548f0c8&pd_rd_w=2B0Q0&pd_rd_wg=GMY5S&ref_=pd_gw_ci_mcx_mr_hp_d)'s emphasis on the ML4t workflow translates into a new chapter on [strategy backtesting](08_ml4t_workflow), a new [appendix](24_alpha_factor_library) describing over 100 different alpha factors, and many new practical applications. We have also rewritten most of the existing content for clarity and readability.
The trading applications now use a broader range of data sources beyond daily US equity prices, including international stocks and ETFs. It also demonstrates how to use ML for an intraday strategy with minute-frequency equity data. Furthermore, it extends the coverage of alternative data sources to include SEC filings for sentiment analysis and return forecasts, as well as satellite images to classify land use.
Another innovation of the second edition is to replicate several trading applications recently published in top journals:
- [Chapter 18](18_convolutional_neural_nets) demonstrates how to apply convolutional neural networks to time series converted to image format for return predictions based on [Sezer and Ozbahoglu](https://www.researchgate.net/publication/324802031_Algorithmic_Financial_Trading_with_Deep_Convolutional_Neural_Networks_Time_Series_to_Image_Conversion_Approach) (2018).
- [Chapter 20](20_autoencoders_for_conditional_risk_factors) shows how to extract risk factors conditioned on stock characteristics for asset pricing using autoencoders based on [Autoencoder Asset Pricing Models](https://www.aqr.com/Insights/Research/Working-Paper/Autoencoder-Asset-Pricing-Models) by Shihao Gu, Bryan T. Kelly, and Dacheng Xiu (2019), and
- [Chapter 21](21_gans_for_synthetic_time_series) shows how to create synthetic training data using generative adversarial networks based on [Time-series Generative Adversarial Networks](https://papers.nips.cc/paper/8789-time-series-generative-adversarial-networks) by Jinsung Yoon, Daniel Jarrett, and Mihaela van der Schaar (2019).
All applications now use the latest available (at the time of writing) software versions such as pandas 1.0 and TensorFlow 2.2. There is also a customized version of Zipline that makes it easy to include machine learning model predictions when designing a trading strategy.
## Installation and Data Sources
- For instructions on using a Docker image or setting up various `conda` environments to install the packages used in the notebooks, see [here](installation/README.md).
- To download and preprocess many of the data sources used in this book see [create_datasets](data/create_datasets.ipynb).
# Chapter Summary
The [book](https://www.amazon.com/Machine-Learning-Algorithmic-Trading-alternative/dp/1839217715?pf_rd_r=GZH2XZ35GB3BET09PCCA&pf_rd_p=c5b6893a-24f2-4a59-9d4b-aff5065c90ec&pd_rd_r=91a679c7-f069-4a6e-bdbb-a2b3f548f0c8&pd_rd_w=2B0Q0&pd_rd_wg=GMY5S&ref_=pd_gw_ci_mcx_mr_hp_d) has four parts that address different challenges that arise when sourcing and working with market, fundamental and alternative data sourcing, developing ML solutions to various predictive tasks in the trading context, and designing and evaluating a trading strategy that relies on predictive signals generated by an ML model.
> The directory for each chapter contains a README with additional information on content, code examples and additional resources.
[Part 1: From Data to Strategy Development](#part-1-from-data-to-strate
没有合适的资源?快使用搜索试试~ 我知道了~
Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original...
共360个文件
ipynb:158个
npy:94个
md:37个
5星 · 超过95%的资源 需积分: 50 59 下载量 40 浏览量
2021-05-26
16:41:28
上传
评论 1
收藏 124.4MB ZIP 举报
温馨提示
ML交易-第二版 旨在说明ML如何以实用而全面的方式为算法交易策略增加价值。 它涵盖了从线性回归到深度强化学习的各种机器学习技术,并演示了如何建立,回测和评估由模型预测驱动的交易策略。 本书分为四个部分,共23章,另加附录,涵盖800余页: 数据采购,财务功能工程和资产组合管理的重要方面, 基于监督和无监督的机器学习算法的多空策略的设计和评估, 如何从SEC文件,收益电话记录或财务新闻等财务文本数据中提取可交易信号, 使用带有市场和替代数据的CNN和RNN等深度学习模型,如何使用生成的对抗网络生成综合数据,以及使用深度强化学习来训练交易代理 此回购包含150多个笔记本,这些笔记本将书中讨论的概念,算法和用例付诸实践。 他们提供了许多例子,说明 如何处理市场,基本和替代文本和图像数据并从中提取信号, 如何训练和调整可预测不同资产类别和投资范围的回报的模型,包括如何复制最近发表的
资源详情
资源评论
资源推荐
收起资源包目录
Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original:机器学习用于算法交易,第二版-Packt出版 (360个子文件)
scrapy.cfg 231B
kc_house_data.csv 2.4MB
us_equities_meta_data.csv 541KB
wiki_stocks.csv 81KB
lda_multicore_test_results.csv 318B
TED2013_sample.en 2KB
TED2013_sample.es 2KB
timeseries_windowing.gif 384KB
01_deep_convolutional_generative_adversarial_network.ipynb 18.43MB
03_manifold_learning_tsne_umap.ipynb 12.67MB
02_manifold_learning_lle.ipynb 9.57MB
06_evaluate_trading_signals.ipynb 7.03MB
02_common_alpha_factors.ipynb 3.88MB
02_pymc3_workflow.ipynb 3.62MB
07_model_interpretation.ipynb 3.05MB
03_101_formulaic_alphas.ipynb 2.82MB
01_boosting_baseline.ipynb 2.59MB
07_backtesting_with_zipline.ipynb 2.51MB
01_manifold_learning_intro.ipynb 2.46MB
05_backtesting_with_zipline.ipynb 2.39MB
08_backtesting_with_zipline.ipynb 2.36MB
09_backtesting_with_zipline.ipynb 2.22MB
03_ml4t_with_zipline.ipynb 2.13MB
02_backtesting_with_zipline.ipynb 1.99MB
02_arima_models.ipynb 1.88MB
07_alphalens_analysis.ipynb 1.74MB
01_hierarchical_risk_parity.ipynb 1.62MB
03_backtesting_with_backtrader.ipynb 1.61MB
04_lda_with_sklearn.ipynb 1.51MB
03_bayesian_sharpe_ratio.ipynb 1.51MB
04_factor_evaluation.ipynb 1.46MB
01_deep_autoencoders.ipynb 1.45MB
03_image_classification_with_alexnet.ipynb 1.3MB
06_performance_eval_alphalens.ipynb 1.28MB
03_kalman_filter_and_wavelets.ipynb 1.23MB
07_pairs_trading_backtest.ipynb 1.22MB
04_vector_autoregressive_model.ipynb 1.03MB
05_density_based_clustering.ipynb 943KB
01_machine_learning_workflow.ipynb 937KB
03_variational_autoencoder.ipynb 866KB
07_sec_filings_return_prediction.ipynb 831KB
06_lda_earnings_calls.ipynb 809KB
04_rolling_regression.ipynb 760KB
01_clustering_algos.ipynb 757KB
02_rebuild_nasdaq_order_book.ipynb 747KB
03_kmeans_evaluation.ipynb 639KB
05_predicting_stock_returns_with_linear_regression.ipynb 634KB
04_mean_variance_optimization.ipynb 593KB
04_optimizing_a_NN_architecture_for_trading.ipynb 558KB
01_linear_regression_intro.ipynb 532KB
03_arch_garch_models.ipynb 509KB
01_decision_trees.ipynb 494KB
03_pyfolio_demo.ipynb 494KB
01_tsa_and_stationarity.ipynb 485KB
07_lda_financial_news.ipynb 474KB
01_filter_example.ipynb 457KB
02_TimeGAN_TF2.ipynb 455KB
02_kmeans_implementation.ipynb 425KB
02_the_math_behind_pca.ipynb 425KB
06_conditional_autoencoder_for_asset_pricing_model.ipynb 424KB
11_satellite_images.ipynb 420KB
03_sklearn_gbm_tuning_results.ipynb 408KB
10_transfer_learning.ipynb 399KB
05_random_forest_return_signals.ipynb 386KB
04_hierarchical_clustering.ipynb 376KB
edgar_xbrl.ipynb 358KB
02_how_to_use_talib.ipynb 358KB
03_evaluating_synthetic_data.ipynb 351KB
06_gaussian_mixture_models.ipynb 349KB
05_cointegration_tests.ipynb 343KB
02_bagged_decision_trees.ipynb 337KB
03_lobster_itch_data.ipynb 334KB
05_stochastic_volatility.ipynb 326KB
05_zipline_data_demo.ipynb 320KB
03_normalize_tick_data.ipynb 295KB
01_build_and_train_feedforward_nn.ipynb 294KB
00_data_prep.ipynb 293KB
01_univariate_time_series_regression.ipynb 290KB
01_pandas_datareader_demo.ipynb 289KB
06_statistical_arbitrage_with_cointegrated_pairs.ipynb 282KB
03_bias_variance.ipynb 277KB
03_pca_and_risk_factor_models.ipynb 276KB
04_japanese_equity_features.ipynb 267KB
01_pca_key_ideas.ipynb 260KB
04_multivariate_timeseries.ipynb 260KB
09_bottleneck_features.ipynb 243KB
03_preparing_the_model_data.ipynb 233KB
02_fama_macbeth.ipynb 226KB
04_manifold_learning_asset_prices.ipynb 224KB
01_backtest_with_trades.ipynb 221KB
05_kelly_rule.ipynb 207KB
02_digit_classification_with_lenet5.ipynb 206KB
08_doc2vec_yelp_sentiment.ipynb 201KB
07_factor_library_quantopian.ipynb 198KB
02_backtest_with_pf_optimization.ipynb 195KB
04_statistical_inference_of_stock_returns_with_statsmodels.ipynb 193KB
02_convolutional_denoising_autoencoders.ipynb 189KB
01_using_pretrained_vectors.ipynb 185KB
04_build_us_stock_dataset.ipynb 177KB
05_alphalens_analysis.ipynb 171KB
共 360 条
- 1
- 2
- 3
- 4
楼小雨
- 粉丝: 23
- 资源: 4694
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1