├── .gitignore ├── LICENSE ├── README.md ├── grandma_stocker.ipynb ├── grandma_stocker_local.ipynb ├── stock_data ├── 2330 │ ├── 2330_20180101.csv │ ├── 2330_20180201.csv │ ├── 2330_20180301.csv │ ├── 2330_20180401.csv │ ├── 2330_20180501.csv │ ├── 2330_20180601.csv │ ├── 2330_20180701.csv │ ├── 2330_20180801.csv │ ├── 2330_20180901.csv │ ├── 2330_20181001.csv │ ├── 2330_20181101.csv │ ├── 2330_20181201.csv │ ├── 2330_20190101.csv │ ├── 2330_20190201.csv │ ├── 2330_20190301.csv │ ├── 2330_20190401.csv │ ├── 2330_20190501.csv │ ├── 2330_20190601.csv │ ├── 2330_20190701.csv │ ├── 2330_20190801.csv │ ├── 2330_20190901.csv │ ├── 2330_20191001.csv │ ├── 2330_20191101.csv │ ├── 2330_20191201.csv │ ├── 2330_20200101.csv │ └── 2330_20200201.csv └── 0050 │ ├── 0050_20180101.csv │ ├── 0050_20180201.csv │ ├── 0050_20180301.csv │ ├── 0050_20180401.csv │ ├── 0050_20180501.csv │ ├── 0050_20180601.csv │ ├── 0050_20180701.csv │ ├── 0050_20180801.csv │ ├── 0050_20180901.csv │ ├── 0050_20181001.csv │ ├── 0050_20181101.csv │ ├── 0050_20181201.csv │ ├── 0050_20190101.csv │ ├── 0050_20190201.csv │ ├── 0050_20190301.csv │ ├── 0050_20190401.csv │ ├── 0050_20190501.csv │ ├── 0050_20190601.csv │ ├── 0050_20190701.csv │ ├── 0050_20190801.csv │ ├── 0050_20190901.csv │ ├── 0050_20191001.csv │ ├── 0050_20191101.csv │ ├── 0050_20191201.csv │ ├── 0050_20200101.csv │ └── 0050_20200201.csv └── stocker.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Will Koehrsen 4 | Copyright (c) 2020 grandma-tutorial 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stocker 2 | Stocker tutorial on [都會阿嬤](https://weikaiwei.com/ ) https://weikaiwei.com/ 3 | 4 | The code is based on [WillKoehrsen/Data-Analysis/stocker](https://github.com/WillKoehrsen/Data-Analysis/tree/master/stocker) 5 | 6 | ## Reference: 7 | 1. Will Koehrsen. "Stock Prediction in Python - Towards Data Science" 8 | 2. Taylor, Sean J., and Benjamin Letham. "Forecasting at scale." The American Statistician 72.1 (2018): 37-45. 9 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/01/02,3613199,298033251,82.15,82.6,82.15,82.6,+0.45,1795 3 | 107/01/03,7196437,599476413,82.95,83.45,82.95,83.35,+0.75,3014 4 | 107/01/04,5627565,469312820,83.5,83.65,83.2,83.5,+0.15,2278 5 | 107/01/05,7616796,636768692,83.5,83.8,83.3,83.75,+0.25,2562 6 | 107/01/08,5189611,435775639,83.8,84.15,83.7,84.1,+0.35,2282 7 | 107/01/09,3664716,308057554,84.1,84.25,83.9,84.15,+0.05,1340 8 | 107/01/10,5749597,482358793,84.1,84.25,83.55,83.75,-0.40,1073 9 | 107/01/11,2579225,214867793,83.65,83.7,83.1,83.4,-0.35,735 10 | 107/01/12,2871193,241214778,83.55,84.2,83.5,84.1,+0.70,1002 11 | 107/01/15,2819852,238493616,84.55,84.7,84.4,84.65,+0.55,1126 12 | 107/01/16,3955841,335496385,84.65,85.0,84.5,85.0,+0.35,1295 13 | 107/01/17,5698268,485174071,84.65,85.45,84.65,85.15,+0.15,2017 14 | 107/01/18,6898803,594091024,85.5,86.55,85.5,86.3,+1.15,2272 15 | 107/01/19,5302072,461040360,86.35,87.15,86.35,87.15,+0.85,1445 16 | 107/01/22,4441061,389066253,87.15,87.95,87.15,87.95,+0.80,1746 17 | 107/01/23,5799932,511405502,88.05,88.4,87.9,88.3,+0.35,1842 18 | 107/01/24,5103429,444907065,88.0,88.0,86.85,87.2,-1.10,1869 19 | 107/01/25,4983684,436967956,87.25,88.3,87.15,87.45,+0.25,1652 20 | 107/01/26,7774673,678481509,87.45,87.6,86.85,87.5,+0.05,3087 21 | 107/01/29,6445797,551350942,85.5,86.15,85.2,85.55,X0.00,3453 22 | 107/01/30,4966261,421572779,85.2,85.35,84.5,84.55,-1.00,2337 23 | 107/01/31,4251739,359040915,84.4,85.0,84.15,84.65,+0.10,1176 24 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/02/01,2914539,248420810,84.75,85.5,84.75,85.25,0.6,897 3 | 107/02/02,3081592,261095295,84.85,85.15,84.35,84.9,-0.35,880 4 | 107/02/05,7075902,588994369,83.2,83.75,82.9,83.6,-1.3,2875 5 | 107/02/06,32222595,2574016957,80.85,81.1,78.8,79.65,-3.95,11372 6 | 107/02/07,10181907,825539952,81.35,81.4,80.6,80.65,1.0,5189 7 | 107/02/08,4514691,363476832,80.65,80.95,80.3,80.6,-0.05,1972 8 | 107/02/09,16211237,1271812204,78.6,79.2,78.0,79.05,-1.55,6760 9 | 107/02/12,8443795,672977850,79.55,79.9,79.4,79.7,0.65,3828 10 | 107/02/21,11646085,948993971,81.4,81.7,81.1,81.5,1.8,4541 11 | 107/02/22,3749910,303821917,81.5,81.5,80.75,81.0,-0.5,1744 12 | 107/02/23,3779316,309207057,81.4,82.1,81.4,82.0,1.0,1793 13 | 107/02/26,3289207,271560439,82.55,82.8,82.35,82.4,0.4,1380 14 | 107/02/27,7663746,634417022,83.1,83.2,82.35,82.35,-0.05,2037 15 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180301.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/03/01,4344220,354595798,81.55,81.95,81.15,81.75,-0.6,2554 3 | 107/03/02,6262361,505982082,80.85,81.2,80.45,81.15,-0.6,2846 4 | 107/03/05,3723757,301898098,81.1,81.5,80.65,80.75,-0.4,1223 5 | 107/03/06,5732204,469203518,81.65,82.15,81.6,82.15,1.4,1756 6 | 107/03/07,2619161,214899152,81.75,82.45,81.7,81.8,-0.35,1029 7 | 107/03/08,3232583,266947148,82.15,82.8,82.15,82.75,0.95,1396 8 | 107/03/09,2832064,234740002,82.9,83.0,82.7,82.85,0.1,986 9 | 107/03/12,8752324,735446031,83.6,84.25,83.55,84.15,1.3,2942 10 | 107/03/13,9837435,831704291,84.35,84.95,84.3,84.95,0.8,3126 11 | 107/03/14,3415928,287869559,84.35,84.45,84.0,84.3,-0.65,1373 12 | 107/03/15,3506898,295014773,84.0,84.3,83.9,84.25,-0.05,1533 13 | 107/03/16,5510671,460021500,84.0,84.2,83.1,83.9,-0.35,1652 14 | 107/03/19,2035534,170676406,83.65,84.1,83.45,83.85,-0.05,892 15 | 107/03/20,2895350,241726053,83.2,83.8,83.2,83.8,-0.05,1019 16 | 107/03/21,4891527,410076823,83.8,84.1,83.6,83.85,0.05,2337 17 | 107/03/22,3429925,288139929,84.0,84.6,83.45,83.55,-0.3,1608 18 | 107/03/23,8259738,677767488,81.85,82.4,81.8,82.1,-1.45,2816 19 | 107/03/26,4369122,357831903,81.85,82.2,81.6,82.2,0.1,1837 20 | 107/03/27,3277568,272571549,83.0,83.4,82.95,83.4,1.2,1015 21 | 107/03/28,4161192,343127725,82.9,82.9,82.2,82.25,-1.15,1306 22 | 107/03/29,4099855,336213829,82.25,82.35,81.8,82.1,-0.15,1127 23 | 107/03/30,4994090,414075827,82.65,83.05,82.65,82.85,0.75,1285 24 | 107/03/31,878295,72801339,82.85,83.05,82.75,82.95,0.1,495 25 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180401.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/04/02,3737299,307813730,82.85,82.95,82.15,82.25,-0.7,1099 3 | 107/04/03,6187523,503435586,81.5,81.55,81.2,81.5,-0.75,2624 4 | 107/04/09,3401430,278923482,82.15,82.3,81.6,82.2,0.7,1167 5 | 107/04/10,3860497,318719411,82.1,82.85,81.75,82.5,0.3,1039 6 | 107/04/11,2603653,215930349,82.9,83.1,82.75,82.85,0.35,1252 7 | 107/04/12,3591573,296423097,83.05,83.15,82.25,82.5,-0.35,1267 8 | 107/04/13,2982732,246303554,82.7,82.8,82.3,82.5,0.0,792 9 | 107/04/16,1809198,148796053,82.65,82.65,82.0,82.3,-0.2,761 10 | 107/04/17,4325040,352876030,82.4,82.4,81.35,81.4,-0.9,2223 11 | 107/04/18,3739837,305624331,81.6,82.1,81.35,81.6,0.2,1306 12 | 107/04/19,4461269,367816687,81.9,82.65,81.9,82.65,1.05,1200 13 | 107/04/20,9017715,728325834,81.0,81.1,80.5,80.75,-1.9,3705 14 | 107/04/23,10624780,850769704,80.25,80.45,79.9,79.95,-0.8,5274 15 | 107/04/24,16867787,1341875510,79.9,79.95,79.05,79.55,-0.4,6924 16 | 107/04/25,16460997,1301833349,79.25,79.3,78.8,79.3,-0.25,7679 17 | 107/04/26,16485778,1305124761,79.7,79.7,78.8,79.05,-0.25,6863 18 | 107/04/27,12395611,979827894,79.6,79.65,78.8,79.2,0.15,4730 19 | 107/04/30,6516983,519421423,79.65,80.15,79.05,80.0,0.8,2677 20 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180501.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/05/02,5513498,439622305,80.05,80.15,79.4,79.4,-0.6,2584 3 | 107/05/03,8823434,694073004,79.05,79.05,78.35,78.55,-0.85,4248 4 | 107/05/04,3475423,273248775,78.55,79.0,78.4,78.95,0.4,1860 5 | 107/05/07,3858382,305849245,79.5,79.55,78.8,79.5,0.55,1752 6 | 107/05/08,5352116,427504370,79.4,80.05,79.35,80.0,0.5,2272 7 | 107/05/09,3359022,270071272,80.0,80.55,80.0,80.45,0.45,1914 8 | 107/05/10,5977304,481662488,80.7,80.7,80.45,80.65,0.2,3239 9 | 107/05/11,17654297,1436892102,81.1,81.7,81.05,81.6,0.95,6364 10 | 107/05/14,17197686,1414607650,82.0,82.6,81.9,82.5,0.9,6171 11 | 107/05/15,7222482,592065703,82.35,82.4,81.65,81.65,-0.85,2449 12 | 107/05/16,8293601,677320569,81.45,81.8,81.4,81.75,0.1,2922 13 | 107/05/17,1940778,158110701,81.95,82.0,81.2,81.2,-0.55,1009 14 | 107/05/18,2360712,191353462,81.2,81.5,80.85,80.95,-0.25,1051 15 | 107/05/21,3889661,318673185,81.2,82.1,81.2,82.05,1.1,1717 16 | 107/05/22,1837449,150711615,81.8,82.3,81.75,81.75,-0.3,834 17 | 107/05/23,2124373,173329337,81.9,82.0,81.3,81.35,-0.4,663 18 | 107/05/24,1135324,92525577,81.35,81.7,81.25,81.55,0.2,460 19 | 107/05/25,3115748,254971743,81.55,82.05,81.4,81.85,0.3,1454 20 | 107/05/28,2940383,241485608,82.05,82.25,82.0,82.2,0.35,1601 21 | 107/05/29,1388540,113427981,82.2,82.2,81.5,81.85,-0.35,580 22 | 107/05/30,6177819,497863690,81.4,81.4,80.3,80.4,-1.45,3017 23 | 107/05/31,1605922,129628697,80.8,80.95,80.55,80.75,0.35,733 24 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180601.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/06/01,1848694,150141515,80.8,81.45,80.8,81.35,0.6,818 3 | 107/06/04,7081064,583108366,81.8,82.6,81.8,82.6,1.25,2675 4 | 107/06/05,2695921,222338374,82.7,82.7,82.25,82.5,-0.1,1361 5 | 107/06/06,6398322,531456226,82.65,83.35,82.65,83.3,0.8,2988 6 | 107/06/07,6704318,557849318,83.5,83.6,83.0,83.45,0.15,1499 7 | 107/06/08,3469539,287811322,83.3,83.3,82.5,82.55,-0.9,980 8 | 107/06/11,3264375,269605262,82.8,82.95,82.4,82.65,0.1,838 9 | 107/06/12,2243224,184469445,82.25,82.5,81.95,82.5,-0.15,697 10 | 107/06/13,4668145,386299235,82.45,83.1,82.35,83.0,0.5,1475 11 | 107/06/14,3564268,292513426,82.5,82.55,81.75,81.75,-1.25,1517 12 | 107/06/15,3862122,314683389,81.6,81.95,81.2,81.95,0.2,1377 13 | 107/06/19,4994238,403588078,81.1,81.2,80.6,80.6,-1.35,2728 14 | 107/06/20,7866995,637796526,80.65,81.7,80.3,81.5,0.9,4099 15 | 107/06/21,2134851,173683734,81.5,81.6,81.2,81.25,-0.25,1305 16 | 107/06/22,6482461,523157693,80.8,81.2,80.35,81.15,-0.1,2708 17 | 107/06/25,7993181,646507087,80.85,81.05,80.7,80.9,-0.25,3482 18 | 107/06/26,16434141,1320542535,80.7,80.7,80.0,80.7,-0.2,7473 19 | 107/06/27,8308049,668958497,80.75,80.9,80.3,80.4,-0.3,3764 20 | 107/06/28,12064020,965311034,80.05,80.4,79.8,80.05,-0.35,4165 21 | 107/06/29,6584213,532141516,80.3,81.55,80.2,81.45,1.4,3155 22 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180701.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/07/02,4175628,340342167,81.5,81.9,81.0,81.05,-0.40,1476 3 | 107/07/03,5023687,407797091,81.3,81.95,80.6,81.15,+0.10,1445 4 | 107/07/04,1746449,142005065,81.15,81.6,81.1,81.4,+0.25,720 5 | 107/07/05,3119082,252501708,81.45,81.45,80.6,80.75,-0.65,1163 6 | 107/07/06,5351492,431770914,81.1,81.15,80.2,80.95,+0.20,1679 7 | 107/07/09,9040778,742124242,81.75,82.45,81.55,82.25,+1.30,2919 8 | 107/07/10,4913802,405509024,82.65,82.8,82.35,82.45,+0.20,2340 9 | 107/07/11,3899069,317877992,81.7,81.9,81.3,81.7,-0.75,1081 10 | 107/07/12,6882846,567290801,81.6,82.65,81.5,82.65,+0.95,2051 11 | 107/07/13,13661779,1135575906,83.0,83.4,82.8,83.35,+0.70,4818 12 | 107/07/16,5332432,443588641,83.3,83.45,83.0,83.0,-0.35,1945 13 | 107/07/17,2992751,247259857,82.85,82.85,82.4,82.55,-0.45,949 14 | 107/07/18,13174455,1096705424,83.15,83.5,82.95,83.05,+0.50,6528 15 | 107/07/19,13217661,1104868177,83.1,83.8,83.05,83.3,+0.25,3471 16 | 107/07/20,18403370,1554789461,84.0,84.7,84.0,84.65,+1.35,5400 17 | 107/07/23,8504472,717700336,84.3,84.75,83.85,84.55,X0.00,2543 18 | 107/07/24,5116814,432638596,84.45,84.7,84.15,84.7,+0.15,2053 19 | 107/07/25,6352201,538152149,84.05,84.85,84.05,84.75,+0.05,1862 20 | 107/07/26,8471170,720308687,84.75,85.25,84.75,85.0,+0.25,2884 21 | 107/07/27,5947118,508730875,85.1,85.75,85.1,85.7,+0.70,1942 22 | 107/07/30,3230410,276780248,85.65,85.9,85.4,85.55,-0.15,1179 23 | 107/07/31,2739663,234041326,85.35,85.7,85.05,85.55,0.00,1056 24 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180801.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/08/01,4012507,345034802,85.8,86.2,85.8,86.15,0.6,1507 3 | 107/08/02,4774950,408144300,86.1,86.15,84.85,84.85,-1.3,1255 4 | 107/08/03,1225166,104806018,85.4,85.7,85.35,85.55,0.7,661 5 | 107/08/06,2424671,208061157,85.55,86.1,85.35,85.7,0.15,1169 6 | 107/08/07,1199281,102654664,85.7,85.8,85.4,85.5,-0.2,893 7 | 107/08/08,4074984,351307291,85.8,86.4,85.8,86.15,0.65,1274 8 | 107/08/09,1631789,140409677,86.1,86.25,85.7,86.15,0.0,860 9 | 107/08/10,1279917,109887403,85.7,86.15,85.65,85.7,-0.45,717 10 | 107/08/13,7284934,613593198,85.05,85.05,83.65,83.95,-1.75,3154 11 | 107/08/14,2243205,189202665,84.4,84.6,84.05,84.55,0.6,1082 12 | 107/08/15,4279671,358442697,84.5,84.5,83.45,83.75,-0.8,2778 13 | 107/08/16,4532542,378662628,83.25,84.1,83.05,83.8,0.05,1957 14 | 107/08/17,4640039,388914326,83.95,84.15,83.6,83.65,-0.15,1655 15 | 107/08/20,3147996,264000882,83.9,84.1,83.7,83.95,0.3,1466 16 | 107/08/21,5023058,423888290,83.9,84.65,83.9,84.55,0.6,1700 17 | 107/08/22,3545768,300217040,84.7,84.85,84.35,84.65,0.1,1156 18 | 107/08/23,3869236,328564580,84.8,85.2,84.6,85.05,0.4,903 19 | 107/08/24,2549174,216059090,85.0,85.1,84.45,84.8,-0.25,810 20 | 107/08/27,5025454,428795783,85.0,85.55,85.0,85.55,0.75,1853 21 | 107/08/28,8288078,714613443,85.95,86.4,85.95,86.25,0.7,2833 22 | 107/08/29,13383846,1164633494,86.45,87.35,86.45,87.25,1.0,4145 23 | 107/08/30,9894177,869371023,87.8,88.35,87.45,87.55,0.3,3515 24 | 107/08/31,4245610,368332289,87.0,87.0,86.45,86.95,-0.6,2097 25 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20180901.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/09/03,3670077,318489642,86.95,87.2,86.4,86.45,-0.5,1852 3 | 107/09/04,2357725,204511025,86.8,87.0,86.45,87.0,0.55,1553 4 | 107/09/05,2496308,217228848,87.0,87.3,86.7,87.0,0.0,1053 5 | 107/09/06,1945889,168384874,86.9,86.9,86.2,86.5,-0.5,1168 6 | 107/09/07,2505908,216029254,86.2,86.45,86.0,86.4,-0.1,1256 7 | 107/09/10,5319281,457230691,86.6,86.6,85.65,86.0,-0.4,2224 8 | 107/09/11,19525404,1672322444,85.95,86.0,85.4,85.65,-0.35,7801 9 | 107/09/12,18583973,1588075828,85.85,85.9,85.25,85.55,-0.1,7809 10 | 107/09/13,20996200,1789506288,85.8,85.8,84.9,84.95,-0.6,9849 11 | 107/09/14,8616375,741763887,85.75,86.5,85.6,86.5,1.55,3095 12 | 107/09/17,8988960,773023506,86.5,86.5,85.7,85.85,-0.65,2440 13 | 107/09/18,6140571,524809750,85.6,85.7,85.2,85.4,-0.45,2243 14 | 107/09/19,6881627,591822766,85.8,86.3,85.7,86.15,0.75,3226 15 | 107/09/20,4159776,357894112,86.45,86.55,85.8,85.9,-0.25,1030 16 | 107/09/21,7370439,636825668,86.25,86.85,85.9,86.85,0.95,2626 17 | 107/09/25,7506252,652734924,86.65,87.15,86.6,87.1,0.25,2984 18 | 107/09/26,8036503,698254201,86.9,87.0,86.75,86.9,-0.2,2692 19 | 107/09/27,27800036,2423747411,86.6,87.45,86.6,87.35,0.45,8114 20 | 107/09/28,13202371,1151404227,87.35,87.65,86.6,86.9,-0.45,4328 21 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20181001.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/10/01,5914234,516131207,86.9,87.4,86.9,87.35,0.45,2729 3 | 107/10/02,5434332,469382289,87.25,87.25,86.0,86.05,-1.3,2466 4 | 107/10/03,4369690,375778640,86.05,86.3,85.8,85.95,-0.1,1554 5 | 107/10/04,9736968,827292110,85.7,85.7,84.8,84.9,-1.05,4230 6 | 107/10/05,26744096,2239942717,84.5,84.5,83.0,83.45,-1.45,11367 7 | 107/10/08,46523204,3855479629,82.95,83.4,82.5,83.0,-0.45,16777 8 | 107/10/09,20530897,1706528887,83.05,83.4,82.8,83.25,0.25,9093 9 | 107/10/11,68551624,5389808235,80.15,80.15,77.35,77.4,-5.85,29625 10 | 107/10/12,23183282,1825995175,77.7,80.05,77.5,80.05,2.65,11298 11 | 107/10/15,49299658,3886740002,79.5,79.5,78.65,79.2,-0.85,12199 12 | 107/10/16,16686645,1319117765,79.0,79.5,78.6,79.3,0.1,6313 13 | 107/10/17,20309037,1623444090,80.45,80.5,79.35,79.4,0.1,8082 14 | 107/10/18,7988282,633217825,79.5,79.75,78.95,79.15,-0.25,3397 15 | 107/10/19,12064036,948108881,78.2,79.3,78.0,79.3,0.15,3531 16 | 107/10/22,12453453,979040928,78.35,79.55,78.0,79.2,-0.1,3464 17 | 107/10/23,24898392,1943501426,78.1,78.6,77.7,77.75,-1.45,8141 18 | 107/10/24,13002500,1004568676,77.8,77.95,76.7,77.4,-0.35,5533 19 | 107/10/25,28935886,2190854586,75.5,76.2,75.3,75.5,-1.9,7121 20 | 107/10/26,17783781,1338505238,76.25,76.45,74.5,75.4,-0.1,6911 21 | 107/10/29,9883260,747884213,75.85,76.1,75.35,75.75,0.35,3121 22 | 107/10/30,6119050,464489618,75.8,76.25,75.5,75.95,0.2,2313 23 | 107/10/31,9898224,764366541,76.6,77.55,76.6,77.55,1.6,4310 24 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20181101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/11/01,6807294,532547148,77.85,78.45,77.55,78.4,0.85,3048 3 | 107/11/02,6722329,527356465,78.4,78.8,78.0,78.65,0.25,3073 4 | 107/11/05,4657750,363054360,78.1,78.25,77.6,78.25,-0.4,2195 5 | 107/11/06,6206482,483978162,78.45,78.5,77.75,78.0,-0.25,2046 6 | 107/11/07,6194750,485644361,78.2,78.55,78.05,78.4,0.4,2594 7 | 107/11/08,10309985,813484895,79.15,79.4,78.5,78.85,0.45,3816 8 | 107/11/09,36848011,2867181167,78.5,78.5,77.65,77.8,-1.05,2930 9 | 107/11/12,6133260,478405835,77.75,78.3,77.55,78.0,0.2,1628 10 | 107/11/13,10711869,819374746,76.15,77.25,75.7,77.1,-0.9,3762 11 | 107/11/14,6293375,486228774,77.25,77.4,77.0,77.35,0.25,1626 12 | 107/11/15,5694368,440513236,77.5,77.65,76.75,77.6,0.25,1247 13 | 107/11/16,8883904,685298620,77.95,77.95,76.85,76.95,-0.65,2331 14 | 107/11/19,7058370,541993834,77.05,77.15,76.6,76.7,-0.25,1672 15 | 107/11/20,8625123,656617939,76.4,76.5,75.75,76.0,-0.7,3297 16 | 107/11/21,15125043,1143349727,75.3,76.05,74.85,76.0,0.0,3739 17 | 107/11/22,5934803,450631578,76.1,76.25,75.6,75.6,-0.4,2029 18 | 107/11/23,4041215,304440003,75.7,75.85,75.05,75.35,-0.25,2078 19 | 107/11/26,6330267,483137195,75.9,76.95,75.75,76.15,0.8,2266 20 | 107/11/27,7625933,576522804,75.95,76.05,75.2,76.05,-0.1,2519 21 | 107/11/28,7549760,577452117,76.15,76.95,75.75,76.9,0.85,2641 22 | 107/11/29,8881587,687927261,77.7,77.95,77.05,77.05,0.15,2527 23 | 107/11/30,4210211,324711501,77.2,77.35,76.75,76.75,-0.3,1670 24 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20181201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/12/03,13850986,1088593094,77.85,79.0,77.8,78.8,2.05,7537 3 | 107/12/04,4118284,322426648,78.5,78.5,78.1,78.25,-0.55,1960 4 | 107/12/05,9636366,740544550,77.1,77.2,76.65,76.65,-1.6,3602 5 | 107/12/06,20347421,1529965270,75.85,75.85,74.85,75.1,-1.55,10519 6 | 107/12/07,6781008,512288502,75.6,75.75,75.3,75.45,0.35,4623 7 | 107/12/10,13013284,970567677,74.5,74.9,74.45,74.45,-1.0,5810 8 | 107/12/11,5316228,397657901,74.5,75.1,74.45,75.05,0.6,2808 9 | 107/12/12,8677695,658099872,75.65,76.25,75.4,76.2,1.15,3377 10 | 107/12/13,6253580,476968419,76.2,76.5,75.95,76.3,0.1,2176 11 | 107/12/14,8780839,660320971,75.8,75.8,74.95,75.35,-0.95,3141 12 | 107/12/17,5652433,428269261,75.35,76.05,75.15,75.95,0.6,2331 13 | 107/12/18,7669001,577586400,75.5,75.55,75.05,75.3,-0.65,2456 14 | 107/12/19,4497460,340689657,75.5,75.95,75.35,75.9,0.6,2646 15 | 107/12/20,9561713,718960366,75.0,75.55,75.0,75.05,-0.85,5731 16 | 107/12/21,8481143,634702156,74.95,75.25,74.45,75.2,0.15,2776 17 | 107/12/22,3002630,224452101,74.85,74.85,74.7,74.85,-0.35,1475 18 | 107/12/24,5952329,444475204,74.85,75.0,74.55,74.7,-0.15,4513 19 | 107/12/25,12071254,888095346,74.15,74.15,73.3,73.75,-0.95,5738 20 | 107/12/26,8919969,658916682,74.0,74.3,73.5,73.55,-0.2,3788 21 | 107/12/27,9615359,719358543,74.8,75.15,74.5,75.05,1.5,5522 22 | 107/12/28,4629875,348222242,75.1,75.5,74.85,75.5,0.45,2008 23 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/01/02,8532073,636107101,75.85,75.9,73.95,74.05,-1.45,4102 3 | 108/01/03,13347147,981181870,73.8,74.0,73.25,73.35,-0.70,5208 4 | 108/01/04,21292465,1540084560,72.8,72.8,72.0,72.2,-1.15,8826 5 | 108/01/07,14605638,1077319115,73.55,74.05,73.25,73.95,+1.75,4891 6 | 108/01/08,11006700,811364720,74.15,74.15,73.55,73.65,-0.30,2869 7 | 108/01/09,11430523,855269355,73.95,75.15,73.95,75.0,+1.35,5277 8 | 108/01/10,2823283,210937625,74.8,74.9,74.5,74.8,-0.20,1231 9 | 108/01/11,10362915,782200792,75.3,75.75,75.15,75.5,+0.70,3660 10 | 108/01/14,5298405,397504723,75.45,75.45,74.75,75.0,-0.50,2018 11 | 108/01/15,11836450,894286699,75.05,75.8,75.05,75.65,+0.65,5250 12 | 108/01/16,15342503,1159613447,75.65,75.7,75.35,75.55,-0.10,5360 13 | 108/01/17,10020739,756877394,75.6,75.9,75.15,75.55,0.00,3137 14 | 108/01/18,8293491,629378860,75.75,76.1,75.4,75.95,+0.40,5013 15 | 108/01/21,10454756,799923534,76.35,76.7,76.25,76.5,+0.55,3895 16 | 108/01/22,8838931,653814320,74.4,74.4,73.8,74.05,X0.00,4742 17 | 108/01/23,6407442,472728408,74.0,74.0,73.65,73.7,-0.35,3167 18 | 108/01/24,3500506,258832935,73.95,74.15,73.75,74.05,+0.35,1363 19 | 108/01/25,7320778,548115919,74.6,75.1,74.55,75.0,+0.95,3322 20 | 108/01/28,3825143,287814225,75.15,75.45,75.05,75.15,+0.15,1795 21 | 108/01/29,4419790,328663492,74.5,74.55,74.2,74.5,-0.65,2251 22 | 108/01/30,5255229,390864071,74.5,74.65,74.2,74.35,-0.15,1833 23 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/02/11,6614900,497844612,75.35,75.65,74.85,75.15,0.8,3137 3 | 108/02/12,6164150,465816739,75.35,75.75,75.35,75.65,0.5,2980 4 | 108/02/13,4157700,314193830,75.95,75.95,75.4,75.5,-0.15,1837 5 | 108/02/14,3641542,274887735,75.5,75.75,75.25,75.25,-0.25,1593 6 | 108/02/15,3516111,264409753,75.3,75.6,74.9,75.05,-0.2,1796 7 | 108/02/18,6596163,499575240,75.5,75.9,75.5,75.65,0.6,3143 8 | 108/02/19,2862069,216303714,75.7,75.7,75.5,75.5,-0.15,2168 9 | 108/02/20,34307853,2619961938,75.9,76.5,75.9,76.35,0.85,9607 10 | 108/02/21,18664815,1433791393,76.4,77.1,76.4,77.1,0.75,4467 11 | 108/02/22,9881017,758887009,76.95,76.95,76.5,76.95,-0.15,6936 12 | 108/02/25,19365354,1501862131,77.35,77.75,77.3,77.5,0.55,4458 13 | 108/02/26,15903051,1234156605,77.65,77.8,77.3,77.7,0.2,5707 14 | 108/02/27,12907489,1000792293,77.7,77.7,77.35,77.65,-0.05,3460 15 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190301.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/03/04,8469570,652787218,77.55,77.55,76.7,76.95,-0.7,4887 3 | 108/03/05,9400493,720525122,76.6,76.9,76.45,76.75,-0.2,2830 4 | 108/03/06,19579792,1505450934,76.85,77.05,76.75,76.95,0.2,3193 5 | 108/03/07,18239770,1399918017,76.9,77.05,76.6,76.65,-0.3,1946 6 | 108/03/08,9975200,758523703,76.2,76.35,75.8,76.0,-0.65,2853 7 | 108/03/11,4642390,352680831,75.85,76.15,75.7,76.15,0.15,2280 8 | 108/03/12,13857468,1070170012,76.85,77.45,76.8,77.25,1.1,3796 9 | 108/03/13,10148529,781685019,77.05,77.2,76.8,77.1,-0.15,1763 10 | 108/03/14,5208756,402155617,77.3,77.4,76.95,77.05,-0.05,1343 11 | 108/03/15,11483751,890275774,77.35,77.7,77.15,77.6,0.55,3164 12 | 108/03/18,12218708,952368177,77.75,78.1,77.65,78.1,0.5,4228 13 | 108/03/19,8604296,672547372,78.1,78.4,77.85,78.4,0.3,2634 14 | 108/03/20,11856027,929902949,78.35,78.55,78.2,78.5,0.1,4868 15 | 108/03/21,11341213,894798086,78.8,79.15,78.65,79.15,0.65,3766 16 | 108/03/22,6930357,550253696,79.5,79.7,79.05,79.35,0.2,2993 17 | 108/03/25,7020756,548329150,78.1,78.35,78.0,78.15,-1.2,2790 18 | 108/03/26,2700090,212178105,78.5,78.7,78.4,78.65,0.5,1328 19 | 108/03/27,2555684,200669301,78.45,78.7,78.2,78.5,-0.15,959 20 | 108/03/28,3415432,267952933,78.3,78.6,78.15,78.5,0.0,977 21 | 108/03/29,5680484,448318722,78.7,79.15,78.25,79.15,0.65,1629 22 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190401.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/04/01,11053405,886568240,80.0,80.4,79.6,79.85,0.7,3749 3 | 108/04/02,5605092,449896022,80.1,80.45,80.1,80.15,0.3,2132 4 | 108/04/03,6867174,550702889,80.4,80.45,79.95,80.15,0.0,3017 5 | 108/04/08,7990782,646213579,80.8,81.0,80.7,80.9,0.75,3458 6 | 108/04/09,15272047,1239718747,80.95,81.4,80.85,81.4,0.5,6181 7 | 108/04/10,10863161,883369153,81.1,81.55,81.1,81.5,0.1,3214 8 | 108/04/11,8272430,671920398,81.35,81.55,80.9,81.15,-0.35,2220 9 | 108/04/12,7498409,608347094,81.15,81.3,81.0,81.1,-0.05,1806 10 | 108/04/15,7681554,628500222,81.65,82.0,81.55,81.85,0.75,4160 11 | 108/04/16,7767931,637026518,81.85,82.15,81.8,82.1,0.25,3439 12 | 108/04/17,23104837,1911820959,82.3,82.9,82.3,82.75,0.65,5342 13 | 108/04/18,20690365,1716538233,82.9,83.35,82.45,82.7,-0.05,3185 14 | 108/04/19,12515659,1038666179,83.25,83.5,82.7,82.8,0.1,2347 15 | 108/04/22,2874312,238232670,83.0,83.1,82.65,82.7,-0.1,1478 16 | 108/04/23,6012031,498598254,82.7,83.2,82.55,83.05,0.35,2105 17 | 108/04/24,3108556,258856445,83.4,83.55,82.9,83.2,0.15,1665 18 | 108/04/25,3529039,293890589,83.1,83.45,83.0,83.4,0.2,1588 19 | 108/04/26,3815090,314520959,82.8,82.8,82.2,82.45,-0.95,2520 20 | 108/04/29,3161957,261464012,82.6,82.95,82.5,82.8,0.35,1462 21 | 108/04/30,3247891,268471136,82.8,82.9,82.4,82.8,0.0,1525 22 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190501.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/05/02,6155563,511743438,82.95,83.45,82.9,83.0,0.2,2206 3 | 108/05/03,30324466,2531398997,83.1,83.8,83.1,83.75,0.75,2939 4 | 108/05/06,7463612,614195906,82.6,82.6,82.05,82.3,-1.45,3956 5 | 108/05/07,14011442,1163500108,82.65,83.3,82.65,83.15,0.85,3021 6 | 108/05/08,13573142,1120446358,82.4,82.85,82.25,82.55,-0.6,2189 7 | 108/05/09,6923673,565348226,82.15,82.2,81.25,81.55,-1.0,4032 8 | 108/05/10,11794135,961017047,81.55,82.15,80.9,81.5,-0.05,4632 9 | 108/05/13,18678106,1503424339,81.1,81.1,80.1,80.15,-1.35,9159 10 | 108/05/14,20279630,1613491800,79.6,80.05,78.9,79.65,-0.5,9964 11 | 108/05/15,17261839,1376616520,79.65,80.0,79.45,79.75,0.1,8236 12 | 108/05/16,17099974,1355088953,79.5,79.6,79.0,79.05,-0.7,7751 13 | 108/05/17,23573826,1854550805,79.5,79.55,78.25,78.25,-0.8,11522 14 | 108/05/20,14304763,1121570149,78.5,78.8,78.15,78.2,-0.05,6896 15 | 108/05/21,19814843,1548066469,78.0,78.45,77.7,78.4,0.2,6058 16 | 108/05/22,10557991,827306010,78.2,78.65,78.1,78.4,0.0,4582 17 | 108/05/23,25682577,1979998024,77.85,77.85,76.85,76.95,-1.45,13162 18 | 108/05/24,6029424,465499944,77.05,77.5,77.0,77.35,0.4,3250 19 | 108/05/27,11541072,890073086,77.5,77.5,76.85,77.15,-0.2,5535 20 | 108/05/28,9812310,755742961,77.25,77.25,76.85,77.1,-0.05,4361 21 | 108/05/29,9659519,740038363,76.5,76.8,76.3,76.75,-0.35,4380 22 | 108/05/30,7658659,591824718,76.75,77.5,76.75,77.4,0.65,3474 23 | 108/05/31,7566310,590619995,77.35,78.45,77.3,78.45,1.05,3611 24 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190601.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/06/03,6017694,470593299,78.2,78.65,77.65,78.55,0.1,2880 3 | 108/06/04,7228829,565425109,78.45,78.6,78.0,78.05,-0.5,2675 4 | 108/06/05,7051894,554017619,78.85,78.95,78.25,78.3,0.25,3047 5 | 108/06/06,7456203,579216003,77.7,77.85,77.45,77.7,-0.6,3663 6 | 108/06/10,7666763,604180835,78.65,79.05,78.35,79.05,1.35,3677 7 | 108/06/11,10623986,844354556,79.2,79.8,79.05,79.4,0.35,5118 8 | 108/06/12,9258296,736850634,79.4,79.8,79.25,79.7,0.3,4028 9 | 108/06/13,5914941,468466446,79.4,79.55,78.95,79.05,-0.65,2874 10 | 108/06/14,3164087,249813323,79.0,79.15,78.8,78.9,-0.15,1824 11 | 108/06/17,6141128,483052353,78.45,78.95,78.1,78.7,-0.2,3732 12 | 108/06/18,2890377,227779433,78.8,79.0,78.6,78.9,0.2,1195 13 | 108/06/19,21832509,1754258999,80.0,80.8,79.95,80.75,1.85,8538 14 | 108/06/20,11581994,936579222,80.75,81.0,80.65,80.85,0.1,4459 15 | 108/06/21,15343532,1243301534,81.1,81.2,80.8,80.85,0.0,8013 16 | 108/06/24,16600747,1347119158,80.8,81.5,80.7,81.2,0.35,5396 17 | 108/06/25,7941128,643677923,81.15,81.4,80.6,80.75,-0.45,2804 18 | 108/06/26,5913352,475566304,80.6,80.6,80.25,80.35,-0.4,2313 19 | 108/06/27,15351329,1248736184,80.55,81.6,80.55,81.5,1.15,4177 20 | 108/06/28,3940686,319369533,81.45,81.55,80.85,80.9,-0.6,1867 21 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190701.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/07/01,13771395,1137417652,82.05,82.8,82.05,82.65,+1.75,5806 3 | 108/07/02,5209290,429828229,82.65,82.7,82.4,82.45,-0.20,2310 4 | 108/07/03,8615424,703409269,82.35,82.35,81.35,81.5,-0.95,2877 5 | 108/07/04,5777556,473795392,81.8,82.2,81.8,82.0,+0.50,1447 6 | 108/07/05,1612933,132235865,82.1,82.35,81.8,81.9,-0.10,1054 7 | 108/07/08,3859058,315505734,81.8,82.0,81.4,81.6,-0.30,1508 8 | 108/07/09,4083155,333023156,81.75,81.75,81.4,81.5,-0.10,1528 9 | 108/07/10,4427730,363405703,81.95,82.25,81.85,82.2,+0.70,1918 10 | 108/07/11,10379773,860205468,82.65,83.05,82.5,82.85,+0.65,4412 11 | 108/07/12,2972505,246251327,82.85,83.0,82.7,82.75,-0.10,1440 12 | 108/07/15,9336043,775528066,82.85,83.35,82.25,83.2,+0.45,3389 13 | 108/07/16,5503245,458848605,83.2,83.45,83.15,83.35,+0.15,2645 14 | 108/07/17,10598530,879178624,83.25,83.25,82.8,82.8,-0.55,4107 15 | 108/07/18,7541026,624408018,82.6,82.95,82.6,82.7,-0.10,1759 16 | 108/07/19,9780922,814129776,83.0,83.45,83.0,83.0,X0.00,3437 17 | 108/07/22,8368544,698062737,83.1,83.5,83.1,83.4,+0.40,3434 18 | 108/07/23,5899116,493687372,83.6,83.9,83.5,83.6,+0.20,2505 19 | 108/07/24,3364336,281628164,83.75,83.9,83.55,83.55,-0.05,1397 20 | 108/07/25,4931659,412670155,83.55,83.8,83.4,83.8,+0.25,1798 21 | 108/07/26,3129687,260812774,83.4,83.4,83.2,83.25,-0.55,1837 22 | 108/07/29,3042246,253325799,83.1,83.45,83.05,83.45,+0.20,1346 23 | 108/07/30,2083374,173777513,83.6,83.7,83.2,83.2,-0.25,1207 24 | 108/07/31,3119262,258060696,83.15,83.15,82.45,82.8,-0.40,1492 25 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190801.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/08/01,5042943,414858242,82.2,82.55,82.1,82.3,-0.5,2632 3 | 108/08/02,16846402,1362560110,81.05,81.2,80.6,80.95,-1.35,6921 4 | 108/08/05,20659506,1657565764,80.7,80.85,79.9,80.15,-0.8,9417 5 | 108/08/06,24901846,1968227195,78.65,80.45,78.5,80.1,-0.05,10838 6 | 108/08/07,16856004,1345630493,80.15,80.2,79.55,79.7,-0.4,7603 7 | 108/08/08,5036121,405560691,80.05,80.8,80.0,80.65,0.95,2802 8 | 108/08/12,3168030,255436705,80.65,80.85,80.15,80.6,-0.05,2171 9 | 108/08/13,7431519,593128279,80.15,80.15,79.55,79.7,-0.9,4255 10 | 108/08/14,7382138,595173755,80.7,80.8,80.3,80.3,0.6,3019 11 | 108/08/15,15972089,1267223096,79.2,79.6,79.1,79.4,-0.9,6769 12 | 108/08/16,6158748,492012872,79.45,80.35,79.25,80.35,0.95,3689 13 | 108/08/19,6475352,522065179,80.75,80.9,80.3,80.8,0.45,3347 14 | 108/08/20,4179197,338309857,80.85,81.1,80.8,81.0,0.2,2012 15 | 108/08/21,6092896,493794088,80.95,81.15,80.9,81.1,0.1,3233 16 | 108/08/22,9379398,763036338,81.3,81.65,80.8,80.9,-0.2,3542 17 | 108/08/23,3211036,259903716,80.9,81.1,80.75,81.0,0.1,1804 18 | 108/08/26,12292310,980575763,79.8,80.1,79.6,79.65,-1.35,5857 19 | 108/08/27,2535864,202789305,80.15,80.2,79.75,79.85,0.2,1369 20 | 108/08/28,3318188,266715323,80.1,80.55,80.1,80.4,0.55,1606 21 | 108/08/29,3233649,259494308,80.45,80.6,80.0,80.55,0.15,964 22 | 108/08/30,19370894,1581406102,81.15,81.9,81.15,81.85,1.3,5592 23 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20190901.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/09/02,6457870,528610814,81.8,82.0,81.65,81.9,0.05,2082 3 | 108/09/03,5052925,413343221,81.85,82.0,81.2,81.2,-0.7,2534 4 | 108/09/04,10748771,881536222,81.45,82.2,81.4,82.15,0.95,4277 5 | 108/09/05,25429390,2110355549,82.55,83.2,82.55,83.0,0.85,7984 6 | 108/09/06,17226303,1437582238,83.25,83.55,83.25,83.5,0.5,7833 7 | 108/09/09,12633348,1058619857,83.7,84.0,83.65,83.8,0.3,4942 8 | 108/09/10,5171847,431764155,83.95,83.95,83.2,83.4,-0.4,3012 9 | 108/09/11,4746200,396473497,83.75,83.9,83.3,83.45,0.05,1766 10 | 108/09/12,9281122,779861376,84.1,84.25,83.75,83.9,0.45,3785 11 | 108/09/16,10929792,920529834,84.0,84.45,83.95,84.4,0.5,4660 12 | 108/09/17,4966780,418697583,84.4,84.45,84.2,84.25,-0.15,1650 13 | 108/09/18,16999486,1442542539,84.4,85.0,84.35,84.95,0.7,5496 14 | 108/09/19,7777364,658987087,84.95,85.15,84.4,84.45,-0.5,2503 15 | 108/09/20,8231699,697865048,84.65,84.9,84.65,84.7,0.25,2092 16 | 108/09/23,4369839,369772132,84.65,84.85,84.5,84.5,-0.2,1478 17 | 108/09/24,4852012,410605292,84.5,84.85,84.35,84.65,0.15,1642 18 | 108/09/25,3927674,330124238,84.35,84.35,83.9,84.1,-0.55,2438 19 | 108/09/26,5194687,438729412,84.45,84.7,84.15,84.3,0.2,1534 20 | 108/09/27,8884695,752473986,84.9,85.2,84.5,84.6,0.3,1964 21 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20191001.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/10/01,9595908,821807362,84.8,86.0,84.8,85.95,1.35,4149 3 | 108/10/02,5653658,484713271,85.6,85.9,85.6,85.65,-0.3,1448 4 | 108/10/03,4868237,412892945,84.4,85.1,84.3,84.8,-0.85,1734 5 | 108/10/04,3746987,318959376,85.2,85.4,84.75,85.15,0.35,1128 6 | 108/10/07,4140747,353756450,85.4,85.65,85.2,85.45,0.3,2881 7 | 108/10/08,12195435,1054012283,85.85,86.6,85.85,86.5,1.05,3364 8 | 108/10/09,6916829,594801990,86.15,86.2,85.8,85.8,-0.7,1835 9 | 108/10/14,9491298,828885815,87.0,87.55,87.0,87.55,1.75,3957 10 | 108/10/15,4377610,383575647,87.55,87.85,87.3,87.7,0.15,2163 11 | 108/10/16,3983672,350582692,88.0,88.15,87.85,88.1,0.4,2926 12 | 108/10/17,2540883,223655954,88.05,88.15,87.8,88.15,0.05,1408 13 | 108/10/18,2815798,248106090,88.15,88.65,87.9,87.95,-0.2,1592 14 | 108/10/21,1077652,94700394,87.95,88.0,87.75,87.85,-0.1,1257 15 | 108/10/22,3256399,288438607,88.2,88.8,88.2,88.7,0.85,1639 16 | 108/10/23,2580656,228554820,88.7,88.8,88.3,88.45,-0.25,1289 17 | 108/10/24,2579559,228735385,88.7,88.8,88.5,88.8,0.35,1523 18 | 108/10/25,7971190,708933934,89.2,89.2,88.6,88.8,0.0,2550 19 | 108/10/28,5009774,446669910,89.25,89.3,89.0,89.2,0.4,2550 20 | 108/10/29,7410985,663510736,89.5,89.65,89.35,89.45,0.25,2800 21 | 108/10/30,5384270,482121683,89.45,89.85,89.3,89.85,0.4,1803 22 | 108/10/31,9458164,854001219,89.9,90.6,89.9,90.1,0.25,2116 23 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20191101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/11/01,2806778,252465747,90.0,90.2,89.75,90.1,0.0,1648 3 | 108/11/04,6730681,615367052,90.55,92.25,90.55,92.2,2.1,3034 4 | 108/11/05,3966279,367357250,92.4,92.9,92.35,92.9,0.7,2409 5 | 108/11/06,4494319,418107400,92.95,93.35,92.75,93.35,0.45,2691 6 | 108/11/07,3050118,282827556,93.2,93.2,92.35,92.85,-0.5,1940 7 | 108/11/08,2890536,267788689,93.0,93.05,92.4,92.55,-0.3,1583 8 | 108/11/11,5859344,535835470,92.4,92.45,91.05,91.15,-1.4,2994 9 | 108/11/12,2426297,222545554,91.55,92.0,91.55,92.0,0.85,1594 10 | 108/11/13,1935545,176904008,91.55,91.65,91.05,91.45,-0.55,1181 11 | 108/11/14,2174281,198947342,91.6,91.8,91.2,91.4,-0.05,1038 12 | 108/11/15,2510879,231639658,92.0,92.5,92.0,92.3,0.9,1536 13 | 108/11/18,2087613,193351977,92.5,92.9,92.4,92.9,0.6,1586 14 | 108/11/19,2821624,263329860,92.9,93.6,92.65,93.6,0.7,1750 15 | 108/11/20,7954619,741833623,93.6,93.6,93.1,93.25,-0.35,3259 16 | 108/11/21,3283838,302750501,92.3,92.55,91.8,92.5,-0.75,1619 17 | 108/11/22,1506544,139445637,92.55,92.75,92.4,92.55,0.05,931 18 | 108/11/25,2520694,234066063,93.0,93.1,92.55,92.6,0.05,2186 19 | 108/11/26,3827480,355795288,92.95,93.3,92.8,92.85,0.25,2029 20 | 108/11/27,1957676,181984052,92.85,93.2,92.75,93.2,0.35,1107 21 | 108/11/28,1352720,125715522,93.25,93.25,92.8,92.95,-0.25,887 22 | 108/11/29,5344208,490829372,92.85,92.85,91.45,91.5,-1.45,2592 23 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20191201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/12/02,2068341,190189977,91.95,92.15,91.75,92.05,0.55,1568 3 | 108/12/03,1410794,129802491,91.7,92.2,91.6,92.05,0.0,807 4 | 108/12/04,2310508,211810503,91.85,91.9,91.4,91.7,-0.35,1026 5 | 108/12/05,3441050,319239879,92.35,93.0,92.2,92.9,1.2,1898 6 | 108/12/06,3394433,316362892,93.3,93.5,92.75,93.05,0.15,1691 7 | 108/12/09,2912194,272545756,93.2,93.8,93.2,93.65,0.6,2016 8 | 108/12/10,5465431,508711057,93.4,93.4,92.8,93.0,-0.65,1356 9 | 108/12/11,1936772,181023950,93.0,93.75,92.95,93.75,0.75,1512 10 | 108/12/12,8420111,805189010,94.35,96.1,94.35,95.85,2.1,3414 11 | 108/12/13,5880136,570464417,96.75,97.4,96.7,96.9,1.05,3045 12 | 108/12/16,4482448,434247973,96.95,97.05,96.65,96.85,-0.05,3153 13 | 108/12/17,4703223,458806704,96.75,98.15,96.7,98.15,1.3,2810 14 | 108/12/18,3762355,368980745,98.0,98.3,97.8,98.2,0.05,2718 15 | 108/12/19,2271007,222130098,98.15,98.2,97.55,97.65,-0.55,1774 16 | 108/12/20,3353485,325788665,97.55,97.55,96.7,96.95,-0.7,2393 17 | 108/12/23,3416729,331574305,97.0,97.3,96.95,97.15,0.2,2170 18 | 108/12/24,1409728,137094824,97.3,97.45,97.2,97.2,0.05,830 19 | 108/12/25,1789167,173900527,97.2,97.45,97.05,97.35,0.15,1847 20 | 108/12/26,3095969,301266167,97.55,97.55,97.1,97.35,0.0,1119 21 | 108/12/27,2978047,291993656,97.6,98.15,97.6,98.0,0.65,1942 22 | 108/12/30,3138762,307621326,98.0,98.25,97.6,97.8,-0.2,1941 23 | 108/12/31,4303947,417657710,97.1,97.2,96.95,96.95,-0.85,1852 24 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20200101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 109/01/02,4882015,476649683,97.05,98.0,97.05,97.65,+0.70,2421 3 | 109/01/03,6813547,665657992,98.3,98.7,97.0,97.65,0.00,3080 4 | 109/01/06,9321768,901060879,97.05,97.1,96.4,96.4,-1.25,4809 5 | 109/01/07,6328602,607425541,96.45,96.7,95.4,96.1,-0.30,4116 6 | 109/01/08,8516995,813733739,95.2,96.2,95.05,95.65,-0.45,5033 7 | 109/01/09,7163943,693086421,96.3,97.1,96.3,96.95,+1.30,3879 8 | 109/01/10,9071925,882408791,97.5,97.8,96.95,97.3,+0.35,4900 9 | 109/01/13,6650898,650806854,97.85,98.1,97.5,98.0,+0.70,2883 10 | 109/01/14,11544956,1138704185,98.5,98.85,98.4,98.6,+0.60,6403 11 | 109/01/15,10259354,1004716001,98.7,98.7,97.45,97.6,-1.00,5316 12 | 109/01/16,8686499,844614108,97.15,97.5,97.0,97.3,-0.30,2646 13 | 109/01/17,8121134,791003262,97.7,97.75,97.1,97.3,0.00,2944 14 | 109/01/20,6969945,681688026,97.55,98.0,97.55,97.7,+0.40,3130 15 | 109/01/30,32262874,3014149166,95.0,95.0,92.15,92.15,-5.55,16273 16 | 109/01/31,22497767,2030143514,90.65,90.65,89.65,89.95,X0.00,11950 17 | -------------------------------------------------------------------------------- /stock_data/0050/0050_20200201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 109/02/03,15823593,1401640343,88.5,89.15,87.6,89.05,-0.9,7843 3 | 109/02/04,8904471,804708649,89.45,90.95,89.2,90.6,1.55,4851 4 | 109/02/05,6701508,609037681,91.0,91.3,90.3,90.85,0.25,4001 5 | 109/02/06,10696477,982277669,91.65,92.3,91.35,92.3,1.45,4113 6 | 109/02/07,9554828,871832328,91.65,91.65,90.95,91.2,-1.1,4992 7 | 109/02/10,7308908,661411947,90.0,91.2,89.6,91.0,-0.2,3838 8 | 109/02/11,5115402,468988015,91.35,91.95,91.35,91.75,0.75,3724 9 | 109/02/12,5640117,521567062,92.0,92.9,92.0,92.65,0.9,2845 10 | 109/02/13,5754317,534947681,93.0,93.25,92.7,92.8,0.15,2530 11 | 109/02/14,4988165,463738591,92.8,93.25,92.55,92.95,0.15,2592 12 | 109/02/17,6266211,578240762,92.3,92.55,91.95,92.3,-0.65,2983 13 | 109/02/18,12529356,1143154993,91.4,91.6,91.0,91.05,-1.25,6041 14 | 109/02/19,7947011,730212458,91.15,92.25,91.05,92.1,1.05,3934 15 | 109/02/20,6538336,599664476,92.35,92.5,91.35,91.7,-0.4,2619 16 | 109/02/21,5401188,493195200,91.65,91.95,90.95,91.25,-0.45,2963 17 | 109/02/24,13571936,1222019338,90.25,90.4,89.7,90.1,-1.15,7797 18 | 109/02/25,8840104,796170580,89.5,90.5,89.45,90.35,0.25,3943 19 | 109/02/26,15256003,1362216157,89.15,89.75,88.9,89.45,-0.9,7889 20 | 109/02/27,24688054,2190387154,89.35,89.5,88.35,88.65,-0.8,12829 21 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/01/02,18055269,4188555408,231.5,232.5,231.0,232.5,3.0,9954 3 | 107/01/03,31706091,7504382512,236.0,238.0,235.5,237.0,4.5,13633 4 | 107/01/04,29179613,6963192636,240.0,240.0,236.5,239.5,2.5,10953 5 | 107/01/05,23721255,5681934695,240.0,240.0,238.0,240.0,0.5,8659 6 | 107/01/08,21846692,5281823362,242.0,242.5,240.5,242.0,2.0,10251 7 | 107/01/09,19043123,4588314012,242.0,242.0,239.5,242.0,0.0,7124 8 | 107/01/10,25716220,6118683273,241.5,242.0,236.0,236.5,-5.5,10534 9 | 107/01/11,32070338,7500674455,235.0,236.0,232.5,235.0,-1.5,9199 10 | 107/01/12,23141291,5463302207,234.5,238.0,233.5,237.0,2.0,7905 11 | 107/01/15,28576533,6832851887,240.0,240.0,238.0,240.0,3.0,9756 12 | 107/01/16,23407632,5609009540,240.0,240.5,238.0,240.5,0.5,8156 13 | 107/01/17,38118119,9207582787,240.5,243.0,239.0,242.0,1.5,12593 14 | 107/01/18,50119952,12406562364,245.0,250.0,245.0,248.5,6.5,19482 15 | 107/01/19,55061292,13975174348,253.5,255.5,251.5,255.5,7.0,18801 16 | 107/01/22,45907509,11934882643,257.5,262.0,257.0,261.5,6.0,13558 17 | 107/01/23,34606444,9155080569,262.5,266.0,262.5,266.0,4.5,13993 18 | 107/01/24,42600813,11022372004,263.0,263.0,256.5,258.0,-8.0,17287 19 | 107/01/25,46214756,11981089514,258.0,264.0,256.5,258.0,0.0,15826 20 | 107/01/26,43514523,11101977348,256.5,257.5,253.5,255.0,-3.0,12821 21 | 107/01/29,31306234,8067780117,259.0,261.5,255.0,258.5,3.5,12211 22 | 107/01/30,37410591,9523980994,256.0,257.5,252.5,253.0,-5.5,12987 23 | 107/01/31,45807808,11670582000,253.0,257.5,252.0,255.0,2.0,13553 24 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/02/01,30900457,8022694430,257.5,261.0,257.0,259.5,4.5,13598 3 | 107/02/02,25707560,6633344540,259.0,260.0,255.0,259.5,0.0,11404 4 | 107/02/05,46554379,11742299859,251.0,254.5,250.5,253.0,-6.5,16909 5 | 107/02/06,104448048,24944565955,242.5,243.5,234.0,239.0,-14.0,35455 6 | 107/02/07,82299178,19903032966,245.0,245.5,239.5,240.0,1.0,22962 7 | 107/02/08,31192550,7468970072,239.5,242.0,238.0,238.5,-1.5,10274 8 | 107/02/09,65939265,15227192540,230.0,233.0,228.5,232.5,-6.0,19749 9 | 107/02/12,42917236,10113012768,235.5,237.5,235.0,236.5,4.0,10851 10 | 107/02/21,76396174,18582475956,244.5,244.5,242.0,242.5,6.0,21512 11 | 107/02/22,45492993,10977665819,244.0,244.0,239.0,239.5,-3.0,10071 12 | 107/02/23,26985776,6578657620,241.0,245.0,241.0,245.0,5.5,10178 13 | 107/02/26,36165810,8910352170,247.0,247.5,245.0,246.5,1.5,12565 14 | 107/02/27,44699119,11061945363,250.5,250.5,246.0,246.0,-0.5,10908 15 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180301.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/03/01,43847984,10669194561,244.0,245.0,242.0,243.0,-3.0,11589 3 | 107/03/02,35289170,8453712014,240.0,241.0,238.5,240.0,-3.0,10440 4 | 107/03/05,27337846,6607367732,242.5,243.0,240.5,241.5,1.5,9321 5 | 107/03/06,36945780,9155812210,245.5,250.0,245.5,250.0,8.5,13977 6 | 107/03/07,30391219,7525601638,248.0,248.5,246.0,247.0,-3.0,10521 7 | 107/03/08,20645694,5172732531,249.5,251.5,249.0,249.5,2.5,8817 8 | 107/03/09,22887063,5723277170,250.0,251.0,248.5,250.5,1.0,7050 9 | 107/03/12,25100615,6370529728,252.0,255.0,251.5,254.0,3.5,10550 10 | 107/03/13,34264883,8816553606,255.5,259.0,255.0,259.0,5.0,11700 11 | 107/03/14,24254838,6220805864,256.5,257.5,255.5,257.0,-2.0,8518 12 | 107/03/15,19396493,4965546715,258.0,258.0,255.0,255.0,-2.0,5945 13 | 107/03/16,62989326,15930805360,253.0,256.0,249.5,255.0,0.0,18058 14 | 107/03/19,22440766,5679567964,252.5,255.5,251.0,255.0,0.0,9888 15 | 107/03/20,22335151,5640426203,253.0,254.0,251.5,253.0,-2.0,9334 16 | 107/03/21,32977737,8325162114,255.0,255.0,251.0,252.5,-0.5,11575 17 | 107/03/22,27000718,6797045014,254.5,254.5,249.5,251.5,-1.0,10475 18 | 107/03/23,52974390,12994667867,245.0,247.0,244.0,245.0,-6.5,20513 19 | 107/03/26,39487945,9582954454,241.5,244.5,241.5,243.5,-1.5,11404 20 | 107/03/27,31100260,7732298021,248.0,251.0,247.0,251.0,7.5,11698 21 | 107/03/28,29924411,7349468217,247.5,248.0,244.0,245.0,-6.0,13041 22 | 107/03/29,36427345,8888435870,243.0,247.0,242.5,244.0,-1.0,12832 23 | 107/03/30,16996346,4212690462,247.5,249.5,246.0,246.0,2.0,7578 24 | 107/03/31,3603912,893664176,247.5,249.0,246.5,247.5,1.5,2409 25 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180401.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/04/02,19029003,4702581241,248.5,249.0,245.0,246.5,-1.0,6951 3 | 107/04/03,35813944,8710200224,243.0,244.5,242.0,244.0,-2.5,13270 4 | 107/04/09,35465824,8716801768,248.0,248.0,243.5,245.0,1.0,12437 5 | 107/04/10,25268994,6231896018,244.5,249.0,243.5,245.5,0.5,11912 6 | 107/04/11,21777935,5391978180,246.5,248.5,246.5,248.0,2.5,8813 7 | 107/04/12,20476657,5028226522,248.5,248.5,244.0,245.0,-3.0,6898 8 | 107/04/13,19946548,4885963546,246.0,246.0,244.0,244.5,-0.5,5549 9 | 107/04/16,21608528,5251556179,243.0,244.0,242.0,243.5,-1.0,8436 10 | 107/04/17,42756389,10232256860,243.0,243.5,237.5,238.0,-5.5,18381 11 | 107/04/18,44768048,10668587090,239.5,241.5,236.5,238.0,0.0,12132 12 | 107/04/19,33230989,8081404960,242.0,244.5,241.0,244.5,6.5,10987 13 | 107/04/20,129890087,29837344632,228.0,231.5,228.0,229.0,-15.5,46349 14 | 107/04/23,71901975,16282275410,226.5,227.5,225.0,226.5,-2.5,22048 15 | 107/04/24,45206892,10233860296,225.0,227.5,225.0,227.0,0.5,13970 16 | 107/04/25,48975110,11032111105,225.5,226.0,224.0,225.0,-2.0,15136 17 | 107/04/26,48176657,10766085521,225.0,225.5,221.0,222.0,-3.0,16253 18 | 107/04/27,34443459,7679131764,225.0,225.5,221.0,223.5,1.5,10859 19 | 107/04/30,28500789,6448117416,224.5,228.0,222.5,227.0,3.5,9480 20 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180501.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/05/02,38436942,8633492540,227.0,227.5,222.5,223.0,-4.0,11445 3 | 107/05/03,33507731,7399813831,221.0,222.5,220.0,220.5,-2.5,12287 4 | 107/05/04,28477722,6330594053,221.0,224.0,220.5,223.0,2.5,8445 5 | 107/05/07,23751759,5309421525,225.0,225.5,221.5,223.5,0.5,8951 6 | 107/05/08,40324763,9146327464,224.0,228.5,223.5,228.0,4.5,13229 7 | 107/05/09,35597934,8188991070,228.5,232.0,228.5,229.5,1.5,12616 8 | 107/05/10,27530377,6337230710,231.0,231.5,229.0,229.5,0.0,11051 9 | 107/05/11,30693910,7138428530,232.0,234.0,230.5,233.0,3.5,11920 10 | 107/05/14,23577637,5502726121,234.5,234.5,232.5,233.0,0.0,7666 11 | 107/05/15,23771769,5493470187,233.5,234.0,229.5,230.5,-2.5,7810 12 | 107/05/16,14834107,3408682013,229.5,230.5,228.5,230.5,0.0,5398 13 | 107/05/17,27702737,6322484836,231.0,231.5,226.5,226.5,-4.0,8428 14 | 107/05/18,28187541,6327474145,225.5,227.5,223.5,223.5,-3.0,9720 15 | 107/05/21,16417815,3751438835,225.0,230.0,225.0,229.0,5.5,7591 16 | 107/05/22,22422097,5175634112,230.0,233.5,229.0,229.0,0.0,6963 17 | 107/05/23,26737899,6146178621,231.5,231.5,228.5,228.5,-0.5,5059 18 | 107/05/24,13450610,3082675140,229.5,230.0,228.5,229.0,0.5,4240 19 | 107/05/25,16486294,3769909946,228.5,229.5,228.0,228.5,-0.5,5474 20 | 107/05/28,17673270,4020203060,229.5,230.0,226.5,227.0,-1.5,7239 21 | 107/05/29,25770776,5782293276,226.5,226.5,223.5,225.0,-2.0,11400 22 | 107/05/30,49667788,10997306304,224.0,224.0,220.5,221.0,-4.0,21406 23 | 107/05/31,96587458,21553655265,221.5,224.0,220.5,224.0,3.0,12737 24 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180601.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/06/01,36652094,8209412370,224.5,226.5,224.0,224.0,0.00,7627 3 | 107/06/04,31257480,7131988670,227.5,229.0,227.0,229.0,+5.00,9746 4 | 107/06/05,27714384,6329201896,230.0,230.0,226.5,229.0,0.00,8509 5 | 107/06/06,30375441,6961135060,229.0,230.0,227.0,230.0,+1.00,9758 6 | 107/06/07,25277266,5809345446,231.0,231.5,228.0,230.0,0.00,9146 7 | 107/06/08,24192851,5493234408,229.0,229.0,226.0,227.0,-3.00,7775 8 | 107/06/11,22028933,4980629259,226.5,227.0,225.0,226.0,-1.00,6726 9 | 107/06/12,30189360,6837374510,225.0,229.0,224.0,229.0,+3.00,8281 10 | 107/06/13,36081120,8311856296,229.0,232.0,228.0,232.0,+3.00,10687 11 | 107/06/14,36932041,8423126398,230.0,230.0,226.5,226.5,-5.50,12252 12 | 107/06/15,49506679,11291127719,225.0,231.0,224.0,231.0,+4.50,10090 13 | 107/06/19,61142624,13754800554,225.5,226.0,224.0,225.0,-6.00,19088 14 | 107/06/20,40708701,9175159127,224.5,227.5,223.5,226.0,+1.00,13262 15 | 107/06/21,32572707,7379769339,227.5,228.0,226.0,226.5,+0.50,9421 16 | 107/06/22,44211409,9994644852,224.5,227.5,224.0,227.5,+1.00,14388 17 | 107/06/25,49058211,10749795782,220.0,220.5,218.0,218.0,X0.00,17959 18 | 107/06/26,43080346,9242648746,215.5,216.0,212.5,214.5,-3.50,15639 19 | 107/06/27,40863414,8742004301,216.0,216.0,212.5,213.0,-1.50,12681 20 | 107/06/28,38816780,8231075920,211.0,214.5,210.0,212.0,-1.00,10772 21 | 107/06/29,36848680,7919779720,212.0,217.0,212.0,216.5,+4.50,8652 22 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180701.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/07/02,33496442,7257081470,218.5,219.0,214.0,214.0,-2.5,8508 3 | 107/07/03,28663220,6173115899,215.5,218.0,213.5,214.5,0.5,7758 4 | 107/07/04,15359295,3324927032,217.0,217.5,215.5,216.0,1.5,5434 5 | 107/07/05,18225416,3904832940,214.0,215.0,213.0,214.5,-1.5,5581 6 | 107/07/06,31344962,6779063394,217.5,217.5,215.0,217.0,2.5,8620 7 | 107/07/09,41165793,9100880393,219.5,223.0,218.5,221.5,4.5,14795 8 | 107/07/10,20196957,4498264914,223.0,224.0,222.0,222.0,0.5,6922 9 | 107/07/11,19854690,4355547100,220.0,220.0,218.0,220.0,-2.0,7437 10 | 107/07/12,23806051,5246628771,218.0,222.0,218.0,220.5,0.5,7885 11 | 107/07/13,30419311,6799894334,222.5,224.5,222.5,224.5,4.0,11723 12 | 107/07/16,16107254,3612296896,224.5,225.0,223.5,223.5,-1.0,6321 13 | 107/07/17,22554436,5003028272,222.5,223.5,221.0,221.5,-2.0,8636 14 | 107/07/18,45802658,10221407834,223.0,224.0,222.0,223.0,1.5,12139 15 | 107/07/19,43976216,9930715930,225.5,227.0,224.5,224.5,1.5,12076 16 | 107/07/20,103652023,24367904428,235.0,237.5,233.0,237.5,13.0,39544 17 | 107/07/23,52269877,12621500480,239.0,245.0,238.5,241.0,3.5,19777 18 | 107/07/24,27468267,6599675515,240.0,241.5,238.5,241.0,0.0,10574 19 | 107/07/25,21530312,5173924310,239.0,241.0,239.0,240.5,-0.5,8491 20 | 107/07/26,30856388,7435261120,241.0,242.5,239.5,241.0,0.5,10235 21 | 107/07/27,27129646,6605479210,242.0,244.5,241.0,244.5,3.5,12493 22 | 107/07/30,22803730,5585710909,244.5,245.5,244.0,245.5,1.0,9953 23 | 107/07/31,28202542,6912550610,243.5,246.0,242.0,246.0,0.5,9460 24 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180801.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/08/01,29777161,7375488342,247.0,248.0,246.5,248.0,2.0,11667 3 | 107/08/02,22775110,5611725541,249.0,249.5,243.5,244.5,-3.5,10343 4 | 107/08/03,25165097,6205758662,246.0,248.0,245.0,247.0,2.5,9585 5 | 107/08/06,22364568,5487396854,245.0,247.0,244.0,245.5,-1.5,9732 6 | 107/08/07,24352418,5922738042,245.0,245.5,241.5,241.5,-4.0,9665 7 | 107/08/08,24382432,6011480272,245.0,247.5,244.5,247.5,6.0,10247 8 | 107/08/09,15128655,3740736404,247.0,248.0,246.0,247.0,-0.5,7127 9 | 107/08/10,16125492,3961311040,246.5,247.0,244.5,245.0,-2.0,6558 10 | 107/08/13,17881194,4302280285,241.5,243.0,239.0,240.5,-4.5,9875 11 | 107/08/14,17488913,4262753253,245.0,245.0,242.5,243.5,3.0,7415 12 | 107/08/15,19236321,4642117523,244.5,244.5,239.5,241.5,-2.0,8920 13 | 107/08/16,19155966,4587260340,238.0,241.5,238.0,239.0,-2.5,9397 14 | 107/08/17,19634474,4707354383,239.5,241.0,239.0,239.5,0.5,6680 15 | 107/08/20,17014437,4068729103,239.5,240.0,238.0,239.5,0.0,6640 16 | 107/08/21,13871127,3328215657,239.0,241.0,238.5,241.0,1.5,5474 17 | 107/08/22,12679240,3063201922,241.5,242.5,240.5,242.0,1.0,5009 18 | 107/08/23,17216240,4200671070,243.0,244.5,243.0,244.5,2.5,5660 19 | 107/08/24,15446943,3772959070,245.5,246.0,243.0,243.5,-1.0,5099 20 | 107/08/27,15579299,3825736755,246.0,246.5,244.5,245.0,1.5,7858 21 | 107/08/28,40410531,10075613779,248.5,250.0,248.0,249.5,4.5,16881 22 | 107/08/29,57633182,14784556456,253.5,259.0,253.5,259.0,9.5,25668 23 | 107/08/30,52622808,13914404873,264.5,268.0,262.5,263.5,4.5,22862 24 | 107/08/31,70000506,17920548387,257.5,259.0,254.0,256.0,-7.5,19019 25 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20180901.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/09/03,34510555,8901193266,259.0,260.0,256.5,257.0,1.0,11442 3 | 107/09/04,41455615,10654493061,258.5,259.5,255.5,257.5,0.5,9069 4 | 107/09/05,52706459,13833360422,260.0,264.5,259.0,264.0,6.5,16421 5 | 107/09/06,39779488,10467251488,268.0,268.0,261.0,261.0,-3.0,11996 6 | 107/09/07,44746728,11753033262,263.0,264.0,260.5,264.0,3.0,15015 7 | 107/09/10,62851599,16669866076,266.5,266.5,262.5,264.5,0.5,15504 8 | 107/09/11,44981276,11709484991,263.0,263.5,258.0,260.0,-4.5,14768 9 | 107/09/12,38415965,9987682900,261.0,262.0,258.0,260.5,0.5,12104 10 | 107/09/13,37959180,9721989110,260.0,260.0,253.5,255.0,-5.5,14987 11 | 107/09/14,40034219,10379404959,257.0,261.5,257.0,261.0,6.0,15690 12 | 107/09/17,25041358,6483537091,262.5,262.5,257.0,258.0,-3.0,10710 13 | 107/09/18,34381152,8771502830,256.5,257.0,254.0,254.5,-3.5,11097 14 | 107/09/19,69978711,18074954749,258.0,260.0,257.0,258.0,3.5,14056 15 | 107/09/20,35577071,9225009310,261.5,261.5,257.5,260.0,2.0,9444 16 | 107/09/21,36500974,9510363894,261.5,261.5,258.0,261.5,1.5,10159 17 | 107/09/25,24978062,6552894296,261.5,264.0,260.5,263.5,2.0,10082 18 | 107/09/26,25061115,6577367245,263.0,263.5,261.0,263.5,0.0,7007 19 | 107/09/27,38495371,10185827315,264.0,266.0,262.0,265.0,1.5,11536 20 | 107/09/28,39645486,10412455506,266.0,266.0,260.0,262.5,-2.5,13060 21 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20181001.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/10/01,22409380,5882532290,262.0,264.0,261.0,263.0,0.5,11914 3 | 107/10/02,38391491,9926505357,262.0,263.0,257.0,257.5,-5.5,17095 4 | 107/10/03,25228536,6527393860,257.5,260.0,257.0,260.0,2.5,9992 5 | 107/10/04,38009727,9690178362,257.0,257.5,254.0,254.0,-6.0,15094 6 | 107/10/05,40396660,10101451270,250.0,253.0,248.5,250.0,-4.0,16031 7 | 107/10/08,51083958,12426290240,245.5,246.5,241.0,243.5,-6.5,20745 8 | 107/10/09,28933345,7051600725,243.5,245.0,242.0,244.0,0.5,11743 9 | 107/10/11,96033657,22115862239,233.5,233.5,227.0,227.5,-16.5,37543 10 | 107/10/12,54439769,12650322522,231.0,237.0,229.0,237.0,9.5,17980 11 | 107/10/15,46471280,10766953220,234.0,234.0,230.5,230.5,-6.5,16558 12 | 107/10/16,39129077,9155829047,229.5,237.0,229.0,237.0,6.5,15182 13 | 107/10/17,42887858,10318955161,241.5,243.0,238.0,238.5,1.5,17550 14 | 107/10/18,27793430,6587887632,238.0,239.0,235.5,236.5,-2.0,10599 15 | 107/10/19,29648460,6927405460,231.0,236.5,230.0,236.0,-0.5,12378 16 | 107/10/22,29275777,6872467149,232.5,238.0,231.5,237.0,1.0,10384 17 | 107/10/23,36757745,8538586595,232.0,234.0,230.0,230.0,-7.0,13071 18 | 107/10/24,45480950,10426514872,230.0,231.0,227.0,229.5,-0.5,17339 19 | 107/10/25,75524118,16643542368,220.5,222.0,219.5,219.5,-10.0,27514 20 | 107/10/26,54073644,11941421696,223.0,224.0,217.0,221.0,1.5,17106 21 | 107/10/29,18463792,4107663616,223.0,224.0,221.0,222.5,1.5,7679 22 | 107/10/30,29085931,6487213284,221.0,225.0,220.5,223.0,0.5,8574 23 | 107/10/31,59933201,13844478353,228.0,234.0,228.0,234.0,11.0,19183 24 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20181101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/11/01,44514797,10480329245,236.0,237.0,233.0,235.5,1.5,11435 3 | 107/11/02,30785361,7249667833,236.5,236.5,233.5,236.5,1.0,11223 4 | 107/11/05,28157065,6592130635,233.0,235.5,232.0,235.0,-1.5,6994 5 | 107/11/06,35501176,8311988968,234.0,235.5,232.5,234.5,-0.5,7013 6 | 107/11/07,39842652,9337023278,233.0,236.0,232.5,234.0,-0.5,7387 7 | 107/11/08,28086146,6645771069,237.5,237.5,236.0,236.5,2.5,9461 8 | 107/11/09,23792081,5526997792,234.5,234.5,231.0,231.0,-5.5,7886 9 | 107/11/12,26202445,6101377163,230.0,234.5,230.0,231.5,0.5,6252 10 | 107/11/13,37565127,8504691960,224.5,228.0,224.5,227.5,-4.0,11507 11 | 107/11/14,24565279,5639284241,230.0,231.0,228.5,228.5,1.0,6007 12 | 107/11/15,22230228,5124189444,229.5,232.0,228.5,231.0,2.5,5996 13 | 107/11/16,47138909,10696822542,229.0,229.0,225.0,226.0,-5.0,16009 14 | 107/11/19,51034754,11355347628,225.0,225.0,221.0,222.0,-4.0,16289 15 | 107/11/20,45686756,9995960780,219.0,220.5,218.0,218.0,-4.0,16874 16 | 107/11/21,38478343,8361178460,214.5,220.0,214.0,219.0,1.0,13580 17 | 107/11/22,22060610,4867686945,221.5,222.0,219.0,219.0,0.0,9095 18 | 107/11/23,15553334,3406422046,220.5,220.5,217.0,218.5,-0.5,6164 19 | 107/11/26,35267804,7847501792,219.0,224.0,218.5,223.0,4.5,9422 20 | 107/11/27,32676349,7239283641,220.0,224.5,219.0,224.0,1.0,10170 21 | 107/11/28,24759026,5560623349,222.5,227.0,222.0,226.5,2.5,8316 22 | 107/11/29,46206207,10629450003,231.5,231.5,229.0,229.0,2.5,15849 23 | 107/11/30,57352957,12995823319,229.5,231.0,225.5,225.5,-3.5,10931 24 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20181201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 107/12/03,49612186,11579966474,231.0,235.0,231.0,235.0,9.5,19747 3 | 107/12/04,41947162,9791147799,233.0,234.5,231.0,234.0,-1.0,12545 4 | 107/12/05,45634576,10316394736,226.5,227.5,225.0,226.0,-8.0,15703 5 | 107/12/06,40181112,8853295746,220.0,222.0,219.5,220.0,-6.0,15702 6 | 107/12/07,31997568,7097739916,222.5,223.5,220.5,221.0,1.0,8315 7 | 107/12/10,26229461,5744814170,219.5,220.0,218.5,219.0,-2.0,8650 8 | 107/12/11,27395220,6067551383,220.0,223.0,219.0,222.5,3.5,8509 9 | 107/12/12,32926379,7418108779,223.5,227.0,222.5,226.5,4.0,9117 10 | 107/12/13,32433141,7345479366,227.0,227.5,225.0,226.0,-0.5,8635 11 | 107/12/14,43226159,9570070114,223.0,223.5,220.5,222.5,-3.5,10454 12 | 107/12/17,18964952,4229977248,221.0,225.0,220.0,223.5,1.0,6449 13 | 107/12/18,30270541,6713448829,221.0,223.0,220.5,222.5,-1.0,10521 14 | 107/12/19,23415082,5255393450,222.0,225.5,222.0,225.5,3.0,7875 15 | 107/12/20,38697116,8573665030,221.0,222.5,221.0,221.0,-4.5,10528 16 | 107/12/21,46947532,10401202852,219.0,224.0,219.0,223.5,2.5,9554 17 | 107/12/22,5185247,1145814834,220.0,221.5,220.0,221.5,-2.0,2229 18 | 107/12/24,23376100,5151549100,221.5,221.5,219.5,220.0,-1.5,6122 19 | 107/12/25,19402777,4198767163,215.5,218.0,215.0,217.5,-2.5,8065 20 | 107/12/26,16893259,3678108462,218.5,219.5,216.0,216.5,-1.0,6998 21 | 107/12/27,21915484,4874845852,222.0,224.0,220.5,223.0,6.5,9531 22 | 107/12/28,30156773,6762447425,223.5,225.5,222.5,225.5,2.5,10247 23 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/01/02,32900482,7276419230,226.5,226.5,219.0,219.5,-6.0,12329 3 | 108/01/03,34615620,7459051790,214.0,218.0,214.0,215.5,-4.0,14549 4 | 108/01/04,67043521,13987136785,211.5,211.5,206.5,208.0,-7.5,28786 5 | 108/01/07,35695176,7591116569,212.0,214.0,211.0,213.0,5.0,11224 6 | 108/01/08,23794481,5019703557,212.0,212.5,210.0,211.0,-2.0,9377 7 | 108/01/09,51255446,11006827093,212.0,216.5,211.0,215.5,4.5,14098 8 | 108/01/10,20832593,4491377349,216.0,216.5,214.5,216.0,0.5,6018 9 | 108/01/11,28658288,6296719320,219.0,220.5,218.0,220.5,4.5,11198 10 | 108/01/14,17612296,3844735324,218.5,220.0,217.0,218.5,-2.0,6469 11 | 108/01/15,42990923,9399209983,216.5,221.0,215.5,221.0,2.5,11609 12 | 108/01/16,30038282,6563789758,218.5,220.0,217.5,217.5,-3.5,8950 13 | 108/01/17,21163986,4646131841,218.0,221.0,218.0,220.5,3.0,8288 14 | 108/01/18,52677569,11530053787,219.0,220.0,217.5,218.5,-2.0,15157 15 | 108/01/21,32515866,7208829658,220.0,223.0,220.0,221.0,2.5,10549 16 | 108/01/22,30958483,6854867566,220.0,223.0,219.0,223.0,2.0,8258 17 | 108/01/23,18671213,4121110926,221.5,222.0,220.0,220.5,-2.5,7059 18 | 108/01/24,31348924,6958753608,222.5,222.5,220.5,222.5,2.0,6291 19 | 108/01/25,48039764,10870045150,226.5,227.0,225.0,226.0,3.5,14979 20 | 108/01/28,29134257,6665379096,229.5,229.5,228.0,229.0,3.0,10189 21 | 108/01/29,42566520,9486156460,222.5,225.0,222.0,222.5,-6.5,13344 22 | 108/01/30,51889945,11453957730,220.5,221.5,220.0,221.0,-1.5,12858 23 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/02/11,81360106,18546167132,228.0,229.0,226.5,228.0,7.0,21689 3 | 108/02/12,30125670,6921488930,230.0,230.0,229.0,230.0,2.0,13313 4 | 108/02/13,28634925,6575201825,232.0,232.0,228.5,229.0,-1.0,10230 5 | 108/02/14,23647751,5392943977,229.5,230.0,226.0,227.0,-2.0,6873 6 | 108/02/15,22369799,5093773373,229.0,229.0,226.5,227.0,0.0,5743 7 | 108/02/18,18163916,4169729625,229.0,230.5,228.5,230.0,3.0,7035 8 | 108/02/19,18423023,4228108427,230.0,230.5,229.0,229.0,-1.0,6471 9 | 108/02/20,31887710,7430197670,231.5,234.5,231.0,234.5,5.5,14241 10 | 108/02/21,34013489,8013908284,235.5,236.5,234.5,236.5,2.0,11443 11 | 108/02/22,22032163,5187054985,235.5,236.5,234.0,236.5,0.0,6913 12 | 108/02/25,25227138,5995746054,237.5,239.0,236.0,238.0,1.5,8527 13 | 108/02/26,24586789,5864298571,239.0,240.0,236.5,239.5,1.5,7994 14 | 108/02/27,37947889,9052540803,238.5,239.5,237.0,239.0,-0.5,9931 15 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190301.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/03/04,45164513,10691130829,239.5,239.5,234.5,235.5,-3.5,13323 3 | 108/03/05,23708407,5533050748,234.0,234.5,232.5,233.0,-2.5,8706 4 | 108/03/06,20811226,4872352124,235.0,235.5,233.5,234.0,1.0,7090 5 | 108/03/07,17226192,4029782428,235.0,235.0,233.0,234.0,0.0,5768 6 | 108/03/08,22535659,5183171608,231.0,231.5,229.0,230.0,-4.0,8931 7 | 108/03/11,34282793,7835079913,228.0,230.5,227.5,230.5,0.5,7451 8 | 108/03/12,23839972,5601351324,233.0,237.0,232.5,235.5,5.0,9253 9 | 108/03/13,22493195,5308051755,234.0,237.0,234.0,237.0,1.5,6269 10 | 108/03/14,17281356,4077045380,239.0,239.0,234.0,234.5,-2.5,6564 11 | 108/03/15,34542729,8231572752,237.0,239.5,235.5,239.0,4.5,8872 12 | 108/03/18,27040532,6493129050,239.5,241.0,239.0,241.0,2.0,10690 13 | 108/03/19,14620009,3496720720,239.0,240.5,238.0,240.5,-0.5,7105 14 | 108/03/20,23055971,5563557011,242.0,242.0,239.5,242.0,1.5,6757 15 | 108/03/21,27514502,6710510004,242.5,245.5,241.0,245.5,3.5,11071 16 | 108/03/22,22996467,5680726299,248.0,248.5,244.5,248.5,3.0,10485 17 | 108/03/25,19273254,4662705968,240.5,243.5,240.5,241.5,-7.0,8468 18 | 108/03/26,21053170,5109273236,243.0,244.0,241.0,244.0,2.5,6630 19 | 108/03/27,23622089,5703467700,242.0,242.5,240.5,241.5,-2.5,7603 20 | 108/03/28,13998054,3379510718,240.5,242.5,240.0,242.0,0.5,3948 21 | 108/03/29,31024810,7568601014,243.0,245.5,240.5,245.5,3.5,6712 22 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190401.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/04/01,35330656,8758161220,251.0,251.0,245.0,245.5,0.0,13292 3 | 108/04/02,25189053,6226523038,249.5,249.5,246.0,246.0,0.5,9171 4 | 108/04/03,28581323,7075597562,249.0,249.0,246.5,246.5,0.5,8067 5 | 108/04/08,46426821,11682512762,251.0,253.0,250.5,253.0,6.5,16430 6 | 108/04/09,22745674,5760337782,253.0,254.0,252.0,254.0,1.0,8323 7 | 108/04/10,33174934,8403528302,253.0,254.5,252.0,254.0,0.0,9992 8 | 108/04/11,25146840,6347861680,253.0,254.0,251.5,252.0,-2.0,8284 9 | 108/04/12,13888148,3496444666,251.5,253.0,251.0,252.0,0.0,4931 10 | 108/04/15,17257002,4403988510,255.0,256.0,254.0,255.5,3.5,6739 11 | 108/04/16,20231648,5185697928,257.0,257.0,255.5,257.0,1.5,7676 12 | 108/04/17,39037191,10202504410,260.0,263.0,259.5,261.5,4.5,13486 13 | 108/04/18,48525490,12836006732,264.0,266.0,263.5,264.5,3.0,12208 14 | 108/04/19,47698699,12712409558,269.0,269.5,263.5,264.5,0.0,14431 15 | 108/04/22,24967393,6635995145,266.5,267.5,265.0,266.0,1.5,8527 16 | 108/04/23,26251847,7017363629,266.5,268.0,266.0,268.0,2.0,9394 17 | 108/04/24,37386755,10044241090,270.0,270.0,267.5,269.0,1.0,9687 18 | 108/04/25,36572455,9800038536,268.5,269.0,267.0,267.5,-1.5,7331 19 | 108/04/26,51743804,13459329059,262.0,263.0,257.5,260.0,-7.5,16674 20 | 108/04/29,32651618,8477117257,260.0,262.0,258.5,259.5,-0.5,10407 21 | 108/04/30,40446419,10484399861,260.0,260.5,258.0,259.0,-0.5,10939 22 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190501.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/05/02,27376394,7122135656,261.5,262.5,258.5,259.0,0.0,9110 3 | 108/05/03,30200246,7940572444,262.0,265.0,260.5,265.0,6.0,10068 4 | 108/05/06,33688187,8717053470,260.0,260.0,258.0,259.0,-6.0,12535 5 | 108/05/07,25686126,6719199455,259.5,263.0,259.0,262.5,3.5,8339 6 | 108/05/08,25902364,6750083504,260.0,261.5,259.5,260.0,-2.5,7905 7 | 108/05/09,34166574,8798140796,259.5,259.5,256.0,256.5,-3.5,10995 8 | 108/05/10,18868212,4844594484,257.0,259.0,255.0,256.0,-0.5,8009 9 | 108/05/13,29317535,7374249589,253.0,254.0,249.5,250.5,-5.5,11974 10 | 108/05/14,45620708,11345067455,247.5,251.0,245.0,248.5,-2.0,14283 11 | 108/05/15,37223479,9327051888,251.0,252.0,249.0,249.0,0.5,12041 12 | 108/05/16,30331519,7520908612,248.5,249.5,246.0,247.0,-2.0,11402 13 | 108/05/17,40006856,9775372898,249.0,249.0,241.5,241.5,-5.5,15217 14 | 108/05/20,47097661,11303513908,242.5,243.0,238.0,238.0,-3.5,13099 15 | 108/05/21,82872775,19418705158,233.5,236.0,232.5,234.0,-4.0,25418 16 | 108/05/22,36289034,8669172710,236.5,240.5,235.5,238.0,4.0,14019 17 | 108/05/23,62258627,14379543985,233.5,233.5,230.0,230.0,-8.0,24974 18 | 108/05/24,38226789,8866253632,230.0,234.0,230.0,233.0,3.0,14586 19 | 108/05/27,37447033,8697538216,234.0,235.0,231.0,231.0,-2.0,13895 20 | 108/05/28,99322033,22910765567,232.0,232.0,230.5,230.5,-0.5,10122 21 | 108/05/29,32260236,7385029780,228.0,230.5,227.0,229.5,-1.0,10233 22 | 108/05/30,40375328,9292745636,230.0,231.5,229.0,231.0,1.5,8772 23 | 108/05/31,49163217,11559578381,232.0,237.5,231.0,235.5,4.5,14365 24 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190601.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/06/03,36687092,8651389851,235.5,238.5,232.0,238.0,+2.50,8857 3 | 108/06/04,24443428,5745045809,237.5,238.0,233.0,233.0,-5.00,11779 4 | 108/06/05,35901584,8461930934,238.0,238.0,234.0,235.0,+2.00,12064 5 | 108/06/06,34651731,8008768323,231.5,232.0,229.5,232.0,-3.00,14723 6 | 108/06/10,35521888,8442986620,237.5,240.0,234.5,240.0,+8.00,15588 7 | 108/06/11,34691670,8448805962,240.0,246.0,239.0,244.5,+4.50,13157 8 | 108/06/12,30409556,7469805086,244.5,247.5,243.0,246.0,+1.50,11457 9 | 108/06/13,33731724,8136137708,242.5,244.0,240.0,240.0,-6.00,13552 10 | 108/06/14,35403556,8396819832,238.5,239.5,236.0,236.0,-4.00,14911 11 | 108/06/17,51692012,12043369475,231.5,235.0,230.5,233.0,-3.00,20943 12 | 108/06/18,28798087,6758454612,234.0,235.5,233.0,235.5,+2.50,9681 13 | 108/06/19,50234372,12181979568,242.5,244.0,240.5,244.0,+8.50,20528 14 | 108/06/20,39717291,9697726719,242.0,245.5,241.0,245.0,+1.00,13879 15 | 108/06/21,62136304,15398139830,248.0,248.5,246.0,248.5,+3.50,19049 16 | 108/06/24,43460507,10476936660,241.0,242.0,240.0,241.0,X0.00,17780 17 | 108/06/25,29735283,7118002390,241.0,241.5,237.0,238.5,-2.50,11130 18 | 108/06/26,28770041,6757991717,235.0,236.5,234.0,234.5,-4.00,13535 19 | 108/06/27,42007834,10063332494,236.0,241.5,236.0,240.5,+6.00,14983 20 | 108/06/28,28085212,6715488371,241.5,241.5,238.0,239.0,-1.50,8987 21 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190701.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/07/01,66370875,16445222750,245.5,250.0,245.0,248.5,9.5,29551 3 | 108/07/02,26832202,6671951743,249.5,250.0,247.5,249.0,0.5,12531 4 | 108/07/03,29549774,7190777082,244.0,245.0,242.0,242.5,-6.5,16033 5 | 108/07/04,18691240,4561556160,244.5,245.0,242.5,244.0,1.5,8565 6 | 108/07/05,27317074,6624379927,244.5,245.0,241.5,243.0,-1.0,9013 7 | 108/07/08,29190909,7057462187,240.0,244.5,240.0,242.5,-0.5,10552 8 | 108/07/09,16538987,3998096596,241.5,243.0,240.5,242.0,-0.5,6486 9 | 108/07/10,23812131,5839691357,243.0,247.0,243.0,247.0,5.0,12366 10 | 108/07/11,31296289,7809358257,250.0,250.0,247.5,250.0,3.0,14360 11 | 108/07/12,23868432,5984689000,252.0,252.0,249.5,250.5,0.5,8363 12 | 108/07/15,34264300,8663129910,251.0,254.5,249.5,254.5,4.0,12174 13 | 108/07/16,26141249,6678755679,254.0,256.5,253.5,256.0,1.5,8994 14 | 108/07/17,34346648,8686815824,254.0,254.0,251.0,252.0,-4.0,11106 15 | 108/07/18,20908575,5300082470,252.0,254.5,251.5,254.0,2.0,8245 16 | 108/07/19,59879798,15573278932,259.5,261.0,259.0,259.0,5.0,21827 17 | 108/07/22,31863639,8385222407,263.0,264.0,262.0,264.0,5.0,13424 18 | 108/07/23,29273223,7734089131,265.5,266.5,262.5,264.0,0.0,12791 19 | 108/07/24,24511039,6484708226,266.5,266.5,263.0,265.0,1.0,10617 20 | 108/07/25,30698545,8091922380,264.0,265.0,261.5,265.0,0.0,10643 21 | 108/07/26,20768071,5434082968,261.0,262.5,261.0,261.0,-4.0,8850 22 | 108/07/29,18473320,4822762518,260.0,262.0,259.5,261.0,0.0,6681 23 | 108/07/30,22895612,5975389270,262.5,263.0,260.0,260.0,-1.0,7191 24 | 108/07/31,36365601,9413416604,260.0,260.0,257.0,259.5,-0.5,10468 25 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190801.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/08/01,30107526,7722031382,257.5,257.5,255.5,256.5,-3.0,11372 3 | 108/08/02,54165644,13627068452,252.0,253.5,250.5,251.5,-5.0,18096 4 | 108/08/05,52835721,13092403583,251.0,252.0,245.5,246.5,-5.0,20136 5 | 108/08/06,58916879,14440787992,240.0,250.0,240.0,248.5,2.0,22358 6 | 108/08/07,29435460,7305272500,250.0,250.5,246.5,248.0,-0.5,11208 7 | 108/08/08,30140266,7599200564,248.0,254.0,248.0,253.5,5.5,11228 8 | 108/08/12,24732603,6242935989,254.5,254.5,251.0,251.0,-2.5,8415 9 | 108/08/13,25045107,6204239476,249.0,249.5,246.5,246.5,-4.5,11377 10 | 108/08/14,36336703,9142333535,252.5,254.0,249.5,249.5,3.0,13609 11 | 108/08/15,28277412,6994442633,247.0,248.5,246.0,248.0,-1.5,10852 12 | 108/08/16,25696715,6420744887,249.5,252.0,248.0,250.0,2.0,8994 13 | 108/08/19,25098514,6326683127,251.5,253.0,250.5,252.0,2.0,9398 14 | 108/08/20,20620494,5233263533,254.0,254.5,252.5,254.5,2.5,8214 15 | 108/08/21,20269296,5152545480,254.5,255.0,253.0,254.5,0.0,7383 16 | 108/08/22,22136840,5659296700,257.0,257.5,254.0,254.0,-0.5,8794 17 | 108/08/23,14772877,3748071178,253.5,254.5,253.0,254.0,0.0,5663 18 | 108/08/26,31740620,7910873500,249.0,250.5,248.5,248.5,-5.5,13388 19 | 108/08/27,53664951,13410582151,250.5,251.0,248.5,250.0,1.5,8939 20 | 108/08/28,15280882,3852096070,250.5,253.0,250.5,252.0,2.0,6829 21 | 108/08/29,20085767,5078703588,253.0,254.0,251.0,254.0,2.0,6596 22 | 108/08/30,35299201,9092482858,256.5,259.0,256.0,259.0,5.0,13703 23 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20190901.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/09/02,14776854,3800453292,258.0,258.0,256.0,257.5,-1.50,7608 3 | 108/09/03,26086495,6642868555,256.5,258.0,253.0,254.0,-3.50,11210 4 | 108/09/04,23697733,6081456520,254.0,258.0,254.0,257.5,+3.50,9291 5 | 108/09/05,49041728,12869665251,263.0,263.0,260.5,263.0,+5.50,22796 6 | 108/09/06,26609515,7016868801,265.0,265.0,263.0,263.5,+0.50,11957 7 | 108/09/09,17317833,4585545966,265.5,266.0,263.5,265.0,+1.50,8762 8 | 108/09/10,30019866,7862297242,263.5,264.0,260.5,261.5,-3.50,11831 9 | 108/09/11,36266015,9508884445,264.0,264.5,260.5,263.0,+1.50,12058 10 | 108/09/12,38792293,10198483555,265.0,265.0,261.5,262.5,-0.50,8282 11 | 108/09/16,38913966,10258240252,262.0,265.5,261.5,265.5,+3.00,11120 12 | 108/09/17,30069844,7979032930,266.5,266.5,264.5,265.0,-0.50,9222 13 | 108/09/18,51360759,13754334364,267.0,269.5,266.5,267.0,+2.00,17993 14 | 108/09/19,27165567,7216457755,268.0,268.0,264.0,265.0,X0.00,10194 15 | 108/09/20,44555865,11785924559,266.0,266.5,264.0,264.0,-1.00,9109 16 | 108/09/23,14220208,3749146092,264.0,264.0,263.0,264.0,0.00,5647 17 | 108/09/24,24304943,6419420695,263.5,265.5,262.0,265.0,+1.00,9180 18 | 108/09/25,23244163,6144037875,262.5,266.0,262.0,266.0,+1.00,7145 19 | 108/09/26,34128103,9139219995,269.0,269.5,266.5,268.0,+2.00,11861 20 | 108/09/27,44242817,12021629536,271.5,272.5,271.0,272.0,+4.00,16626 21 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20191001.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/10/01,75248890,20886838992,273.0,280.5,273.0,280.0,8.0,26648 3 | 108/10/02,30572953,8553297334,280.0,281.0,279.0,279.5,-0.5,12294 4 | 108/10/03,35874864,9891620358,274.0,277.5,274.0,276.5,-3.0,12853 5 | 108/10/04,35814613,9924872301,279.5,280.0,275.0,276.5,0.0,13780 6 | 108/10/07,17750230,4944376000,279.0,279.5,277.5,278.0,1.5,7757 7 | 108/10/08,39868551,11341522526,283.5,286.5,282.5,286.5,8.5,16721 8 | 108/10/09,34895456,9890256397,283.5,286.0,282.0,282.0,-4.5,14567 9 | 108/10/14,53403517,15508059122,291.5,291.5,288.5,290.0,8.0,17812 10 | 108/10/15,54754830,16088110873,293.5,296.0,292.0,293.5,3.5,15485 11 | 108/10/16,42917144,12670374493,298.0,298.0,293.5,296.5,3.0,16650 12 | 108/10/17,41920938,12296120182,295.0,295.5,292.0,293.5,-3.0,15170 13 | 108/10/18,45460984,13299843176,293.0,295.5,291.0,293.0,-0.5,18000 14 | 108/10/21,35860365,10389254035,291.0,291.0,288.5,290.0,-3.0,14682 15 | 108/10/22,26525020,7767636380,292.5,294.0,291.5,294.0,4.0,10186 16 | 108/10/23,30382408,8877572772,293.5,293.5,290.5,293.0,-1.0,11753 17 | 108/10/24,29040827,8488069650,294.5,294.5,291.0,293.0,0.0,10649 18 | 108/10/25,25082711,7362074526,294.5,294.5,292.5,293.5,0.5,11064 19 | 108/10/28,20216561,5958714595,295.0,295.5,294.0,294.5,1.0,9257 20 | 108/10/29,37130131,11044649541,297.0,298.5,296.5,298.5,4.0,14060 21 | 108/10/30,32370342,9646551600,298.5,299.5,296.5,299.5,1.0,11084 22 | 108/10/31,43123514,12921309531,300.0,301.5,298.5,298.5,-1.0,12997 23 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20191101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/11/01,30216678,8998151212,299.5,299.5,296.5,299.0,0.5,10241 3 | 108/11/04,45155671,13767873778,302.5,308.0,301.0,307.0,8.0,18475 4 | 108/11/05,32253184,9965563625,307.5,310.5,307.0,310.5,3.5,13698 5 | 108/11/06,22149743,6864516290,309.0,311.5,308.0,311.0,0.5,9660 6 | 108/11/07,28453659,8769417841,310.0,310.0,306.5,309.0,-2.0,12277 7 | 108/11/08,26230542,8040782450,308.5,309.0,305.5,305.5,-3.5,12740 8 | 108/11/11,35285583,10660082266,305.0,305.0,300.0,301.0,-4.5,15246 9 | 108/11/12,19016708,5774255431,302.5,305.0,302.0,305.0,4.0,8957 10 | 108/11/13,18422438,5583245970,303.0,304.0,301.5,304.0,-1.0,6039 11 | 108/11/14,15734835,4776767840,304.5,305.0,302.0,303.5,-0.5,6219 12 | 108/11/15,29038445,8891701115,305.5,307.5,304.5,307.0,3.5,8672 13 | 108/11/18,18741325,5796331075,308.5,311.0,307.0,311.0,4.0,8420 14 | 108/11/19,33096197,10365611120,312.5,315.0,311.0,315.0,4.0,11121 15 | 108/11/20,24538973,7681229345,314.0,314.0,312.0,313.5,-1.5,9143 16 | 108/11/21,30163833,9329845096,309.5,311.0,307.0,311.0,-2.5,11638 17 | 108/11/22,26492984,8188665024,310.0,310.5,308.0,309.0,-2.0,9407 18 | 108/11/25,19855177,6133713443,310.5,310.5,307.0,307.0,-2.0,8067 19 | 108/11/26,101916622,31332308518,310.0,310.5,307.0,307.0,0.0,10321 20 | 108/11/27,18527648,5732316828,307.5,311.5,307.5,311.0,4.0,7916 21 | 108/11/28,19718982,6111322584,310.0,312.0,308.5,309.5,-1.5,9289 22 | 108/11/29,32423561,9922872967,309.0,309.5,305.0,305.0,-4.5,15368 23 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20191201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 108/12/02,25516807,7844458306,307.0,308.0,306.5,307.5,+2.50,8465 3 | 108/12/03,27686319,8472595177,305.0,307.0,305.0,307.0,-0.50,9206 4 | 108/12/04,34911686,10652239802,305.0,306.0,304.0,306.0,-1.00,9989 5 | 108/12/05,39349842,12240671524,309.0,312.0,309.0,312.0,+6.00,13587 6 | 108/12/06,18402703,5771010050,315.0,316.0,311.0,313.0,+1.00,8974 7 | 108/12/09,23556081,7433484496,314.0,316.5,314.0,316.0,+3.00,10583 8 | 108/12/10,20847594,6540475540,315.0,315.5,312.5,313.5,-2.50,8702 9 | 108/12/11,34329148,10866410212,314.0,319.0,313.0,319.0,+5.50,11689 10 | 108/12/12,52801851,17446169339,325.0,334.5,324.0,331.5,+12.50,22555 11 | 108/12/13,60843939,20697194061,340.0,343.0,338.0,339.0,+7.50,23025 12 | 108/12/16,48340188,16272523200,336.5,338.5,336.0,336.0,-3.00,16938 13 | 108/12/17,41428458,14153896438,335.0,345.0,335.0,345.0,+9.00,16808 14 | 108/12/18,42486841,14594689501,341.5,345.0,341.5,344.5,-0.50,15836 15 | 108/12/19,55667012,18774880620,340.0,342.0,335.0,335.0,X0.00,28105 16 | 108/12/20,86280459,28483237354,332.0,333.0,328.5,329.0,-6.00,28112 17 | 108/12/23,26911340,8923609754,329.5,334.0,329.5,334.0,+5.00,12310 18 | 108/12/24,13783907,4591661991,334.0,334.5,332.0,332.0,-2.00,7887 19 | 108/12/25,12262954,4075131136,332.0,334.5,331.0,333.0,+1.00,7597 20 | 108/12/26,11427884,3803665702,333.0,334.0,331.5,333.0,0.00,6439 21 | 108/12/27,16677806,5624251712,335.0,338.0,335.0,338.0,+5.00,8660 22 | 108/12/30,21591263,7270827164,338.0,339.0,334.0,334.5,-3.50,10468 23 | 108/12/31,22950517,7614538961,331.0,333.5,331.0,331.0,-3.50,12253 24 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20200101.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 109/01/02,33282120,11224165450,332.5,339.0,332.5,339.0,8.0,17160 3 | 109/01/03,42023268,14295651580,344.0,345.0,335.5,339.5,0.5,20545 4 | 109/01/06,45677057,15210531318,333.0,334.5,332.0,332.0,-7.5,22944 5 | 109/01/07,51746181,17053282011,332.5,333.0,326.5,329.5,-2.5,22362 6 | 109/01/08,37913748,12484410088,325.0,333.0,325.0,329.5,0.0,18228 7 | 109/01/09,32397504,10890847940,335.0,337.5,333.5,337.5,8.0,16793 8 | 109/01/10,27880115,9432320316,340.5,341.0,336.0,339.5,2.0,13296 9 | 109/01/13,30663332,10455852739,342.0,342.0,339.0,341.5,2.0,13457 10 | 109/01/14,30368993,10488360978,345.5,346.0,344.5,346.0,4.5,16339 11 | 109/01/15,54575274,18590754206,345.0,345.0,337.5,340.0,-6.0,20392 12 | 109/01/16,58217420,19431133895,330.0,336.5,330.0,334.5,-5.5,24721 13 | 109/01/17,53908097,17977119406,334.0,335.5,332.0,333.0,-1.5,23954 14 | 109/01/20,35551203,11865436839,334.0,335.5,333.0,333.0,0.0,15095 15 | 109/01/30,126820049,40734449874,326.0,326.0,316.5,316.5,-16.5,55603 16 | 109/01/31,62912055,20205365710,323.0,323.5,319.0,320.0,3.5,22639 17 | -------------------------------------------------------------------------------- /stock_data/2330/2330_20200201.csv: -------------------------------------------------------------------------------- 1 | 日期,成交股數,成交金額,開盤價,最高價,最低價,收盤價,漲跌價差,成交筆數 2 | 109/02/03,59711849,18782694826,315.0,316.5,312.0,315.0,-5.0,26483 3 | 109/02/04,52208496,16882411296,319.0,326.0,318.0,325.0,10.0,22587 4 | 109/02/05,36601453,11985817083,329.0,329.5,324.5,327.5,2.5,16656 5 | 109/02/06,29659094,9803038836,329.5,332.5,329.0,332.5,5.0,14246 6 | 109/02/07,30055327,9869903253,330.0,330.5,326.0,328.0,-4.5,13075 7 | 109/02/10,30814424,10024967927,321.5,328.0,321.0,327.5,-0.5,14825 8 | 109/02/11,29062935,9629938182,330.5,332.5,330.0,331.5,4.0,12766 9 | 109/02/12,37612639,12593082711,333.5,336.0,333.0,335.0,3.5,17394 10 | 109/02/13,23217021,7805299096,338.0,338.0,335.0,335.0,0.0,12563 11 | 109/02/14,18326683,6155862838,337.0,337.0,334.5,335.0,0.0,7881 12 | 109/02/17,16145079,5354339726,331.5,333.0,330.5,331.5,-3.5,9747 13 | 109/02/18,64662604,20957801150,324.5,326.5,322.0,322.0,-9.5,36520 14 | 109/02/19,48856218,15881609046,322.5,327.0,322.0,326.5,4.5,16003 15 | 109/02/20,27061736,8832642641,328.0,329.0,325.0,325.5,-1.0,11695 16 | 109/02/21,22974534,7463007621,325.5,326.5,323.0,325.0,-0.5,9342 17 | 109/02/24,42946680,13754512932,319.5,321.5,319.5,320.0,-5.0,18902 18 | 109/02/25,38674011,12425785349,320.0,323.5,317.5,322.0,2.0,17366 19 | 109/02/26,60768362,19341695595,317.0,320.5,316.5,318.5,-3.5,24310 20 | 109/02/27,62401927,19756146876,319.0,320.0,315.0,316.0,-2.5,20633 21 | -------------------------------------------------------------------------------- /stocker.py: -------------------------------------------------------------------------------- 1 | # Quandl for financial analysis, pandas and numpy for data manipulation 2 | # fbprophet for additive models, #pytrends for Google trend data 3 | import quandl 4 | import pandas as pd 5 | import numpy as np 6 | import prophet 7 | import pytrends 8 | from pytrends.request import TrendReq 9 | 10 | # matplotlib pyplot for plotting 11 | import matplotlib.pyplot as plt 12 | 13 | import matplotlib 14 | 15 | # Class for analyzing and (attempting) to predict future prices 16 | # Contains a number of visualizations and analysis methods 17 | class Stocker(): 18 | 19 | # Initialization requires a ticker symbol 20 | def __init__(self, stockNo, dataframe): 21 | 22 | 23 | # Symbol is used for labeling plots 24 | self.symbol = "stockNo : {}".format(stockNo) 25 | 26 | 27 | stock = dataframe 28 | self.test_stock = dataframe.copy() 29 | 30 | # Columns required for prophet 31 | stock['ds'] = stock['Date'] 32 | stock['Adj. Close'] = stock['Close'] 33 | stock['Adj. Open'] = stock['Open'] 34 | stock['y'] = stock['Adj. Close'] 35 | stock['Daily Change'] = stock['Adj. Close'] - stock['Adj. Open'] 36 | 37 | # Data assigned as class attribute 38 | self.stock = dataframe.copy() 39 | #==============================================================================# 40 | # Minimum and maximum date in range 41 | self.min_date = min(stock['Date']) 42 | self.max_date = max(stock['Date']) 43 | 44 | # Find max and min prices and dates on which they occurred 45 | self.max_price = np.max(self.stock['y']) 46 | self.min_price = np.min(self.stock['y']) 47 | 48 | self.min_price_date = self.stock[self.stock['y'] == self.min_price]['Date'] 49 | self.min_price_date = self.min_price_date[self.min_price_date.index[0]] 50 | self.max_price_date = self.stock[self.stock['y'] == self.max_price]['Date'] 51 | self.max_price_date = self.max_price_date[self.max_price_date.index[0]] 52 | 53 | # The starting price (starting with the opening price) 54 | self.starting_price = float(self.stock.loc[0, 'Adj. Open']) 55 | 56 | # The most recent price 57 | self.most_recent_price = float(self.stock.loc[self.stock.index[-1], 'y']) 58 | 59 | # Whether or not to round dates 60 | self.round_dates = True 61 | 62 | # Number of years of data to train on 63 | self.training_years = 3 64 | 65 | # Prophet parameters 66 | # Default prior from library 67 | self.changepoint_prior_scale = 0.05 68 | self.weekly_seasonality = False 69 | self.daily_seasonality = False 70 | self.monthly_seasonality = True 71 | self.yearly_seasonality = True 72 | self.changepoints = None 73 | 74 | print('{} Stocker Initialized. Data covers {} to {}.'.format(self.symbol, 75 | self.min_date, 76 | self.max_date)) 77 | 78 | """ 79 | Make sure start and end dates are in the range and can be 80 | converted to pandas datetimes. Returns dates in the correct format 81 | """ 82 | def handle_dates(self, start_date, end_date): 83 | 84 | 85 | # Default start and end date are the beginning and end of data 86 | if start_date is None: 87 | start_date = self.min_date 88 | if end_date is None: 89 | end_date = self.max_date 90 | 91 | try: 92 | # Convert to pandas datetime for indexing dataframe 93 | start_date = pd.to_datetime(start_date) 94 | end_date = pd.to_datetime(end_date) 95 | 96 | except Exception as e: 97 | print('Enter valid pandas date format.') 98 | print(e) 99 | return 100 | 101 | valid_start = False 102 | valid_end = False 103 | 104 | # User will continue to enter dates until valid dates are met 105 | while (not valid_start) & (not valid_end): 106 | valid_end = True 107 | valid_start = True 108 | 109 | if end_date < start_date: 110 | print('End Date must be later than start date.') 111 | start_date = pd.to_datetime(input('Enter a new start date: ')) 112 | end_date= pd.to_datetime(input('Enter a new end date: ')) 113 | valid_end = False 114 | valid_start = False 115 | 116 | else: 117 | if end_date > self.max_date: 118 | print('End Date exceeds data range') 119 | end_date= pd.to_datetime(input('Enter a new end date: ')) 120 | valid_end = False 121 | 122 | if start_date < self.min_date: 123 | print('Start Date is before date range') 124 | start_date = pd.to_datetime(input('Enter a new start date: ')) 125 | valid_start = False 126 | 127 | 128 | return start_date, end_date 129 | 130 | """ 131 | Return the dataframe trimmed to the specified range. 132 | """ 133 | def make_df(self, start_date, end_date, df=None): 134 | 135 | # Default is to use the object stock data 136 | if not df: 137 | df = self.stock.copy() 138 | 139 | 140 | start_date, end_date = self.handle_dates(start_date, end_date) 141 | 142 | # keep track of whether the start and end dates are in the data 143 | start_in = True 144 | end_in = True 145 | 146 | # If user wants to round dates (default behavior) 147 | if self.round_dates: 148 | # Record if start and end date are in df 149 | if (start_date not in list(df['Date'])): 150 | start_in = False 151 | if (end_date not in list(df['Date'])): 152 | end_in = False 153 | 154 | # If both are not in dataframe, round both 155 | if (not end_in) & (not start_in): 156 | trim_df = df[(df['Date'] >= start_date) & 157 | (df['Date'] <= end_date)] 158 | 159 | else: 160 | # If both are in dataframe, round neither 161 | if (end_in) & (start_in): 162 | trim_df = df[(df['Date'] >= start_date) & 163 | (df['Date'] <= end_date)] 164 | else: 165 | # If only start is missing, round start 166 | if (not start_in): 167 | trim_df = df[(df['Date'] > start_date) & 168 | (df['Date'] <= end_date)] 169 | # If only end is imssing round end 170 | elif (not end_in): 171 | trim_df = df[(df['Date'] >= start_date) & 172 | (df['Date'] < end_date)] 173 | 174 | 175 | else: 176 | valid_start = False 177 | valid_end = False 178 | while (not valid_start) & (not valid_end): 179 | start_date, end_date = self.handle_dates(start_date, end_date) 180 | 181 | # No round dates, if either data not in, print message and return 182 | if (start_date in list(df['Date'])): 183 | valid_start = True 184 | if (end_date in list(df['Date'])): 185 | valid_end = True 186 | 187 | # Check to make sure dates are in the data 188 | if (start_date not in list(df['Date'])): 189 | print('Start Date not in data (either out of range or not a trading day.)') 190 | start_date = pd.to_datetime(input(prompt='Enter a new start date: ')) 191 | 192 | elif (end_date not in list(df['Date'])): 193 | print('End Date not in data (either out of range or not a trading day.)') 194 | end_date = pd.to_datetime(input(prompt='Enter a new end date: ') ) 195 | 196 | # Dates are not rounded 197 | trim_df = df[(df['Date'] >= start_date) & 198 | (df['Date'] <= end_date.date)] 199 | 200 | 201 | 202 | return trim_df 203 | 204 | 205 | # Basic Historical Plots and Basic Statistics 206 | def plot_stock(self, start_date=None, end_date=None, stats=['Adj. Close'], plot_type='basic'): 207 | 208 | self.reset_plot() 209 | 210 | if start_date is None: 211 | start_date = self.min_date 212 | if end_date is None: 213 | end_date = self.max_date 214 | 215 | stock_plot = self.make_df(start_date, end_date) 216 | 217 | colors = ['r', 'b', 'g', 'y', 'c', 'm'] 218 | 219 | for i, stat in enumerate(stats): 220 | 221 | stat_min = min(stock_plot[stat]) 222 | stat_max = max(stock_plot[stat]) 223 | 224 | stat_avg = np.mean(stock_plot[stat]) 225 | 226 | date_stat_min = stock_plot[stock_plot[stat] == stat_min]['Date'] 227 | date_stat_min = date_stat_min[date_stat_min.index[0]] 228 | date_stat_max = stock_plot[stock_plot[stat] == stat_max]['Date'] 229 | date_stat_max = date_stat_max[date_stat_max.index[0]] 230 | 231 | print('Maximum {} = {:.2f} on {}.'.format(stat, stat_max, date_stat_max)) 232 | print('Minimum {} = {:.2f} on {}.'.format(stat, stat_min, date_stat_min)) 233 | print('Current {} = {:.2f} on {}.\n'.format(stat, self.stock.loc[self.stock.index[-1], stat], self.max_date)) 234 | 235 | # Percentage y-axis 236 | if plot_type == 'pct': 237 | # Simple Plot 238 | plt.style.use('fivethirtyeight'); 239 | if stat == 'Daily Change': 240 | plt.plot(stock_plot['Date'], 100 * stock_plot[stat], 241 | color = colors[i], linewidth = 2.4, alpha = 0.9, 242 | label = stat) 243 | else: 244 | plt.plot(stock_plot['Date'], 100 * (stock_plot[stat] - stat_avg) / stat_avg, 245 | color = colors[i], linewidth = 2.4, alpha = 0.9, 246 | label = stat) 247 | 248 | plt.xlabel('Date'); plt.ylabel('Change Relative to Average (%)'); plt.title('%s Stock History' % self.symbol); 249 | plt.legend(prop={'size':10}) 250 | plt.grid(color = 'k', alpha = 0.4); 251 | 252 | # Stat y-axis 253 | elif plot_type == 'basic': 254 | plt.style.use('fivethirtyeight'); 255 | plt.plot(stock_plot['Date'], stock_plot[stat], color = colors[i], linewidth = 3, label = stat, alpha = 0.8) 256 | plt.xlabel('Date'); plt.ylabel('Price'); plt.title('%s Stock History' % self.symbol); 257 | plt.legend(prop={'size':10}) 258 | plt.grid(color = 'k', alpha = 0.4); 259 | 260 | plt.show(); 261 | 262 | # Reset the plotting parameters to clear style formatting 263 | # Not sure if this should be a static method 264 | @staticmethod 265 | def reset_plot(): 266 | 267 | # Restore default parameters 268 | matplotlib.rcdefaults() 269 | 270 | # Adjust a few parameters to liking 271 | matplotlib.rcParams['figure.figsize'] = (8, 5) 272 | matplotlib.rcParams['axes.labelsize'] = 10 273 | matplotlib.rcParams['xtick.labelsize'] = 8 274 | matplotlib.rcParams['ytick.labelsize'] = 8 275 | matplotlib.rcParams['axes.titlesize'] = 14 276 | matplotlib.rcParams['text.color'] = 'k' 277 | 278 | # Method to linearly interpolate prices on the weekends 279 | def resample(self, dataframe): 280 | # Change the index and resample at daily level 281 | dataframe = dataframe.set_index('ds') 282 | dataframe = dataframe.resample('D') 283 | 284 | # Reset the index and interpolate nan values 285 | dataframe = dataframe.reset_index(level=0) 286 | dataframe = dataframe.interpolate() 287 | return dataframe 288 | 289 | # Remove weekends from a dataframe 290 | def remove_weekends(self, dataframe): 291 | 292 | # Reset index to use ix 293 | dataframe = dataframe.reset_index(drop=True) 294 | 295 | weekends = [] 296 | 297 | # Find all of the weekends 298 | for i, date in enumerate(dataframe['ds']): 299 | if (date.weekday()) == 5 | (date.weekday() == 6): 300 | weekends.append(i) 301 | 302 | # Drop the weekends 303 | dataframe = dataframe.drop(weekends, axis=0) 304 | 305 | return dataframe 306 | 307 | 308 | # Calculate and plot profit from buying and holding shares for specified date range 309 | def buy_and_hold(self, start_date=None, end_date=None, nshares=1): 310 | self.reset_plot() 311 | 312 | start_date, end_date = self.handle_dates(start_date, end_date) 313 | 314 | # Find starting and ending price of stock 315 | start_price = float(self.stock[self.stock['Date'] == start_date]['Adj. Open']) 316 | end_price = float(self.stock[self.stock['Date'] == end_date]['Adj. Close']) 317 | 318 | # Make a profit dataframe and calculate profit column 319 | profits = self.make_df(start_date, end_date) 320 | profits['hold_profit'] = nshares * (profits['Adj. Close'] - start_price) 321 | 322 | # Total profit 323 | total_hold_profit = nshares * (end_price - start_price) 324 | 325 | print('{} Total buy and hold profit from {} to {} for {} shares = ${:.2f}'.format 326 | (self.symbol, start_date, end_date, nshares, total_hold_profit)) 327 | 328 | # Plot the total profits 329 | plt.style.use('dark_background') 330 | 331 | # Location for number of profit 332 | text_location = (end_date - pd.DateOffset(months = 1)) 333 | 334 | # Plot the profits over time 335 | plt.plot(profits['Date'], profits['hold_profit'], 'b', linewidth = 3) 336 | plt.ylabel('Profit ($)'); plt.xlabel('Date'); plt.title('Buy and Hold Profits for {} {} to {}'.format( 337 | self.symbol, start_date, end_date)) 338 | 339 | # Display final value on graph 340 | plt.text(x = text_location, 341 | y = total_hold_profit + (total_hold_profit / 40), 342 | s = '$%d' % total_hold_profit, 343 | color = 'g' if total_hold_profit > 0 else 'r', 344 | size = 14) 345 | 346 | plt.grid(alpha=0.2) 347 | plt.show(); 348 | 349 | # Create a prophet model without training 350 | def create_model(self): 351 | 352 | # Make the model 353 | model = prophet.Prophet(daily_seasonality=self.daily_seasonality, 354 | weekly_seasonality=self.weekly_seasonality, 355 | yearly_seasonality=self.yearly_seasonality, 356 | changepoint_prior_scale=self.changepoint_prior_scale, 357 | changepoints=self.changepoints) 358 | 359 | if self.monthly_seasonality: 360 | # Add monthly seasonality 361 | model.add_seasonality(name = 'monthly', period = 30.5, fourier_order = 5) 362 | 363 | return model 364 | 365 | # Graph the effects of altering the changepoint prior scale (cps) 366 | def changepoint_prior_analysis(self, changepoint_priors=[0.001, 0.05, 0.1, 0.2], colors=['b', 'r', 'grey', 'gold']): 367 | 368 | # Training and plotting with specified years of data 369 | train = self.stock[(self.stock['Date'] > (max(self.stock['Date']) - pd.DateOffset(years=self.training_years)))] 370 | 371 | # Iterate through all the changepoints and make models 372 | for i, prior in enumerate(changepoint_priors): 373 | # Select the changepoint 374 | self.changepoint_prior_scale = prior 375 | 376 | # Create and train a model with the specified cps 377 | model = self.create_model() 378 | model.fit(train) 379 | future = model.make_future_dataframe(periods=180, freq='D') 380 | 381 | # Make a dataframe to hold predictions 382 | if i == 0: 383 | predictions = future.copy() 384 | 385 | future = model.predict(future) 386 | 387 | # Fill in prediction dataframe 388 | predictions['%.3f_yhat_upper' % prior] = future['yhat_upper'] 389 | predictions['%.3f_yhat_lower' % prior] = future['yhat_lower'] 390 | predictions['%.3f_yhat' % prior] = future['yhat'] 391 | 392 | # Remove the weekends 393 | predictions = self.remove_weekends(predictions) 394 | 395 | # Plot set-up 396 | self.reset_plot() 397 | plt.style.use('fivethirtyeight') 398 | fig, ax = plt.subplots(1, 1) 399 | 400 | # Actual observations 401 | ax.plot(train['ds'], train['y'], 'ko', ms = 4, label = 'Observations') 402 | color_dict = {prior: color for prior, color in zip(changepoint_priors, colors)} 403 | 404 | # Plot each of the changepoint predictions 405 | for prior in changepoint_priors: 406 | # Plot the predictions themselves 407 | ax.plot(predictions['ds'], predictions['%.3f_yhat' % prior], linewidth = 1.2, 408 | color = color_dict[prior], label = '%.3f prior scale' % prior) 409 | 410 | # Plot the uncertainty interval 411 | ax.fill_between(predictions['ds'].dt.to_pydatetime(), predictions['%.3f_yhat_upper' % prior], 412 | predictions['%.3f_yhat_lower' % prior], facecolor = color_dict[prior], 413 | alpha = 0.3, edgecolor = 'k', linewidth = 0.6) 414 | 415 | # Plot labels 416 | plt.legend(loc = 2, prop={'size': 10}) 417 | plt.xlabel('Date'); plt.ylabel('Stock Price'); plt.title('Effect of Changepoint Prior Scale'); 418 | plt.show() 419 | 420 | # Basic prophet model for specified number of days 421 | def create_prophet_model(self, days=0, resample=False): 422 | 423 | self.reset_plot() 424 | 425 | model = self.create_model() 426 | 427 | # Fit on the stock history for self.training_years number of years 428 | stock_history = self.stock[self.stock['Date'] > (self.max_date - pd.DateOffset(years = self.training_years))] 429 | 430 | if resample: 431 | stock_history = self.resample(stock_history) 432 | 433 | model.fit(stock_history) 434 | 435 | # Make and predict for next year with future dataframe 436 | future = model.make_future_dataframe(periods = days, freq='D') 437 | future = model.predict(future) 438 | 439 | if days > 0: 440 | # Print the predicted price 441 | print('Predicted Price on {} = ${:.2f}'.format( 442 | future.loc[future.index[-1], 'ds'], future.loc[future.index[-1], 'yhat'])) 443 | 444 | title = '%s Historical and Predicted Stock Price' % self.symbol 445 | else: 446 | title = '%s Historical and Modeled Stock Price' % self.symbol 447 | 448 | # Set up the plot 449 | fig, ax = plt.subplots(1, 1) 450 | 451 | # Plot the actual values 452 | ax.plot(stock_history['ds'], stock_history['y'], 'ko-', linewidth = 1.4, alpha = 0.8, ms = 1.8, label = 'Observations') 453 | 454 | # Plot the predicted values 455 | ax.plot(future['ds'], future['yhat'], 'forestgreen',linewidth = 2.4, label = 'Modeled'); 456 | 457 | # Plot the uncertainty interval as ribbon 458 | ax.fill_between(future['ds'].dt.to_pydatetime(), future['yhat_upper'], future['yhat_lower'], alpha = 0.3, 459 | facecolor = 'g', edgecolor = 'k', linewidth = 1.4, label = 'Confidence Interval') 460 | 461 | # Plot formatting 462 | plt.legend(loc = 2, prop={'size': 10}); plt.xlabel('Date'); plt.ylabel('Price'); 463 | plt.grid(linewidth=0.6, alpha = 0.6) 464 | plt.title(title); 465 | plt.show() 466 | 467 | return model, future 468 | 469 | # Evaluate prediction model for one year 470 | def evaluate_prediction(self, start_date=None, end_date=None, nshares = None): 471 | 472 | # Default start date is one year before end of data 473 | # Default end date is end date of data 474 | if start_date is None: 475 | start_date = self.max_date - pd.DateOffset(years=1) 476 | if end_date is None: 477 | end_date = self.max_date 478 | 479 | start_date, end_date = self.handle_dates(start_date, end_date) 480 | 481 | # Training data starts self.training_years years before start date and goes up to start date 482 | train = self.stock[(self.stock['Date'] < start_date) & 483 | (self.stock['Date'] > (start_date - pd.DateOffset(years=self.training_years)))] 484 | 485 | # Testing data is specified in the range 486 | test = self.stock[(self.stock['Date'] >= start_date) & (self.stock['Date'] <= end_date)] 487 | 488 | # Create and train the model 489 | model = self.create_model() 490 | model.fit(train) 491 | 492 | # Make a future dataframe and predictions 493 | future = model.make_future_dataframe(periods = 365, freq='D') 494 | future = model.predict(future) 495 | 496 | # Merge predictions with the known values 497 | test = pd.merge(test, future, on = 'ds', how = 'inner') 498 | 499 | train = pd.merge(train, future, on = 'ds', how = 'inner') 500 | 501 | # Calculate the differences between consecutive measurements 502 | test['pred_diff'] = test['yhat'].diff() 503 | test['real_diff'] = test['y'].diff() 504 | 505 | # Correct is when we predicted the correct direction 506 | test['correct'] = (np.sign(test['pred_diff'][1:]) == np.sign(test['real_diff'][1:])) * 1 507 | 508 | # Accuracy when we predict increase and decrease 509 | increase_accuracy = 100 * np.mean(test[test['pred_diff'] > 0]['correct']) 510 | decrease_accuracy = 100 * np.mean(test[test['pred_diff'] < 0]['correct']) 511 | 512 | # Calculate mean absolute error 513 | test_errors = abs(test['y'] - test['yhat']) 514 | test_mean_error = np.mean(test_errors) 515 | 516 | train_errors = abs(train['y'] - train['yhat']) 517 | train_mean_error = np.mean(train_errors) 518 | 519 | # Calculate percentage of time actual value within prediction range 520 | test['in_range'] = False 521 | 522 | for i in test.index: 523 | if (test.loc[i, 'y'] < test.loc[i, 'yhat_upper']) & (test.loc[i, 'y'] > test.loc[i, 'yhat_lower']): 524 | test.loc[i, 'in_range'] = True 525 | 526 | in_range_accuracy = 100 * np.mean(test['in_range']) 527 | 528 | if not nshares: 529 | 530 | # Date range of predictions 531 | print('\nPrediction Range: {} to {}.'.format(start_date, 532 | end_date)) 533 | 534 | # Final prediction vs actual value 535 | print('\nPredicted price on {} = ${:.2f}.'.format(max(future['ds']), future.loc[future.index[-1], 'yhat'])) 536 | print('Actual price on {} = ${:.2f}.\n'.format(max(test['ds']), test.loc[test.index[-1], 'y'])) 537 | 538 | print('Average Absolute Error on Training Data = ${:.2f}.'.format(train_mean_error)) 539 | print('Average Absolute Error on Testing Data = ${:.2f}.\n'.format(test_mean_error)) 540 | 541 | # Direction accuracy 542 | print('When the model predicted an increase, the price increased {:.2f}% of the time.'.format(increase_accuracy)) 543 | print('When the model predicted a decrease, the price decreased {:.2f}% of the time.\n'.format(decrease_accuracy)) 544 | 545 | print('The actual value was within the {:d}% confidence interval {:.2f}% of the time.'.format(int(100 * model.interval_width), in_range_accuracy)) 546 | 547 | 548 | # Reset the plot 549 | self.reset_plot() 550 | 551 | # Set up the plot 552 | fig, ax = plt.subplots(1, 1) 553 | 554 | # Plot the actual values 555 | ax.plot(train['ds'], train['y'], 'ko-', linewidth = 1.4, alpha = 0.8, ms = 1.8, label = 'Observations') 556 | ax.plot(test['ds'], test['y'], 'ko-', linewidth = 1.4, alpha = 0.8, ms = 1.8, label = 'Observations') 557 | 558 | # Plot the predicted values 559 | ax.plot(future['ds'], future['yhat'], 'navy', linewidth = 2.4, label = 'Predicted'); 560 | 561 | # Plot the uncertainty interval as ribbon 562 | ax.fill_between(future['ds'].dt.to_pydatetime(), future['yhat_upper'], future['yhat_lower'], alpha = 0.6, 563 | facecolor = 'gold', edgecolor = 'k', linewidth = 1.4, label = 'Confidence Interval') 564 | 565 | # Put a vertical line at the start of predictions 566 | plt.vlines(x=min(test['ds']), ymin=min(future['yhat_lower']), ymax=max(future['yhat_upper']), colors = 'r', 567 | linestyles='dashed', label = 'Prediction Start') 568 | 569 | # Plot formatting 570 | plt.legend(loc = 2, prop={'size': 8}); plt.xlabel('Date'); plt.ylabel('Price'); 571 | plt.grid(linewidth=0.6, alpha = 0.6) 572 | 573 | plt.title('{} Model Evaluation from {} to {}.'.format(self.symbol, 574 | start_date, end_date)); 575 | plt.show(); 576 | 577 | 578 | # If a number of shares is specified, play the game 579 | elif nshares: 580 | 581 | # Only playing the stocks when we predict the stock will increase 582 | test_pred_increase = test[test['pred_diff'] > 0] 583 | 584 | test_pred_increase.reset_index(inplace=True) 585 | prediction_profit = [] 586 | 587 | # Iterate through all the predictions and calculate profit from playing 588 | for i, correct in enumerate(test_pred_increase['correct']): 589 | 590 | # If we predicted up and the price goes up, we gain the difference 591 | if correct == 1: 592 | prediction_profit.append(nshares * test_pred_increase.loc[i, 'real_diff']) 593 | # If we predicted up and the price goes down, we lose the difference 594 | else: 595 | prediction_profit.append(nshares * test_pred_increase.loc[i, 'real_diff']) 596 | 597 | test_pred_increase['pred_profit'] = prediction_profit 598 | 599 | # Put the profit into the test dataframe 600 | test = pd.merge(test, test_pred_increase[['ds', 'pred_profit']], on = 'ds', how = 'left') 601 | test.loc[0, 'pred_profit'] = 0 602 | 603 | # Profit for either method at all dates 604 | test['pred_profit'] = test['pred_profit'].cumsum().ffill() 605 | test['hold_profit'] = nshares * (test['y'] - float(test.loc[0, 'y'])) 606 | 607 | # Display information 608 | print('You played the stock market in {} from {} to {} with {} shares.\n'.format( 609 | self.symbol, start_date, end_date, nshares)) 610 | 611 | print('When the model predicted an increase, the price increased {:.2f}% of the time.'.format(increase_accuracy)) 612 | print('When the model predicted a decrease, the price decreased {:.2f}% of the time.\n'.format(decrease_accuracy)) 613 | 614 | # Display some friendly information about the perils of playing the stock market 615 | print('The total profit using the Prophet model = ${:.2f}.'.format(np.sum(prediction_profit))) 616 | print('The Buy and Hold strategy profit = ${:.2f}.'.format(float(test.loc[test.index[-1], 'hold_profit']))) 617 | print('\nThanks for playing the stock market!\n') 618 | 619 | 620 | 621 | # Plot the predicted and actual profits over time 622 | self.reset_plot() 623 | 624 | # Final profit and final smart used for locating text 625 | final_profit = test.loc[test.index[-1], 'pred_profit'] 626 | final_smart = test.loc[test.index[-1], 'hold_profit'] 627 | 628 | # text location 629 | last_date = test.loc[test.index[-1], 'ds'] 630 | text_location = (last_date - pd.DateOffset(months = 1)) 631 | 632 | plt.style.use('dark_background') 633 | 634 | # Plot smart profits 635 | plt.plot(test['ds'], test['hold_profit'], 'b', 636 | linewidth = 1.8, label = 'Buy and Hold Strategy') 637 | 638 | # Plot prediction profits 639 | plt.plot(test['ds'], test['pred_profit'], 640 | color = 'g' if final_profit > 0 else 'r', 641 | linewidth = 1.8, label = 'Prediction Strategy') 642 | 643 | # Display final values on graph 644 | plt.text(x = text_location, 645 | y = final_profit + (final_profit / 40), 646 | s = '$%d' % final_profit, 647 | color = 'g' if final_profit > 0 else 'r', 648 | size = 18) 649 | 650 | plt.text(x = text_location, 651 | y = final_smart + (final_smart / 40), 652 | s = '$%d' % final_smart, 653 | color = 'g' if final_smart > 0 else 'r', 654 | size = 18); 655 | 656 | # Plot formatting 657 | plt.ylabel('Profit (Price)'); plt.xlabel('Date'); 658 | plt.title('Predicted versus Buy and Hold Profits'); 659 | plt.legend(loc = 2, prop={'size': 10}); 660 | plt.grid(alpha=0.2); 661 | plt.show() 662 | 663 | def retrieve_google_trends(self, search, date_range): 664 | 665 | # Set up the trend fetching object 666 | pytrends = TrendReq(hl='en-US', tz=360) 667 | kw_list = [search] 668 | 669 | try: 670 | 671 | # Create the search object 672 | pytrends.build_payload(kw_list, cat=0, timeframe=date_range[0], geo='', gprop='news') 673 | 674 | # Retrieve the interest over time 675 | trends = pytrends.interest_over_time() 676 | 677 | related_queries = pytrends.related_queries() 678 | 679 | except Exception as e: 680 | print('\nGoogle Search Trend retrieval failed.') 681 | print(e) 682 | return 683 | 684 | return trends, related_queries 685 | 686 | def changepoint_date_analysis(self, search=None): 687 | self.reset_plot() 688 | 689 | model = self.create_model() 690 | 691 | # Use past self.training_years years of data 692 | train = self.stock[self.stock['Date'] > (self.max_date - pd.DateOffset(years = self.training_years))] 693 | model.fit(train) 694 | 695 | # Predictions of the training data (no future periods) 696 | future = model.make_future_dataframe(periods=0, freq='D') 697 | future = model.predict(future) 698 | 699 | train = pd.merge(train, future[['ds', 'yhat']], on = 'ds', how = 'inner') 700 | 701 | changepoints = model.changepoints 702 | train = train.reset_index(drop=True) 703 | 704 | # Create dataframe of only changepoints 705 | change_indices = [] 706 | for changepoint in (changepoints): 707 | change_indices.append(train[train['ds'] == changepoint].index[0]) 708 | 709 | c_data = train.loc[change_indices, :] 710 | deltas = model.params['delta'][0] 711 | 712 | c_data['delta'] = deltas 713 | c_data['abs_delta'] = abs(c_data['delta']) 714 | 715 | # Sort the values by maximum change 716 | c_data = c_data.sort_values(by='abs_delta', ascending=False) 717 | 718 | # Limit to 10 largest changepoints 719 | c_data = c_data[:10] 720 | 721 | # Separate into negative and positive changepoints 722 | cpos_data = c_data[c_data['delta'] > 0] 723 | cneg_data = c_data[c_data['delta'] < 0] 724 | 725 | # Changepoints and data 726 | if not search: 727 | 728 | print('\nChangepoints sorted by slope rate of change (2nd derivative):\n') 729 | print(c_data.loc[:, ['Date', 'Adj. Close', 'delta']][:5]) 730 | 731 | # Line plot showing actual values, estimated values, and changepoints 732 | self.reset_plot() 733 | 734 | # Set up line plot 735 | plt.plot(train['ds'], train['y'], 'ko', ms = 4, label = 'Stock Price') 736 | plt.plot(future['ds'], future['yhat'], color = 'navy', linewidth = 2.0, label = 'Modeled') 737 | 738 | # Changepoints as vertical lines 739 | plt.vlines(cpos_data['ds'].dt.to_pydatetime(), ymin = min(train['y']), ymax = max(train['y']), 740 | linestyles='dashed', color = 'r', 741 | linewidth= 1.2, label='Negative Changepoints') 742 | 743 | plt.vlines(cneg_data['ds'].dt.to_pydatetime(), ymin = min(train['y']), ymax = max(train['y']), 744 | linestyles='dashed', color = 'darkgreen', 745 | linewidth= 1.2, label='Positive Changepoints') 746 | 747 | plt.legend(prop={'size':10}); 748 | plt.xlabel('Date'); plt.ylabel('Price'); plt.title('Stock Price with Changepoints') 749 | plt.show() 750 | 751 | # Search for search term in google news 752 | # Show related queries, rising related queries 753 | # Graph changepoints, search frequency, stock price 754 | if search: 755 | date_range = ['%s %s' % (str(min(train['Date'])), str(max(train['Date'])))] 756 | 757 | # Get the Google Trends for specified terms and join to training dataframe 758 | trends, related_queries = self.retrieve_google_trends(search, date_range) 759 | 760 | if (trends is None) or (related_queries is None): 761 | print('No search trends found for %s' % search) 762 | return 763 | 764 | print('\n Top Related Queries: \n') 765 | print(related_queries[search]['top'].head()) 766 | 767 | print('\n Rising Related Queries: \n') 768 | print(related_queries[search]['rising'].head()) 769 | 770 | # Upsample the data for joining with training data 771 | trends = trends.resample('D') 772 | 773 | trends = trends.reset_index(level=0) 774 | trends = trends.rename(columns={'date': 'ds', search: 'freq'}) 775 | 776 | # Interpolate the frequency 777 | trends['freq'] = trends['freq'].interpolate() 778 | 779 | # Merge with the training data 780 | train = pd.merge(train, trends, on = 'ds', how = 'inner') 781 | 782 | # Normalize values 783 | train['y_norm'] = train['y'] / max(train['y']) 784 | train['freq_norm'] = train['freq'] / max(train['freq']) 785 | 786 | self.reset_plot() 787 | 788 | # Plot the normalized stock price and normalize search frequency 789 | plt.plot(train['ds'], train['y_norm'], 'k-', label = 'Stock Price') 790 | plt.plot(train['ds'], train['freq_norm'], color='goldenrod', label = 'Search Frequency') 791 | 792 | # Changepoints as vertical lines 793 | plt.vlines(cpos_data['ds'].dt.to_pydatetime(), ymin = 0, ymax = 1, 794 | linestyles='dashed', color = 'r', 795 | linewidth= 1.2, label='Negative Changepoints') 796 | 797 | plt.vlines(cneg_data['ds'].dt.to_pydatetime(), ymin = 0, ymax = 1, 798 | linestyles='dashed', color = 'darkgreen', 799 | linewidth= 1.2, label='Positive Changepoints') 800 | 801 | # Plot formatting 802 | plt.legend(prop={'size': 10}) 803 | plt.xlabel('Date'); plt.ylabel('Normalized Values'); plt.title('%s Stock Price and Search Frequency for %s' % (self.symbol, search)) 804 | plt.show() 805 | 806 | # Predict the future price for a given range of days 807 | def predict_future(self, days=30): 808 | 809 | # Use past self.training_years years for training 810 | train = self.stock[self.stock['Date'] > (max(self.stock['Date']) - pd.DateOffset(years=self.training_years))] 811 | 812 | model = self.create_model() 813 | 814 | model.fit(train) 815 | 816 | # Future dataframe with specified number of days to predict 817 | future = model.make_future_dataframe(periods=days, freq='D') 818 | future = model.predict(future) 819 | 820 | # Only concerned with future dates 821 | future = future[future['ds'] >= max(self.stock['Date'])] 822 | 823 | # Remove the weekends 824 | future = self.remove_weekends(future) 825 | 826 | # Calculate whether increase or not 827 | future['diff'] = future['yhat'].diff() 828 | 829 | future = future.dropna() 830 | 831 | # Find the prediction direction and create separate dataframes 832 | future['direction'] = (future['diff'] > 0) * 1 833 | 834 | # Rename the columns for presentation 835 | future = future.rename(columns={'ds': 'Date', 'yhat': 'estimate', 'diff': 'change', 836 | 'yhat_upper': 'upper', 'yhat_lower': 'lower'}) 837 | 838 | future_increase = future[future['direction'] == 1] 839 | future_decrease = future[future['direction'] == 0] 840 | 841 | # Print out the dates 842 | print('\nPredicted Increase: \n') 843 | print(future_increase[['Date', 'estimate', 'change', 'upper', 'lower']]) 844 | 845 | print('\nPredicted Decrease: \n') 846 | print(future_decrease[['Date', 'estimate', 'change', 'upper', 'lower']]) 847 | 848 | self.reset_plot() 849 | 850 | # Set up plot 851 | plt.style.use('fivethirtyeight') 852 | matplotlib.rcParams['axes.labelsize'] = 10 853 | matplotlib.rcParams['xtick.labelsize'] = 8 854 | matplotlib.rcParams['ytick.labelsize'] = 8 855 | matplotlib.rcParams['axes.titlesize'] = 12 856 | 857 | # Plot the predictions and indicate if increase or decrease 858 | fig, ax = plt.subplots(1, 1, figsize=(8, 6)) 859 | 860 | # Plot the estimates 861 | ax.plot(future_increase['Date'], future_increase['estimate'], 'g^', ms = 12, label = 'Pred. Increase') 862 | ax.plot(future_decrease['Date'], future_decrease['estimate'], 'rv', ms = 12, label = 'Pred. Decrease') 863 | 864 | # Plot errorbars 865 | ax.errorbar(future['Date'].dt.to_pydatetime(), future['estimate'], 866 | yerr = future['upper'] - future['lower'], 867 | capthick=1.4, color = 'k',linewidth = 2, 868 | ecolor='darkblue', capsize = 4, elinewidth = 1, label = 'Pred with Range') 869 | 870 | # Plot formatting 871 | plt.legend(loc = 2, prop={'size': 10}); 872 | plt.xticks(rotation = '45') 873 | plt.ylabel('Predicted Stock Price'); 874 | plt.xlabel('Date'); plt.title('Predictions for %s' % self.symbol); 875 | plt.show() 876 | 877 | def changepoint_prior_validation(self, start_date=None, end_date=None,changepoint_priors = [0.001, 0.05, 0.1, 0.2]): 878 | 879 | 880 | # Default start date is two years before end of data 881 | # Default end date is one year before end of data 882 | if start_date is None: 883 | start_date = self.max_date - pd.DateOffset(years=2) 884 | if end_date is None: 885 | end_date = self.max_date - pd.DateOffset(years=1) 886 | 887 | # Convert to pandas datetime for indexing dataframe 888 | start_date = pd.to_datetime(start_date) 889 | end_date = pd.to_datetime(end_date) 890 | 891 | start_date, end_date = self.handle_dates(start_date, end_date) 892 | 893 | # Select self.training_years number of years 894 | train = self.stock[(self.stock['Date'] > (start_date - pd.DateOffset(years=self.training_years))) & 895 | (self.stock['Date'] < start_date)] 896 | 897 | # Testing data is specified by range 898 | test = self.stock[(self.stock['Date'] >= start_date) & (self.stock['Date'] <= end_date)] 899 | 900 | eval_days = (max(test['Date']) - min(test['Date'])).days 901 | 902 | results = pd.DataFrame(0, index = list(range(len(changepoint_priors))), 903 | columns = ['cps', 'train_err', 'train_range', 'test_err', 'test_range']) 904 | 905 | print('\nValidation Range {} to {}.\n'.format(min(test['Date']), 906 | max(test['Date']))) 907 | 908 | 909 | # Iterate through all the changepoints and make models 910 | for i, prior in enumerate(changepoint_priors): 911 | results.loc[i, 'cps'] = prior 912 | 913 | # Select the changepoint 914 | self.changepoint_prior_scale = prior 915 | 916 | # Create and train a model with the specified cps 917 | model = self.create_model() 918 | model.fit(train) 919 | future = model.make_future_dataframe(periods=eval_days, freq='D') 920 | 921 | future = model.predict(future) 922 | 923 | # Training results and metrics 924 | train_results = pd.merge(train, future[['ds', 'yhat', 'yhat_upper', 'yhat_lower']], on = 'ds', how = 'inner') 925 | avg_train_error = np.mean(abs(train_results['y'] - train_results['yhat'])) 926 | avg_train_uncertainty = np.mean(abs(train_results['yhat_upper'] - train_results['yhat_lower'])) 927 | 928 | results.loc[i, 'train_err'] = avg_train_error 929 | results.loc[i, 'train_range'] = avg_train_uncertainty 930 | 931 | # Testing results and metrics 932 | test_results = pd.merge(test, future[['ds', 'yhat', 'yhat_upper', 'yhat_lower']], on = 'ds', how = 'inner') 933 | avg_test_error = np.mean(abs(test_results['y'] - test_results['yhat'])) 934 | avg_test_uncertainty = np.mean(abs(test_results['yhat_upper'] - test_results['yhat_lower'])) 935 | 936 | results.loc[i, 'test_err'] = avg_test_error 937 | results.loc[i, 'test_range'] = avg_test_uncertainty 938 | 939 | print(results) 940 | 941 | 942 | 943 | # Plot of training and testing average errors 944 | self.reset_plot() 945 | 946 | plt.plot(results['cps'], results['train_err'], 'bo-', ms = 8, label = 'Train Error') 947 | plt.plot(results['cps'], results['test_err'], 'r*-', ms = 8, label = 'Test Error') 948 | plt.xlabel('Changepoint Prior Scale'); plt.ylabel('Avg. Absolute Error ($)'); 949 | plt.title('Training and Testing Curves as Function of CPS') 950 | plt.grid(color='k', alpha=0.3) 951 | plt.xticks(results['cps'], results['cps']) 952 | plt.legend(prop={'size':10}) 953 | plt.show(); 954 | 955 | # Plot of training and testing average uncertainty 956 | self.reset_plot() 957 | 958 | plt.plot(results['cps'], results['train_range'], 'bo-', ms = 8, label = 'Train Range') 959 | plt.plot(results['cps'], results['test_range'], 'r*-', ms = 8, label = 'Test Range') 960 | plt.xlabel('Changepoint Prior Scale'); plt.ylabel('Avg. Uncertainty ($)'); 961 | plt.title('Uncertainty in Estimate as Function of CPS') 962 | plt.grid(color='k', alpha=0.3) 963 | plt.xticks(results['cps'], results['cps']) 964 | plt.legend(prop={'size':10}) 965 | plt.show(); --------------------------------------------------------------------------------