Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

quantmachine

Application for Analyzing Financial Time Series

  • Login to see the comments

quantmachine

  1. 1. Quant Machine Application for Analyzing Financial Time Series quantmachine.xyz
  2. 2. Problem Statement Knowing the performance of foreign markets, determine if the US stock market will be bullish or bearish (up/down) Forecast the return of a given stock in S&P500 in terms of historical returns of all stocks in the same set How much profit can we make trading based on this forecast?
  3. 3. Problem Statement Universe of stocks: {𝑠𝑖}𝑖=1 𝑁  Adjusted Close price of stock 𝑠𝑖 at time 𝑡 : 𝑃(𝑠𝑖, 𝑡)  Return of stock 𝑠𝑖 at time 𝑡: 𝑅 𝑠𝑖, 𝑡 = 𝑃 𝑠 𝑖, 𝑡 − 𝑃(𝑠 𝑖, 𝑡−1) 𝑃(𝑠 𝑖, 𝑡−1)  Assume 𝑟 is either 𝑅 (continuous) or 𝑠𝑖𝑔𝑛 𝑅 (discrete)  We want to find 𝐹 (regressor/classifier) if it exists, such that: 𝑟(𝑠𝑖, 𝑡) = 𝐹[ 𝑟 𝑠1, 𝑡 − 1 , 𝑟 𝑠1, 𝑡 − 2 , … , 𝑟(𝑠 𝑛, , 𝑡 − 𝑛𝑙𝑎𝑔𝑠) ]
  4. 4. Motivation In many trading strategies, additional insight about the directional moves of stock returns can significantly improve performance This application will provide useful analytics for retail algorithmic traders and day-traders in general
  5. 5. Data Dates IBM_lag1 IBM_lag2 MSFT_lag1 MSFT_lag2 … IBM_vol_lag1 6/25/2016 - 5.65% +0.03% - 3.99% +1.02% +5.5% 6/24/2016 +0.03% +1.55% +1.02% - 0.52% +2.5% Samples are trading days Table of daily returns (including % change of volume) IBM is the stock of interest Number of Lags is 2 Features Dates IBM_lag1 IBM_lag2 MSFT_lag1 MSFT_lag2 … IBM_vol_lag1 6/25/2016 - 1 +1 - 1 +1 +1 6/24/2016 +1 +1 +1 - 1 +1 Table of daily directional moves # Features ≤ # Samples
  6. 6. FEATURE EXTRACTION DATA MACHINE LEARNING TOOLS PREDICTIONS ECONOMETRIC TOOLS • NYSE, Asian Markets + lags • PCA • VIF • Lasso • ARIMA(p, r, q), GARCH(1, 1) • Regressors • Classifiers • Returns • Pairs
  7. 7. Feature Selection For Classifiers • Select features according to k highest scores • Recursive Feature Elimination For Regressors • Lasso • Multicollinearity Reduction
  8. 8. Game of Markets Hours Open Nasdaq Frankfurt London Hong Kong Shanghai Japan (Nikkei) Australia UTC times 14:30-21:00 07:00-19:00 08:00-16:30 01:30-08:00 01:30-07:00 00:00-06:00 00:00-6:00
  9. 9. Validation Model Validation (get the best hyper parameters) Time Series require specific type of validation to preserve causality Moving or cascading window technique is used Model Selection (get the most predictive model) Model that performed the best on a validation set is used as a predictor on a test set
  10. 10. ROC Example of ROC and AUC for one of the classifiers
  11. 11. ARIMA Model Forecasting returns using ARIMA(p, r, q) model
  12. 12. ARIMA Model Checking (partial) autocorrelation and normality of residues
  13. 13. Hidden Markov Model Simple application of Gaussian HMM

×