Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save va2577/979cf0f0c2c74b0c08dbb3ca3521c4c1 to your computer and use it in GitHub Desktop.
Save va2577/979cf0f0c2c74b0c08dbb3ca3521c4c1 to your computer and use it in GitHub Desktop.
Jupyter Notebook python-highcharts candlestick
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# python-highcharts\n",
"\n",
"* [python-highcharts/candlestick-and-volume.ipynb at developer · kyper-data/python-highcharts · GitHub](https://github.com/kyper-data/python-highcharts/blob/developer/examples/ipynb/highstock/candlestick-and-volume.ipynb)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import requests\n",
"from highcharts import Highstock\n",
"#from highcharts.highstock.highstock_helper import jsonp_loader"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[1497474000000, '109.554', '110.979', '109.258', '110.911'],\n",
" [1497560400000, '110.925', '111.415', '110.637', '110.89'],\n",
" [1497819600000, '110.841', '111.601', '110.704', '111.526'],\n",
" [1497906000000, '111.514', '111.782', '111.306', '111.454'],\n",
" [1497992400000, '111.434', '111.738', '111.035', '111.375'],\n",
" [1498078800000, '111.337', '111.446', '110.93', '111.319'],\n",
" [1498165200000, '111.32', '111.427', '111.142', '111.226'],\n",
" [1498424400000, '111.157', '111.939', '111.101', '111.86'],\n",
" [1498510800000, '111.82', '112.464', '111.459', '112.337'],\n",
" [1498597200000, '112.337', '112.416', '111.829', '112.28']]"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134' }\n",
"r = requests.get('https://fx.minkabu.jp/api/v2/bar/USDJPY/daily.json?count=240', headers=headers)\n",
"r.raise_for_status()\n",
"r.json()[:10]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>time</th>\n",
" <th>open</th>\n",
" <th>high</th>\n",
" <th>low</th>\n",
" <th>close</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1497474000000</td>\n",
" <td>109.554</td>\n",
" <td>110.979</td>\n",
" <td>109.258</td>\n",
" <td>110.911</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1497560400000</td>\n",
" <td>110.925</td>\n",
" <td>111.415</td>\n",
" <td>110.637</td>\n",
" <td>110.89</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1497819600000</td>\n",
" <td>110.841</td>\n",
" <td>111.601</td>\n",
" <td>110.704</td>\n",
" <td>111.526</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1497906000000</td>\n",
" <td>111.514</td>\n",
" <td>111.782</td>\n",
" <td>111.306</td>\n",
" <td>111.454</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1497992400000</td>\n",
" <td>111.434</td>\n",
" <td>111.738</td>\n",
" <td>111.035</td>\n",
" <td>111.375</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" time open high low close\n",
"0 1497474000000 109.554 110.979 109.258 110.911\n",
"1 1497560400000 110.925 111.415 110.637 110.89\n",
"2 1497819600000 110.841 111.601 110.704 111.526\n",
"3 1497906000000 111.514 111.782 111.306 111.454\n",
"4 1497992400000 111.434 111.738 111.035 111.375"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.DataFrame(data=r.json(), columns=['time', 'open', 'high', 'low', 'close'])\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>time</th>\n",
" <th>open</th>\n",
" <th>high</th>\n",
" <th>low</th>\n",
" <th>close</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1497484800000</td>\n",
" <td>109.554</td>\n",
" <td>110.979</td>\n",
" <td>109.258</td>\n",
" <td>110.911</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1497571200000</td>\n",
" <td>110.925</td>\n",
" <td>111.415</td>\n",
" <td>110.637</td>\n",
" <td>110.890</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1497830400000</td>\n",
" <td>110.841</td>\n",
" <td>111.601</td>\n",
" <td>110.704</td>\n",
" <td>111.526</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1497916800000</td>\n",
" <td>111.514</td>\n",
" <td>111.782</td>\n",
" <td>111.306</td>\n",
" <td>111.454</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1498003200000</td>\n",
" <td>111.434</td>\n",
" <td>111.738</td>\n",
" <td>111.035</td>\n",
" <td>111.375</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" time open high low close\n",
"0 1497484800000 109.554 110.979 109.258 110.911\n",
"1 1497571200000 110.925 111.415 110.637 110.890\n",
"2 1497830400000 110.841 111.601 110.704 111.526\n",
"3 1497916800000 111.514 111.782 111.306 111.454\n",
"4 1498003200000 111.434 111.738 111.035 111.375"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# [From Timestamps to Epoch](https://pandas.pydata.org/pandas-docs/stable/timeseries.html#from-timestamps-to-epoch)\n",
"utc = pd.to_datetime(df['time'], unit='ms')\n",
"utc3 = utc + pd.DateOffset(hours=3)\n",
"epoch = (utc3 - pd.Timestamp(\"1970-01-01\")) / pd.Timedelta('1ms')\n",
"data1 = { 'time': epoch.astype('int64').values, 'open': df['open'].astype('float64').values, 'high': df['high'].astype('float64').values, 'low': df['low'].astype('float64').values, 'close': df['close'].astype('float64').values}\n",
"columns1 = ['time', 'open', 'high', 'low', 'close']\n",
"df2 = pd.DataFrame(data=data1, columns=columns1)\n",
"df2.head()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<iframe style=\"border:0;outline:none;overflow:hidden\" srcdoc=\"&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;utf-8&quot; /&gt; &lt;link href=&quot;https://www.highcharts.com/highslide/highslide.css&quot; rel=&quot;stylesheet&quot; /&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/stock/highstock.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/stock/modules/exporting.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts-more.js&quot;&gt;&lt;/script&gt; &lt;/head&gt; &lt;body style=&quot;margin:0;padding:0&quot;&gt; &lt;div id=&quot;container&quot; style=&quot;&quot;&gt;Loading....&lt;/div&gt; &lt;script&gt; $(function(){ Highcharts.setOptions({&quot;lang&quot;: {}, &quot;global&quot;: {}}); var option = {&quot;yAxis&quot;: {}, &quot;loading&quot;: {}, &quot;tooltip&quot;: {}, &quot;credits&quot;: {&quot;enabled&quot;: false}, &quot;xAxis&quot;: {}, &quot;exporting&quot;: {}, &quot;scrollbar&quot;: {}, &quot;colors&quot;: {}, &quot;title&quot;: {&quot;text&quot;: &quot;\\u7c73\\u30c9\\u30eb/\\u5186 daily&quot;}, &quot;labels&quot;: {}, &quot;plotOptions&quot;: {}, &quot;navigation&quot;: {}, &quot;chart&quot;: {&quot;renderTo&quot;: &quot;container&quot;}, &quot;legend&quot;: {}, &quot;rangeSelector&quot;: {&quot;selected&quot;: 1}, &quot;navigator&quot;: {}, &quot;series&quot;: {}, &quot;subtitle&quot;: {}}; var chart = new Highcharts.StockChart(option); var data = [{&quot;data&quot;: [[1497484800000.0, 109.554, 110.979, 109.258, 110.911], [1497571200000.0, 110.925, 111.415, 110.637, 110.89], [1497830400000.0, 110.841, 111.601, 110.704, 111.526], [1497916800000.0, 111.514, 111.782, 111.306, 111.454], [1498003200000.0, 111.434, 111.738, 111.035, 111.375], [1498089600000.0, 111.337, 111.446, 110.93, 111.319], [1498176000000.0, 111.32, 111.427, 111.142, 111.226], [1498435200000.0, 111.157, 111.939, 111.101, 111.86], [1498521600000.0, 111.82, 112.464, 111.459, 112.337], [1498608000000.0, 112.337, 112.416, 111.829, 112.28], [1498694400000.0, 112.28, 112.925, 111.804, 112.164], [1498780800000.0, 112.167, 112.6, 111.71, 112.362], [1499040000000.0, 112.1, 113.471, 112.054, 113.376], [1499126400000.0, 113.375, 113.451, 112.743, 113.261], [1499212800000.0, 113.26, 113.686, 112.821, 113.252], [1499299200000.0, 113.255, 113.469, 112.88, 113.208], [1499385600000.0, 113.204, 114.179, 113.056, 113.91], [1499644800000.0, 113.855, 114.298, 113.831, 114.024], [1499731200000.0, 114.025, 114.495, 113.714, 113.93], [1499817600000.0, 113.918, 113.967, 112.925, 113.149], [1499904000000.0, 113.152, 113.522, 112.86, 113.28], [1499990400000.0, 113.275, 113.573, 112.255, 112.528], [1500249600000.0, 112.455, 112.865, 112.321, 112.617], [1500336000000.0, 112.615, 112.682, 111.677, 112.056], [1500422400000.0, 112.015, 112.229, 111.551, 111.93], [1500508800000.0, 111.942, 112.417, 111.48, 111.893], [1500595200000.0, 111.898, 112.079, 111.011, 111.122], [1500854400000.0, 111.106, 111.32, 110.618, 111.081], [1500940800000.0, 111.039, 111.958, 110.828, 111.872], [1501027200000.0, 111.878, 112.193, 111.06, 111.169], [1501113600000.0, 111.158, 111.711, 110.781, 111.266], [1501200000000.0, 111.225, 111.33, 110.547, 110.671], [1501459200000.0, 110.653, 110.773, 110.214, 110.254], [1501545600000.0, 110.25, 110.589, 109.919, 110.387], [1501632000000.0, 110.36, 110.984, 110.283, 110.741], [1501718400000.0, 110.7, 110.829, 109.855, 110.045], [1501804800000.0, 110.031, 111.051, 109.841, 110.655], [1502064000000.0, 110.697, 110.919, 110.647, 110.729], [1502150400000.0, 110.73, 110.829, 110.25, 110.338], [1502236800000.0, 110.33, 110.363, 109.559, 110.056], [1502323200000.0, 110.055, 110.179, 109.153, 109.209], [1502409600000.0, 109.182, 109.404, 108.718, 109.173], [1502668800000.0, 109.153, 109.802, 109.024, 109.652], [1502755200000.0, 109.603, 110.848, 109.603, 110.662], [1502841600000.0, 110.656, 110.949, 110.03, 110.191], [1502928000000.0, 110.182, 110.369, 109.446, 109.553], [1503014400000.0, 109.548, 109.599, 108.603, 109.185], [1503273600000.0, 109.313, 109.422, 108.636, 108.958], [1503360000000.0, 108.967, 109.649, 108.844, 109.552], [1503446400000.0, 109.567, 109.826, 108.924, 109.032], [1503532800000.0, 109.041, 109.605, 108.849, 109.552], [1503619200000.0, 109.554, 109.844, 109.112, 109.322], [1503878400000.0, 109.154, 109.413, 109.026, 109.23], [1503964800000.0, 109.234, 109.902, 108.267, 109.738], [1504051200000.0, 109.63, 110.439, 109.542, 110.228], [1504137600000.0, 110.228, 110.671, 109.88, 109.96], [1504224000000.0, 109.96, 110.465, 109.562, 110.228], [1504483200000.0, 109.498, 109.933, 109.383, 109.696], [1504569600000.0, 109.676, 109.835, 108.63, 108.8], [1504656000000.0, 108.8, 109.398, 108.448, 109.178], [1504742400000.0, 109.178, 109.264, 108.046, 108.426], [1504828800000.0, 108.43, 108.486, 107.318, 107.836], [1505088000000.0, 108.168, 109.506, 108.128, 109.392], [1505174400000.0, 109.39, 110.254, 109.239, 110.15], [1505260800000.0, 110.154, 110.691, 109.903, 110.486], [1505347200000.0, 110.484, 111.04, 110.06, 110.214], [1505433600000.0, 110.216, 111.334, 109.546, 110.83], [1505692800000.0, 111.056, 111.663, 110.993, 111.57], [1505779200000.0, 111.57, 111.881, 111.201, 111.588], [1505865600000.0, 111.586, 112.532, 111.096, 112.21], [1505952000000.0, 112.21, 112.716, 112.135, 112.456], [1506038400000.0, 112.456, 112.556, 111.653, 111.99], [1506297600000.0, 112.148, 112.531, 111.475, 111.722], [1506384000000.0, 111.72, 112.475, 111.498, 112.21], [1506470400000.0, 112.218, 113.257, 112.218, 112.808], [1506556800000.0, 112.808, 113.202, 112.254, 112.322], [1506643200000.0, 112.33, 112.737, 112.213, 112.5], [1506902400000.0, 112.646, 113.058, 112.436, 112.738], [1506988800000.0, 112.744, 113.196, 112.654, 112.844], [1507075200000.0, 112.842, 112.937, 112.323, 112.75], [1507161600000.0, 112.748, 112.918, 112.413, 112.804], [1507248000000.0, 112.804, 113.44, 112.6, 112.6], [1507507200000.0, 112.558, 112.747, 112.33, 112.672], [1507593600000.0, 112.674, 112.827, 111.989, 112.436], [1507680000000.0, 112.44, 112.586, 112.08, 112.472], [1507766400000.0, 112.476, 112.521, 112.126, 112.272], [1507852800000.0, 112.276, 112.305, 111.69, 111.826], [1508112000000.0, 111.748, 112.288, 111.653, 112.182], [1508198400000.0, 112.182, 112.48, 112.036, 112.185], [1508284800000.0, 112.188, 113.05, 112.136, 112.92], [1508371200000.0, 112.924, 113.147, 112.296, 112.536], [1508457600000.0, 112.532, 113.57, 112.461, 113.508], [1508716800000.0, 113.882, 114.1, 113.245, 113.43], [1508803200000.0, 113.436, 114.022, 113.249, 113.892], [1508889600000.0, 113.9, 114.244, 113.48, 113.736], [1508976000000.0, 113.74, 114.077, 113.342, 113.97], [1509062400000.0, 113.972, 114.452, 113.635, 113.635], [1509321600000.0, 113.723, 113.836, 113.026, 113.166], [1509408000000.0, 113.17, 113.732, 112.958, 113.622], [1509494400000.0, 113.627, 114.28, 113.602, 114.178], [1509580800000.0, 114.178, 114.218, 113.538, 114.084], [1509667200000.0, 114.086, 114.426, 113.626, 114.042], [1509930000000.0, 114.001, 114.734, 113.696, 113.698], [1510016400000.0, 113.698, 114.342, 113.698, 114.002], [1510102800000.0, 114.002, 114.008, 113.395, 113.866], [1510189200000.0, 113.874, 114.068, 113.091, 113.454], [1510275600000.0, 113.47, 113.635, 113.221, 113.505], [1510534800000.0, 113.454, 113.713, 113.245, 113.62], [1510621200000.0, 113.622, 113.912, 113.308, 113.45], [1510707600000.0, 113.448, 113.496, 112.478, 112.876], [1510794000000.0, 112.872, 113.333, 112.734, 113.042], [1510880400000.0, 113.038, 113.143, 111.945, 112.085], [1511139600000.0, 112.101, 112.718, 111.886, 112.614], [1511226000000.0, 112.614, 112.704, 112.174, 112.435], [1511312400000.0, 112.435, 112.493, 111.142, 111.208], [1511398800000.0, 111.21, 111.381, 111.068, 111.199], [1511485200000.0, 111.199, 111.622, 111.194, 111.501], [1511744400000.0, 111.488, 111.692, 110.842, 111.082], [1511830800000.0, 111.08, 111.64, 110.931, 111.465], [1511917200000.0, 111.468, 112.15, 111.375, 111.906], [1512003600000.0, 111.91, 112.638, 111.735, 112.536], [1512090000000.0, 112.526, 112.874, 111.406, 112.164], [1512349200000.0, 112.792, 113.09, 112.365, 112.4], [1512435600000.0, 112.392, 112.867, 112.378, 112.579], [1512522000000.0, 112.578, 112.633, 111.992, 112.284], [1512608400000.0, 112.286, 113.158, 112.219, 113.082], [1512694800000.0, 113.08, 113.59, 113.077, 113.448], [1512954000000.0, 113.528, 113.69, 113.243, 113.545], [1513040400000.0, 113.552, 113.751, 113.371, 113.548], [1513126800000.0, 113.542, 113.575, 112.46, 112.526], [1513213200000.0, 112.534, 112.883, 112.065, 112.38], [1513299600000.0, 112.38, 112.744, 112.032, 112.581], [1513558800000.0, 112.72, 112.83, 112.31, 112.538], [1513645200000.0, 112.534, 113.079, 112.511, 112.884], [1513731600000.0, 112.884, 113.466, 112.839, 113.385], [1513818000000.0, 113.384, 113.638, 113.199, 113.315], [1513904400000.0, 113.315, 113.448, 113.24, 113.265], [1514250000000.0, 113.285, 113.332, 113.119, 113.226], [1514336400000.0, 113.23, 113.381, 113.147, 113.34], [1514422800000.0, 113.342, 113.344, 112.662, 112.856], [1514509200000.0, 112.856, 112.969, 112.472, 112.651], [1514854800000.0, 112.691, 112.701, 112.055, 112.273], [1514941200000.0, 112.273, 112.608, 112.172, 112.502], [1515027600000.0, 112.504, 112.864, 112.461, 112.732], [1515114000000.0, 112.734, 113.303, 112.717, 113.018], [1515373200000.0, 113.116, 113.387, 112.882, 113.082], [1515459600000.0, 113.08, 113.18, 112.366, 112.635], [1515546000000.0, 112.634, 112.785, 111.271, 111.424], [1515632400000.0, 111.426, 111.876, 111.044, 111.244], [1515718800000.0, 111.244, 111.698, 110.915, 110.996], [1515978000000.0, 111.081, 111.184, 110.328, 110.525], [1516064400000.0, 110.521, 110.983, 110.246, 110.438], [1516150800000.0, 110.444, 111.347, 110.192, 111.29], [1516237200000.0, 111.271, 111.482, 110.696, 111.092], [1516323600000.0, 111.09, 111.129, 110.49, 110.814], [1516582800000.0, 110.551, 111.223, 110.512, 110.922], [1516669200000.0, 110.914, 111.179, 110.252, 110.3], [1516755600000.0, 110.302, 110.337, 108.968, 109.218], [1516842000000.0, 109.212, 109.702, 108.5, 109.402], [1516928400000.0, 109.402, 109.771, 108.282, 108.589], [1517187600000.0, 108.685, 109.203, 108.51, 108.952], [1517274000000.0, 108.948, 109.205, 108.414, 108.774], [1517360400000.0, 108.772, 109.446, 108.596, 109.188], [1517446800000.0, 109.188, 109.751, 109.094, 109.382], [1517533200000.0, 109.388, 110.482, 109.281, 110.152], [1517792400000.0, 110.196, 110.286, 108.992, 109.064], [1517878800000.0, 109.078, 109.653, 108.456, 109.554], [1517965200000.0, 109.552, 109.712, 108.919, 109.302], [1518051600000.0, 109.309, 109.784, 108.58, 108.736], [1518138000000.0, 108.734, 109.31, 108.046, 108.77], [1518397200000.0, 108.842, 108.885, 108.437, 108.641], [1518483600000.0, 108.641, 108.781, 107.408, 107.81], [1518570000000.0, 107.812, 107.903, 106.723, 106.998], [1518656400000.0, 106.991, 107.0, 106.035, 106.118], [1518742800000.0, 106.118, 106.399, 105.55, 106.272], [1519002000000.0, 106.328, 106.727, 106.096, 106.58], [1519088400000.0, 106.582, 107.377, 106.557, 107.322], [1519174800000.0, 107.322, 107.903, 107.278, 107.77], [1519261200000.0, 107.759, 107.773, 106.594, 106.742], [1519347600000.0, 106.743, 107.133, 106.512, 106.858], [1519606800000.0, 107.15, 107.154, 106.376, 106.907], [1519693200000.0, 106.907, 107.676, 106.784, 107.32], [1519779600000.0, 107.32, 107.528, 106.565, 106.661], [1519866000000.0, 106.661, 107.205, 106.163, 106.222], [1519952400000.0, 106.22, 106.298, 105.25, 105.712], [1520211600000.0, 105.51, 106.238, 105.351, 106.204], [1520298000000.0, 106.204, 106.463, 105.852, 106.128], [1520384400000.0, 106.134, 106.221, 105.456, 106.059], [1520470800000.0, 106.063, 106.315, 105.892, 106.193], [1520557200000.0, 106.186, 107.05, 106.15, 106.814], [1520812800000.0, 106.632, 106.972, 106.31, 106.41], [1520899200000.0, 106.408, 107.293, 106.254, 106.564], [1520985600000.0, 106.569, 106.749, 106.064, 106.316], [1521072000000.0, 106.318, 106.415, 105.785, 106.327], [1521158400000.0, 106.324, 106.374, 105.602, 105.953], [1521417600000.0, 105.905, 106.307, 105.677, 106.084], [1521504000000.0, 106.089, 106.608, 105.929, 106.526], [1521590400000.0, 106.528, 106.64, 105.881, 106.046], [1521676800000.0, 106.048, 106.089, 105.261, 105.27], [1521763200000.0, 105.273, 105.411, 104.636, 104.712], [1522022400000.0, 104.766, 105.482, 104.707, 105.396], [1522108800000.0, 105.398, 105.903, 105.316, 105.328], [1522195200000.0, 105.329, 107.012, 105.325, 106.842], [1522281600000.0, 106.838, 106.933, 106.267, 106.418], [1522368000000.0, 106.418, 106.537, 106.122, 106.26], [1522627200000.0, 106.237, 106.45, 105.657, 105.877], [1522713600000.0, 105.877, 106.657, 105.693, 106.6], [1522800000000.0, 106.598, 106.848, 105.99, 106.774], [1522886400000.0, 106.774, 107.493, 106.711, 107.376], [1522972800000.0, 107.374, 107.46, 106.776, 106.915], [1523232000000.0, 106.937, 107.203, 106.616, 106.747], [1523318400000.0, 106.754, 107.399, 106.619, 107.188], [1523404800000.0, 107.19, 107.253, 106.65, 106.782], [1523491200000.0, 106.777, 107.43, 106.7, 107.304], [1523577600000.0, 107.294, 107.78, 107.204, 107.338], [1523836800000.0, 107.468, 107.609, 107.035, 107.106], [1523923200000.0, 107.104, 107.213, 106.882, 106.991], [1524009600000.0, 106.991, 107.386, 106.984, 107.225], [1524096000000.0, 107.223, 107.517, 107.181, 107.358], [1524182400000.0, 107.354, 107.856, 107.352, 107.616], [1524441600000.0, 107.768, 108.754, 107.659, 108.7], [1524528000000.0, 108.698, 109.201, 108.543, 108.808], [1524614400000.0, 108.808, 109.455, 108.783, 109.418], [1524700800000.0, 109.418, 109.467, 109.065, 109.294], [1524787200000.0, 109.288, 109.537, 108.97, 109.022], [1525046400000.0, 109.063, 109.452, 109.02, 109.328], [1525132800000.0, 109.332, 109.89, 109.234, 109.862], [1525219200000.0, 109.856, 110.036, 109.594, 109.826], [1525305600000.0, 109.826, 109.884, 108.929, 109.182], [1525392000000.0, 109.178, 109.274, 108.646, 109.056], [1525651200000.0, 109.109, 109.398, 108.757, 109.09], [1525737600000.0, 109.084, 109.352, 108.828, 109.126], [1525824000000.0, 109.123, 109.833, 108.996, 109.742], [1525910400000.0, 109.742, 110.019, 109.316, 109.388], [1525996800000.0, 109.387, 109.568, 109.152, 109.36], [1526256000000.0, 109.384, 109.672, 109.207, 109.652], [1526342400000.0, 109.648, 110.454, 109.648, 110.342], [1526428800000.0, 110.341, 110.404, 110.04, 110.394], [1526515200000.0, 110.391, 110.859, 110.073, 110.75], [1526601600000.0, 110.748, 111.081, 110.61, 110.736]], &quot;type&quot;: &quot;candlestick&quot;, &quot;name&quot;: &quot;\\u7c73\\u30c9\\u30eb/\\u5186&quot;}]; var dataLen = data.length; for (var ix = 0; ix &lt; dataLen; ix++) { chart.addSeries(data[ix]); } }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;\" height=520 width=820></iframe>"
],
"text/plain": [
"<highcharts.highstock.highstock.Highstock at 0x7fe85e8d0b00>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"H = Highstock()\n",
"\n",
"H.add_data_set(df2.values.tolist(), 'candlestick', '米ドル/円')\n",
"\n",
"options = {\n",
" 'rangeSelector': {\n",
" 'selected': 1\n",
" },\n",
" 'title': {\n",
" 'text': '米ドル/円 daily'\n",
" }\n",
"}\n",
"H.set_dict_options(options)\n",
"\n",
"H"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment