8000 GitHub - balaboom123/Taiwan_Stock_Predictor
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

balaboom123/Taiwan_Stock_Predictor

Repository files navigation

tw_stock_predictor

paper

link: https://drive.google.com/file/d/18LaSD_i7G3_wZnDFkqbBoT5IaZPyrHqu/view?usp=sharing

Dataset

auto_update.py

download data from: https://www.twse.com.tw/exchangeReport/MI_5MINS_INDEX
This file is responsible for automatically updating stock datafrom TWSE(Taiwan Stock Exchange).
It utilizes finlab.crawler to fetch data.

flowchart LR
A(TWSE) -->|auto_update.py| B(collect data)
B(collect data) -->|data wrangling| C(save)
Loading

traditional strategy

traditional_strategy.py

calculate the deviation rate between the quarterly moving average and the daily chart.
When the stock price is greater than one standard deviation above the deviation rate, buy it.
When it's lower than one standard deviation below the deviation rate, sell it (buy high, sell low).
At the same time, including the transaction fees of Taiwan Stock Exchange into the cost.

graph LR
A[get moving average] -->|calculate| B(standard deviation)
B --> C{greater or lower?}
C -->|greater| D[Buy]
C -->|lower| E[Sell]
Loading

GradientBoost predictor

GradientBoost.py

This file uses GradientBoostingRegressor to predict stock prices. It first fetches data from finlab.data, performs feature engineering, and then trains the model.

flowchart LR
A(data) -->|GradientBoost.py| B(training complete)
B(training complete) -->|backtest| C(return)
Loading

lgbm_BetterParams.py

use to optimize the parameters compute the best parameters for GradientBoost to fit the data. website: https://medium.com/@pushkarmandot/https-medium-com-pushkarmandot-what-is-lightgbm-how-to-implement-it-how-to-fine-tune-the-parameters-60347819b7fc

RandomForest and traditional strategy predictor

RandomForest.py

This file uses RandomForestRegressor to find the best features that influence stock the most. Then, combine them with tradition strategy. theory: https://link.springer.com/content/pdf/10.1023/A:1010933404324.pdf

flowchart LR
A(data) -->|RandomForest.py| B(training complete)
B(training complete) -->|backtest| C(return)
Loading

Finlab

graph TD
    finlab_backtest["finlab.backtest"] -->|provide| backtest["backtest"]
    finlab_crawler["finlab.crawler"] -->|provide| scraping_stock_data["scraping stock data"]
    finlab_data["finlab.data"] -->|provide| obtain_and_process_data["obtain and process data"]
    finlab_labels["finlab.labels"] -->|provide| generate_stock_labels["generate stock labels"]
    finlab_ml["finlab.ml"] -->|provide| tools_for_machine_learning["tools for machine learning"]
    finlab_utility["finlab.utility"] -->|provide| several_tools["several tools"]
Loading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0