{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "BTC_predict.ipynb", "provenance": [], "authorship_tag": "ABX9TyP5thH85zBWognO/ZVRe6Ve", "include_colab_link": true }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "" ] }, { "cell_type": "code", "metadata": { "id": "HV0SrOgcHMw_" }, "source": [ "!pip install pyupbit" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "OPo1hQ62HcxA" }, "source": [ "import pyupbit" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 402 }, "id": "sjI3ac9tT7D2", "outputId": "142ff09e-6574-4dc7-f117-e1c2e565eba1" }, "source": [ "#BTC 최근 200시간의 데이터 불러옴\n", "df = pyupbit.get_ohlcv(\"KRW-BTC\", interval=\"minute60\")\n", "df" ], "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", " | open | \n", "high | \n", "low | \n", "close | \n", "volume | \n", "value | \n", "
---|---|---|---|---|---|---|
2021-05-08 20:00:00 | \n", "70080000.0 | \n", "70397000.0 | \n", "70031000.0 | \n", "70278000.0 | \n", "282.481680 | \n", "1.983373e+10 | \n", "
2021-05-08 21:00:00 | \n", "70202000.0 | \n", "70600000.0 | \n", "69775000.0 | \n", "70353000.0 | \n", "512.864414 | \n", "3.595321e+10 | \n", "
2021-05-08 22:00:00 | \n", "70353000.0 | \n", "71400000.0 | \n", "70261000.0 | \n", "70402000.0 | \n", "1074.924200 | \n", "7.618756e+10 | \n", "
2021-05-08 23:00:00 | \n", "70467000.0 | \n", "70586000.0 | \n", "70101000.0 | \n", "70264000.0 | \n", "495.536391 | \n", "3.485509e+10 | \n", "
2021-05-09 00:00:00 | \n", "70245000.0 | \n", "70732000.0 | \n", "69377000.0 | \n", "69561000.0 | \n", "674.450592 | \n", "4.724700e+10 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2021-05-16 23:00:00 | \n", "59941000.0 | \n", "60155000.0 | \n", "59293000.0 | \n", "59355000.0 | \n", "417.846935 | \n", "2.493730e+10 | \n", "
2021-05-17 00:00:00 | \n", "59370000.0 | \n", "59440000.0 | \n", "58800000.0 | \n", "58810000.0 | \n", "417.550735 | \n", "2.465069e+10 | \n", "
2021-05-17 01:00:00 | \n", "58811000.0 | \n", "59000000.0 | \n", "58327000.0 | \n", "58480000.0 | \n", "494.023674 | \n", "2.897628e+10 | \n", "
2021-05-17 02:00:00 | \n", "58513000.0 | \n", "58638000.0 | \n", "57900000.0 | \n", "57996000.0 | \n", "675.896966 | \n", "3.928135e+10 | \n", "
2021-05-17 03:00:00 | \n", "57997000.0 | \n", "58278000.0 | \n", "57501000.0 | \n", "57550000.0 | \n", "231.009586 | \n", "1.336449e+10 | \n", "
200 rows × 6 columns
\n", "\n", " | ds | \n", "y | \n", "
---|---|---|
0 | \n", "2021-05-08 20:00:00 | \n", "70278000.0 | \n", "
1 | \n", "2021-05-08 21:00:00 | \n", "70353000.0 | \n", "
2 | \n", "2021-05-08 22:00:00 | \n", "70402000.0 | \n", "
3 | \n", "2021-05-08 23:00:00 | \n", "70264000.0 | \n", "
4 | \n", "2021-05-09 00:00:00 | \n", "69561000.0 | \n", "
... | \n", "... | \n", "... | \n", "
195 | \n", "2021-05-16 23:00:00 | \n", "59355000.0 | \n", "
196 | \n", "2021-05-17 00:00:00 | \n", "58810000.0 | \n", "
197 | \n", "2021-05-17 01:00:00 | \n", "58480000.0 | \n", "
198 | \n", "2021-05-17 02:00:00 | \n", "57996000.0 | \n", "
199 | \n", "2021-05-17 03:00:00 | \n", "57550000.0 | \n", "
200 rows × 2 columns
\n", "\n", " | ds | \n", "trend | \n", "yhat_lower | \n", "yhat_upper | \n", "trend_lower | \n", "trend_upper | \n", "additive_terms | \n", "additive_terms_lower | \n", "additive_terms_upper | \n", "daily | \n", "daily_lower | \n", "daily_upper | \n", "multiplicative_terms | \n", "multiplicative_terms_lower | \n", "multiplicative_terms_upper | \n", "yhat | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "2021-05-08 20:00:00 | \n", "7.049319e+07 | \n", "6.978264e+07 | \n", "7.145666e+07 | \n", "7.049319e+07 | \n", "7.049319e+07 | \n", "73763.938017 | \n", "73763.938017 | \n", "73763.938017 | \n", "73763.938017 | \n", "73763.938017 | \n", "73763.938017 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "7.056695e+07 | \n", "
1 | \n", "2021-05-08 21:00:00 | \n", "7.054058e+07 | \n", "6.981790e+07 | \n", "7.151720e+07 | \n", "7.054058e+07 | \n", "7.054058e+07 | \n", "155154.366642 | \n", "155154.366642 | \n", "155154.366642 | \n", "155154.366642 | \n", "155154.366642 | \n", "155154.366642 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "7.069573e+07 | \n", "
2 | \n", "2021-05-08 22:00:00 | \n", "7.058797e+07 | \n", "6.993552e+07 | \n", "7.159752e+07 | \n", "7.058797e+07 | \n", "7.058797e+07 | \n", "200297.460741 | \n", "200297.460741 | \n", "200297.460741 | \n", "200297.460741 | \n", "200297.460741 | \n", "200297.460741 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "7.078827e+07 | \n", "
3 | \n", "2021-05-08 23:00:00 | \n", "7.063536e+07 | \n", "6.995876e+07 | \n", "7.160555e+07 | \n", "7.063536e+07 | \n", "7.063536e+07 | \n", "127033.847973 | \n", "127033.847973 | \n", "127033.847973 | \n", "127033.847973 | \n", "127033.847973 | \n", "127033.847973 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "7.076239e+07 | \n", "
4 | \n", "2021-05-09 00:00:00 | \n", "7.068275e+07 | \n", "6.977696e+07 | \n", "7.145736e+07 | \n", "7.068275e+07 | \n", "7.068275e+07 | \n", "-64004.026527 | \n", "-64004.026527 | \n", "-64004.026527 | \n", "-64004.026527 | \n", "-64004.026527 | \n", "-64004.026527 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "7.061875e+07 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
219 | \n", "2021-05-17 23:00:00 | \n", "5.741650e+07 | \n", "5.620334e+07 | \n", "5.893053e+07 | \n", "5.640791e+07 | \n", "5.859450e+07 | \n", "127033.847977 | \n", "127033.847977 | \n", "127033.847977 | \n", "127033.847977 | \n", "127033.847977 | \n", "127033.847977 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "5.754353e+07 | \n", "
220 | \n", "2021-05-18 00:00:00 | \n", "5.735429e+07 | \n", "5.587900e+07 | \n", "5.883842e+07 | \n", "5.624516e+07 | \n", "5.862328e+07 | \n", "-64004.026533 | \n", "-64004.026533 | \n", "-64004.026533 | \n", "-64004.026533 | \n", "-64004.026533 | \n", "-64004.026533 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "5.729029e+07 | \n", "
221 | \n", "2021-05-18 01:00:00 | \n", "5.729208e+07 | \n", "5.553360e+07 | \n", "5.871707e+07 | \n", "5.610166e+07 | \n", "5.864511e+07 | \n", "-264151.046571 | \n", "-264151.046571 | \n", "-264151.046571 | \n", "-264151.046571 | \n", "-264151.046571 | \n", "-264151.046571 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "5.702793e+07 | \n", "
222 | \n", "2021-05-18 02:00:00 | \n", "5.722988e+07 | \n", "5.527597e+07 | \n", "5.845177e+07 | \n", "5.594232e+07 | \n", "5.868056e+07 | \n", "-331244.053737 | \n", "-331244.053737 | \n", "-331244.053737 | \n", "-331244.053737 | \n", "-331244.053737 | \n", "-331244.053737 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "5.689863e+07 | \n", "
223 | \n", "2021-05-18 03:00:00 | \n", "5.716767e+07 | \n", "5.526153e+07 | \n", "5.871909e+07 | \n", "5.577408e+07 | \n", "5.873862e+07 | \n", "-207139.503841 | \n", "-207139.503841 | \n", "-207139.503841 | \n", "-207139.503841 | \n", "-207139.503841 | \n", "-207139.503841 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "5.696053e+07 | \n", "
224 rows × 16 columns
\n", "