trading using deep learning man vs machine
play

TRADING USING DEEP LEARNING MAN VS MACHINE Orders By Algorithms - PowerPoint PPT Presentation

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


  1. TRADING USING DEEP LEARNING

  2. MAN VS MACHINE Orders By Algorithms 84% Orders By Human 16% TRADING USING DEEP LEARNING

  3. 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

  4. DEEP LEARNING SUPERIORITY Deep Learning 96.92% Human 94.9% ref: http://www.image-net.org/challenges/LSVRC/ DEEP META LEARNING

  5. GRADIENT DESCENT π‘₯ 𝑒 = π‘₯ π‘’βˆ’1 βˆ’ 𝛿 πœ–πΉ πœ–π‘₯ 𝐹 = Error of the network 𝑋 = Weight matrix representing the filters DEEP META LEARNING

  6. 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

  7. Learning From Examples. Supervised Learning in a nutshell. CAT

  8. 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

  9. 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

  10. .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

  11. Strategy Universe Strategy Configurations Configuration Trading Decision Utility 1 - buy 0 - hold P&L / Drawdown -1 - Sell DEEP REINFORCEMENT LEARNING

  12. 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

  13. 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

  14. DEEP LEARNING IN FINANCE

  15. DEEP APPLYING DEEP LEARNING TO ENHANCE LEARNING MOMENTUM TRADING STRATEGIES IN STOCKS IN FINANCE

  16. 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

  17. DEEP DEEP MODELING COMPLEX COUPLINGS WITHIN LEARNING FINANCIAL MARKETS IN FINANCE

  18. 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

  19. DEEP DEEP LEARNING FOR MULTIVARIATE FINANCIAL LEARNING TIME SERIES IN FINANCE

  20. 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

  21. DEEP IMPLEMENTING DEEP NEURAL NETWORKS FOR LEARNING FINANCIAL MARKET PREDICTION IN FINANCE

  22. 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

  23. DEEP DEEP LEARNING IN FINANCE LEARNING IN FINANCE

Recommend


More recommend