Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prediction in Stock Trading

Similar presentations


Presentation on theme: "Prediction in Stock Trading"— Presentation transcript:

1 Prediction in Stock Trading
J.-S. Roger Jang (張智星) MIR Lab, CSIE Dept. National Taiwan University 2019/5/3

2 Types of Predictions in Stock Trading
Up/down prediction: Classification Use historical data as groundtruth (GT) Price prediction: Regression Use historical data as GT Timing prediction for “buy” and “sell” to maximize profit Set up groundtruth  How? Use historical data to do prediction Historical data from 技術面、消息面、基本面… Backtest (回測)

3 GT for “Buy” and “Sell”: Heuristic Approaches
Heuristic approaches to set up GT 慣量型 連漲三天 買!(因為還會上漲…) 連跌三天 賣!(因為還會下跌…) 逆勢型 連漲五天  賣!(因為快開始跌了…) 連跌五天  買!(因為快開始漲了…) 謹慎小心型 上漲超過買價的10%  賣! 下跌超過賣價的10%  買! Performance can be evaluated by backtest. Quiz!

4 GT for “Buy” and “Sell”: Optimal Approach
Problem definition Given the price curve over a long period of time, find “buy” and “sell” points (where you can look into the future) such that the overall profit is maximized. Assumptions 每一次都全買或全賣 根據開盤價格來買或賣,一定會成交 必須計算交易費 Approaches Optimal search: Dynamic programming Heuristic search: Genetic algorithms, simulated annealing, randomized search?

5 Set Up GT for Max. Profit in HW05
HW05: How can we set up GT for “buy” and “sell” points, such that the overall profit can be maximized? MATLAB functions Function submitted by you: actionVec = myOptimAction(priceVec, transFeeRate); Evaluation by our judge system returnRate = profitEstimateOpen(priceVec, transFeeRate, actionVec); Scoring is based on your ranking! All price data is here!

6 Prediction of GT Derived by Optimal Methods
2019/5/3 For a given date Predict all the future price using historical data Run DP to predict all the “buy” and “sell” points based on the predicted price Execute the predicted plan for tomorrow Future price prediction Time series prediction (regression) One-step-ahead prediction 𝑥 𝑛 =𝑓( 𝑥 𝑛−𝑑 , 𝑥 𝑛−𝑑−1 ,…, 𝑥 𝑛−1 ), 𝑥 𝑛 ∈𝑅. Accumulated prediction: 𝑥 1 , 𝑥 2 , 𝑥 3 , 𝑥 4 , 𝑥 5 , 𝑥 6 , 𝑥 7 , 𝑥 8 , 𝑥 9 , 𝑥 10 K-step-ahead prediction

7 Prediction of GT Derived by Heuristics
2019/5/3 For a given date Predict “up for m days” or “down for n days” Execute the predicted plan for tomorrow if the prediction tell us to “buy” or “sell” Future price prediction Prediction of up/down (classification) One-step-ahead prediction: 𝑥 𝑛 =𝑓 𝑥 𝑛−𝑑 , 𝑥 𝑛−𝑑−1 ,…, 𝑥 𝑛−1 , 𝑥 𝑛 ∈ ±1 . Accumulated prediction: 𝑥 1 , 𝑥 2 , 𝑥 3 , 𝑥 4 , 𝑥 5 , 𝑥 6 , 𝑥 7 , 𝑥 8 , 𝑥 9 , 𝑥 10 K-step-ahead prediction

8 References and Resources
2019/5/3 MATLAB Time Series Forecasting Using Deep Learning Time Series Prediction and Forecasting for Prognosis Time Series Analysis Python 7 methods to perform Time Series forecasting A comprehensive beginner’s guide to create a Time Series Forecast 11 Classical Time Series Forecasting Methods in Python


Download ppt "Prediction in Stock Trading"

Similar presentations


Ads by Google