🔥 ... The project will be updated continuously ...... 🔥
This repository collects my example codes in Python for studing in The Stock Exchange of Thailand (SET) (not yet).
All examples are written in Python language, so you need to setup your environments as below.
- First, install ANACONDA.
- For Deep learning, I used 2 library including TensorFlow and Keras.
You can install TensorFlow from PyPI with the command.
pip install tensorflow
And you can also install Keras from PyPI with the command.
pip install keras
- Install pandas_datareader for getting data from yahoo finance and also install fix_yahoo_finance (fix bugs).
pip install pandas_datareader
pip install fix_yahoo_finance
- Install googlefinance for getting data from google finance.
pip install googlefinance
- Install tqdm to make my loops show a smart progress meter on console
pip install tqdm
Download datasets (EOD data files from SET)
Since Bank of Thailand (BOT) has provided 21 APIs for query data including Exchange rate, Interest Rate and Debt securities auction so I would like to show examples howto use 2 APIs such as
- Daily Weighted-average Interbank Exchange Rate - THB / USD
- Daily Average Exchange Rate - THB / Foreign Currency
For example codes in HTML+JavaScript, JavaScript with Node.js and Python, I shared at here
An example when using "Daily Weighted-average Interbank Exchange Rate - THB / USD" API
2) Datasets of The Stock Exchange of Thailand (SET)
I use datasets from http://siamchart.com/stock/ that is a EOD file.
- siamchart_csv.py use convert the EOD file to stock csv files.
- siamchart_csv2db.py use convert the stock csv files to SQL database (sqlite).
- siamchart_csv2json.py use convert the stock csv file to json files.
3) indicator.py
There are my examples to compute the technical indicators for securities including
- ROC
- Bollinger Band (BBANDS)
- daily returns
- SMA and EMA
- MACD and signal
- RSI
- Sharpe ratio
- True Range (TR) and ATR
- Beta
- K% and D%
- OBV
- compute gain
- and etc
I'm trying to apply Deep Learning (LSTM network) to predict a stock trend (not complete).
.... ✍ Pending
I'm trying to apply Deep Reinforcement Learning (Deep Q-learning) as stated in the paper Playing Atari with Deep Reinforcement Learning to automatic trading (work in progress)
- DeepQ_trade.py is first version (not complete).
- RL_trader is second version that I borrowed some codes from https://github.com/cstorm125/rl_trader as Deep Q-learning for Bitcoin (not complete).
I Borrowed some codes from
- https://www.udacity.com/course/machine-learning-for-trading--ud501
- http://matplotlib.org/examples/pylab_examples/finance_demo.
- https://github.com/cstorm125/rl_trader
- https://www.udacity.com/course/machine-learning-for-trading--ud501
- https://www.datacamp.com/community/tutorials/finance-python-trading
- Playing Atari with Deep Reinforcement Learning
ท่านใดสนใจซื้อ "หนังสือ AI ไม่ยาก เข้าใจได้ด้วยเลขม. ปลาย" สามารถคลิกเข้าไปในลิงค์ตามรูปได้