TRADING USING DEEP LEARNING
MAN VS MACHINE Orders By Algorithms 84% Orders By Human 16% TRADING USING DEEP LEARNING
Artificial Neural Networks Neural networks are a family of models inspired by biological brain structure and are used to estimate or approximate functions that can depend on a large number of inputs and are generally unknown. Recent breakthroughs in artificial neural networks led to a modern renascence in AI. TRADING USING DEEP LEARNING
DEEP LEARNING SUPERIORITY Deep Learning 96.92% Human 94.9% ref: http://www.image-net.org/challenges/LSVRC/ DEEP META LEARNING
GRADIENT DESCENT π₯ π’ = π₯ π’β1 β πΏ ππΉ ππ₯ πΉ = Error of the network π = Weight matrix representing the filters DEEP META LEARNING
GRADIENT BASED MODELS 1: Forward Propagation 2: Loss Calculation Legend 3: Optimization π§ πΉ = π ΰ· π§, π§ π§ β Ground Truth ππΉ = ππ ΰ· π§, π§ π¦ 0 - Features Vector π π π¦ π , π₯ π = ΰ· π§ ππ¦ π ππ¦ π π¦ π - Output of π layer π₯ π πΆπππ ππ ππππππ’πππ ππΉ = ππΉ ππ π π¦ πβ1 , π₯ π π πβ1 (π¦ πβ1 , π₯ πβ1 ) π₯ π - Weights of π layer πΊππ π₯ππ π ππ ππππππ’πππ π₯ πβ1 ππ¦ πβ1 ππ¦ π π¦ πβ1 π§ β Model Output ΰ· π πβ2 (π¦ πβ2 , π₯ πβ2 ) ππΉ = ππΉ ππ π π¦ πβ1 , π₯ π π ΰ· π§, π§ ππ₯ π ππ¦ π ππ₯ π - Loss Function πΉ β Loss Surface ππΉ ππΉ ππ πβ1 π¦ πβ2 , π₯ πβ1 = π 2 (π¦ 2 , π₯ 2 ) ππ¦ πβ2 ππ¦ πβ1 π¦ πβ2 π β Activation Function π₯ 1 ππΉ ππΉ ππ π π¦ πβ2 , π₯ πβ1 π 1 (π¦ 1 , π₯ 1 ) = ππ₯ πβ1 ππ¦ πβ1 ππ₯ πβ1 π₯ 0 π 0 (π¦ 0 , π₯ 0 ) β¦ π¦ 0 β¦ DEEP META LEARNING
Learning From Examples. Supervised Learning in a nutshell. CAT
FINNANCIAL PREDICTION PITFALLS Importance Overfitting Behavior Data Importance is Overfitted easily, Behavior of financial questionable and most models have markets change all the determination of poor predictive time and can be really meaningful data is capabilities unpredictable. hard. On financial data. Much Data No Theory Noisy Data Possible relevant Complex non-linear Noise In financial data data from many interactions in the data Is very common and markets is incredibly are not well specified sometimes large. by financial theory. distinguishing noise from behavior is hard. TRADING USING DEEP LEARNING
WHY DEEP LEARNING? Importance Overfitting Behavior Data Importance is Overfitted easily, Behavior of financial questionable and most models have markets change all the determination of poor predictive time and can be really meaningful data is capabilities unpredictable. hard. On financial data. Much Data No Theory Noisy Data Possible relevant Complex non-linear Noise In financial data data from many interactions in the data Is very common and markets is incredibly are not well specified sometimes large. by financial theory. distinguishing noise from behavior is hard. TRADING USING DEEP LEARNING
.5 .5 .5 .5 1 2 3 4 35:09.9 37:08.7 38:59.2 40:38.7 160.5 161.5 162.5 163.5 42:17.6 161 162 163 164 43:49.0 45:35.9 35:09.9 47:55.2 36:57.2 49:32.2 38:04.2 51:02.2 40:03.3 52:25.6 41:06.0 54:24.2 42:41.7 56:31.8 44:12.7 58:27.3 45:35.9 59:58.8 47:39.1 01:43.3 49:05.9 03:22.2 50:17.6 08:03.3 51:31.1 10:11.6 53:04.0 14:04.0 BACK TO FINANCE 54:36.3 17:37.5 56:31.8 21:19.2 58:07.0 26:03.8 59:29.3 30:46.0 00:57.2 33:07.0 02:31.0 36:54.2 04:05.5 TRADING USING DEEP LEARNING 40:00.4 08:16.0 43:27.5 10:11.6 48:22.7 12:09.7 52:26.2 17:17.8 54:59.0 20:37.3 57:33.4 22:09.9 01:00.6 28:36.1 04:41.4 30:52.1 08:23.5 33:07.0 11:20.4 36:46.1 ? 15:44.1 39:29.7 19:15.9 42:05.1 21:24.3 46:26.1 25:00.7 49:55.8 30:25.5 53:08.2 37:26.4 54:59.0 43:34.5 57:12.2 47:56.6 00:35.6 53:40.0 04:10.1 01:46.4 06:56.1 21:12.6 09:30.2 31:31.7 12:35.7 44:02.0 15:44.1 59:33.3 19:03.8 12:50.0 21:05.0 23:13.6 28:12.2 32:33.9 38:22.9 43:34.5 46:47.4 52:54.0 00:33.2 09:54.6 22:43.6 33:06.1 44:02.0 59:27.2 03:38.7 14:35.6
Strategy Universe Strategy Configurations Configuration Trading Decision Utility 1 - buy 0 - hold P&L / Drawdown -1 - Sell DEEP REINFORCEMENT LEARNING
Technical Analysis Technical analysis Might of might not work, One thing for sure: Very hard to generalize. TA-Lib : Technical Analysis Library talib.SMA( β¦ talib.MOM( β¦ DEEP LEARNING IN FINANCE
Successful Technical Trading Agents Using Farnsworth , Genetic Programming 2004 Surprisingly, Genetic programing can be very successful when It comes to financial strategies gp = SymbolicRegressor(... gp.fit(X_train, y_train) DEEP LEARNING IN FINANCE
DEEP LEARNING IN FINANCE
DEEP APPLYING DEEP LEARNING TO ENHANCE LEARNING MOMENTUM TRADING STRATEGIES IN STOCKS IN FINANCE
APPLYING DEEP LEARNING TO ENHANCE MOMENTUM TRADING STRATEGIES IN L Takeuchi, STOCKS 2013 FEATURE ENGINEERI 12 Monthly Returns NG For every month: Daily cumulative returns Z-score Against other cumulative returns of other stocks Flag if January πΊπππ’π£π π ππππ’ππ π»π ππ£ππ ππ π£π’β π»π ππ£ππ ππ π£π’β π’+π πππ π’ β ππ‘π π’β12 πππ π’+1 β ππ‘π π’β12 ππππ’βππ‘ππ’β12 ππππ’βππ‘ππ’β12 βπ βπ π: > ΰ· π π : Ο π’β12 | π β (1,11) , βͺ 1 ππ π’ ππ ππππ£ππ π§ πππ‘π 0 π π : Ο π’β12 | π β (1,11) , βͺ 1 ππ π’ ππ ππππ£ππ π§ πππ‘π 0 π’+π ππ‘ππ’β12 π’+π ππ‘ππ’β12 ππ‘π π’β12 ππ‘π π’β12 π π π’β12 MODEL K - Fold Stacked Not Written 33 40 4 50 33 2 40 RBMs Layers size found by grid search Hyper Parameters Structure Layers RESULT S Confusion Matrix Accuracy: 53.061% Predicted Predicted Precision: 61.224% True False True Recall: 53.659% 22.38% 27.45% False 19.19 % 30.97% DEEP LEARNING IN FINANCE
DEEP DEEP MODELING COMPLEX COUPLINGS WITHIN LEARNING FINANCIAL MARKETS IN FINANCE
DEEP MODELING COMPLEX COUPLINGS WITHIN FINANCIAL MARKETS FEATURE ENGINEERI Used Deep Belief Network to find hidden couplings between markets NG Used Past Prices of stocks and forex as features Unsupervised Learning Model πΊπππ’π£π π ππππ’ππ π π : π π βͺ πΊ π S R MODEL T Loss: Negative Log B O C R R M Likelihood DBN of Stacked K B B Optimizer: SGD RBMs Note: No Cross Validation in F R M M O B R paper E M Hyper Parameters Structure X Layers RESULT S DEEP LEARNING IN FINANCE
DEEP DEEP LEARNING FOR MULTIVARIATE FINANCIAL LEARNING TIME SERIES IN FINANCE
DEEP LEARNING FOR MULTIVARIATE FINANCIAL TIME SERIES FEATURE ENGINEERI Matrix of log returns over all the stocks NG Z-score Against other stocks log returns Flag if January πΊπππ’π£π π ππππ’ππ π»π ππ£ππ ππ π£π’β π»π ππ£ππ ππ π£π’β ππππ’ log βπ | π β (β33, β2) , βͺ 1 ππ π’ ππ ππππ£ππ π§ πππ‘π 0 π: 1 ππ ππ πππ ππ‘ ππ€ππ ππππππ ππ’ π’ + 1 ππ‘ππ’β1 π π : π β Deep β Belief Net Fully Connected MODEL Loss: Negative Log Likelihood DBN Connected to D R R R Regularization: π 1 E MLP B CrosVal: Tarining: 70%, Valid: 15%, Test: B B N Activation: π’ππβ 1 S M M M Optimizer: ADAGrad 15% e Hyper Parameters Structure Layers RESULT S DEEP LEARNING IN FINANCE
DEEP IMPLEMENTING DEEP NEURAL NETWORKS FOR LEARNING FINANCIAL MARKET PREDICTION IN FINANCE
IMPLEMENTING DEEP NEURAL NETWORKS FOR FINANCIAL MARKET PREDICTION FEATURE ENGINEERI All moving averages from 5 to 100 NG List of 100 lagged prices Pearson correlation between the returns (all 100) of the stock and all the other stocks(45) πΊπππ’π£π π ππππ’ππ π»π ππ£ππ ππ π£π’β π»π ππ£ππ ππ π£π’β πβ100 π π’ β π π’β1 100 π π: α« βͺ α« ππ΅( π, π) βͺ α« π(π, π π ) π β 1,0, β1 πππ ππ£π§, π‘πππ, βπππ π π’β1 π π=5 π=1 Fully Connected MODEL Loss: Categorical Cross Simple Fully Entropy CrosVal: Tarining: 80%, Test: Connected Activation: 100 135 1 9895 1000 ReLU, π‘πππ’πππ¦ 20% Training Algorithm: Walk Optimizer: SGD forward Hyper Parameters Structure Layers RESULT S Accuracy: 73% F1 Score: 0.4 DEEP LEARNING IN FINANCE
DEEP DEEP LEARNING IN FINANCE LEARNING IN FINANCE
Recommend
More recommend