{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# ohlcv" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import vectorbt as vbt" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "from datetime import datetime, timedelta\n", "from numba import njit" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Config({\n", " \"open\": \"Open\",\n", " \"high\": \"High\",\n", " \"low\": \"Low\",\n", " \"close\": \"Close\",\n", " \"volume\": \"Volume\"\n", "})\n" ] } ], "source": [ "print(vbt.settings.ohlcv['column_names'])" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Can only use .str accessor with string values!\n" ] } ], "source": [ "try:\n", " pd.DataFrame([1, 2, 3]).vbt.ohlcv.plot()\n", "except Exception as e:\n", " print(e) # couldn't find default column names" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "ohlcv_ts = pd.DataFrame({\n", " 'open': [1, 2, 3], \n", " 'high': [1, 2, 3], \n", " 'low': [1, 2, 3], \n", " 'close': [1, 2, 3], \n", " 'volume': [1, 2, 3]\n", "})" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " open high low close volume\n", "2018-01-01 -0.385236 -0.339812 -0.941729 -1.058755 -0.881574\n", "2018-01-02 -0.243403 0.210847 -0.408890 0.158420 -1.149656\n", "2018-01-03 0.226744 1.207481 0.198341 1.168544 -2.071525\n", "2018-01-04 0.407461 1.294365 -0.223333 0.946101 -2.218826\n", "2018-01-05 1.221150 1.988841 0.810106 0.834179 -2.940705\n", "2018-01-06 2.022596 2.046477 1.293526 2.013281 -2.689034\n", "2018-01-07 2.724580 3.303932 1.976807 3.468771 -1.720546\n", "2018-01-08 2.057622 2.410773 1.251777 2.269435 -0.980795\n", "2018-01-09 1.607800 1.720066 1.169075 2.456895 -1.621470\n", "2018-01-10 2.069398 2.516643 1.838688 1.776437 -1.282516\n" ] } ], "source": [ "ohlcv_ts = pd.DataFrame(\n", " columns=['open', 'high', 'low', 'close', 'volume'],\n", " index=[datetime(2018, 1, 1) + timedelta(days=i) for i in range(10)]\n", ")\n", "ohlcv_ts['open'] = np.cumsum(np.random.uniform(-0.8, 1, size=(10,)))\n", "ohlcv_ts['close'] = ohlcv_ts['open'] + np.random.uniform(-1, 1, size=(10,))\n", "ohlcv_ts['high'] = ohlcv_ts['open'] + np.random.uniform(0, 1, size=(10,))\n", "ohlcv_ts['low'] = ohlcv_ts['open'] - np.random.uniform(0, 1, size=(10,))\n", "ohlcv_ts['volume'] = np.cumsum(np.random.uniform(-1, 1, size=(10,)))\n", "\n", "print(ohlcv_ts)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "try:\n", " ohlcv_ts.vbt.ohlcv.plot()\n", "except Exception as e:\n", " print(e) # still couldn't find default column names" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "−10123Jan 12018Jan 3Jan 5Jan 7Jan 9−3−2−10OHLCVolume" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Specify them manually\n", "ohlcv_ts.vbt.ohlcv(column_names={\n", " 'open': 'open', \n", " 'high': 'high', \n", " 'low': 'low', \n", " 'close': 'close', \n", " 'volume': 'volume'\n", "}).plot().show_svg()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "# Or by changing the defaults\n", "vbt.settings.ohlcv['column_names'] = {\n", " 'open': 'open', \n", " 'high': 'high', \n", " 'low': 'low', \n", " 'close': 'close', \n", " 'volume': 'volume'\n", "}" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "−10123Jan 12018Jan 3Jan 5Jan 7Jan 9−3−2−10OHLCVolume" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ohlcv_ts.vbt.ohlcv.plot().show_svg()" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Start 2018-01-01 00:00:00\n", "End 2018-01-10 00:00:00\n", "Period 10 days 00:00:00\n", "First Price -0.385236\n", "Lowest Price -1.058755\n", "Highest Price 3.468771\n", "Last Price 1.776437\n", "First Volume -0.881574\n", "Lowest Volume -2.940705\n", "Highest Volume -0.881574\n", "Last Volume -1.282516\n", "Name: agg_func_mean, dtype: object" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ohlcv_ts.vbt.ohlcv.stats()" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "7.62 ms ± 11.2 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], "source": [ "big_ohlcv_ts = pd.DataFrame(np.random.uniform(1, 2, (10000, 5)), columns=ohlcv_ts.columns)\n", "\n", "%timeit big_ohlcv_ts.vbt.ohlcv.stats()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "Jan 12018Jan 3Jan 5Jan 7Jan 9−10123OHLCIndexOHLC" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ohlcv_ts.vbt.ohlcv.plots().show_svg()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.7.3" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { "2e398c67d83547b7b18c2c71eee3d13d": { "buffers": [ { "data": "RnjBo8Yt7r/6/PV6zpbIv14H7K6rSuG/zMS+hM8q2j/K8wKK0ZHhPwO+H4Tjfue/FB9ziWca8L9dbsMziiHwP2jOsMtmhbq/THo0sY8X9T8=", "encoding": "base64", "path": [ "_data", 0, "close", "value" ] }, { "data": "G2yPWXSX1L805X9UXv3kP3vxHYb7PeI/BCY+QDzJzj9ydwtWve/jP0D/4SSIStE/jM9Ijb2Wyj/JglqsK/rwP0UwfFFgY/E/nwQuay63AEA=", "encoding": "base64", "path": [ "_data", 0, "high", "value" ] }, { "data": "uoy35UmW5r8uuPRCrXjCvywfntNQXva/gRfybgry7b+M0GcYG03cv0il/ILWFeO/kTFfYU9k7790CRb/61jFv3flYrjYnem/3OZTbr4e6T8=", "encoding": "base64", "path": [ "_data", 0, "low", "value" ] }, { "data": "/b3pTFEl279cSb9dazSzP+wJwCcrxNq/AFDbzy2Fab8Mvy53ApnTP5JH+gNKbtK/AMob9Zy9z7+mipGviqnkPxzi2mPs7cI/Guaczvmb8T8=", "encoding": "base64", "path": [ "_data", 0, "open", "value" ] }, { "data": "HCrjrash4T/QOMtYcTTCP4KfTWJ92+G/EBxBYKG5+L+iVW+Wi5P7v0PV/JMP8fO/nnZcSFR+/b+Tj20F8pj8vze5F96ASwHAcyrG2aX8/r8=", "encoding": "base64", "path": [ "_data", 1, "y", "value" ] } ], "model_module": "plotlywidget", "model_module_version": "^4.12.0", "model_name": "FigureModel", "state": { "_config": { "plotlyServerURL": "https://plot.ly" }, "_data": [ { "close": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "decreasing": { "line": { "color": "#d95f02" } }, "high": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "increasing": { "line": { "color": "#1b9e76" } }, "low": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "name": "OHLC", "open": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "type": "ohlc", "uid": "08dcba2b-99cf-4032-bf56-b75e9437eb59", "x": [ "2018-01-01T00:00:00.000000", "2018-01-02T00:00:00.000000", "2018-01-03T00:00:00.000000", "2018-01-04T00:00:00.000000", "2018-01-05T00:00:00.000000", "2018-01-06T00:00:00.000000", "2018-01-07T00:00:00.000000", "2018-01-08T00:00:00.000000", "2018-01-09T00:00:00.000000", "2018-01-10T00:00:00.000000" ], "xaxis": "x", "yaxis": "y2" }, { "marker": { "color": [ "#d95f02", "#d95f02", "#d95f02", "#1b9e76", "#1b9e76", "#d95f02", "#d95f02", "#1b9e76", "#d95f02", "#1b9e76" ], "line": { "width": 0 }, "opacity": 0.7 }, "name": "Volume", "type": "bar", "uid": "b7b27803-d0f2-4141-8e61-edaabd1d9a8e", "x": [ "2018-01-01T00:00:00.000000", "2018-01-02T00:00:00.000000", "2018-01-03T00:00:00.000000", "2018-01-04T00:00:00.000000", "2018-01-05T00:00:00.000000", "2018-01-06T00:00:00.000000", "2018-01-07T00:00:00.000000", "2018-01-08T00:00:00.000000", "2018-01-09T00:00:00.000000", "2018-01-10T00:00:00.000000" ], "xaxis": "x", "y": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "yaxis": "y" } ], "_js2py_layoutDelta": {}, "_js2py_pointsCallback": {}, "_js2py_relayout": {}, "_js2py_restyle": {}, "_js2py_traceDeltas": {}, "_js2py_update": {}, "_last_layout_edit_id": 6, "_last_trace_edit_id": 6, "_layout": { "autosize": false, "bargap": 0, "colorway": [ "#1f77b4", "#ff7f0e", "#2ca02c", "#dc3912", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf" ], "height": 350, "hovermode": "closest", "legend": { "orientation": "h", "traceorder": "normal", "x": 1, "xanchor": "right", "y": 1.02, "yanchor": "bottom" }, "margin": { "b": 30, "l": 30, "r": 30, "t": 30 }, "showlegend": true, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "width": 700, "xaxis": { "rangeslider": { "visible": false }, "showgrid": true }, "yaxis": { "domain": [ 0, 0.33 ], "showgrid": true }, "yaxis2": { "domain": [ 0.33, 1 ] } }, "_py2js_animate": {}, "_py2js_deleteTraces": {}, "_py2js_moveTraces": {}, "_py2js_removeLayoutProps": {}, "_py2js_removeTraceProps": {}, "_py2js_restyle": {}, "_view_count": 0 } }, "ffbf570b1fd14d3da6bd1e2c4d55078b": { "buffers": [ { "data": "RnjBo8Yt7r/6/PV6zpbIv14H7K6rSuG/zMS+hM8q2j/K8wKK0ZHhPwO+H4Tjfue/FB9ziWca8L9dbsMziiHwP2jOsMtmhbq/THo0sY8X9T8=", "encoding": "base64", "path": [ "_data", 0, "close", "value" ] }, { "data": "G2yPWXSX1L805X9UXv3kP3vxHYb7PeI/BCY+QDzJzj9ydwtWve/jP0D/4SSIStE/jM9Ijb2Wyj/JglqsK/rwP0UwfFFgY/E/nwQuay63AEA=", "encoding": "base64", "path": [ "_data", 0, "high", "value" ] }, { "data": "uoy35UmW5r8uuPRCrXjCvywfntNQXva/gRfybgry7b+M0GcYG03cv0il/ILWFeO/kTFfYU9k7790CRb/61jFv3flYrjYnem/3OZTbr4e6T8=", "encoding": "base64", "path": [ "_data", 0, "low", "value" ] }, { "data": "/b3pTFEl279cSb9dazSzP+wJwCcrxNq/AFDbzy2Fab8Mvy53ApnTP5JH+gNKbtK/AMob9Zy9z7+mipGviqnkPxzi2mPs7cI/Guaczvmb8T8=", "encoding": "base64", "path": [ "_data", 0, "open", "value" ] }, { "data": "HCrjrash4T/QOMtYcTTCP4KfTWJ92+G/EBxBYKG5+L+iVW+Wi5P7v0PV/JMP8fO/nnZcSFR+/b+Tj20F8pj8vze5F96ASwHAcyrG2aX8/r8=", "encoding": "base64", "path": [ "_data", 1, "y", "value" ] } ], "model_module": "plotlywidget", "model_module_version": "^4.12.0", "model_name": "FigureModel", "state": { "_config": { "plotlyServerURL": "https://plot.ly" }, "_data": [ { "close": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "decreasing": { "line": { "color": "#d95f02" } }, "high": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "increasing": { "line": { "color": "#1b9e76" } }, "low": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "name": "OHLC", "open": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "type": "ohlc", "uid": "bc161987-eb09-4d14-885c-9de5ce70c55b", "x": [ "2018-01-01T00:00:00.000000", "2018-01-02T00:00:00.000000", "2018-01-03T00:00:00.000000", "2018-01-04T00:00:00.000000", "2018-01-05T00:00:00.000000", "2018-01-06T00:00:00.000000", "2018-01-07T00:00:00.000000", "2018-01-08T00:00:00.000000", "2018-01-09T00:00:00.000000", "2018-01-10T00:00:00.000000" ], "xaxis": "x", "yaxis": "y2" }, { "marker": { "color": [ "#d95f02", "#d95f02", "#d95f02", "#1b9e76", "#1b9e76", "#d95f02", "#d95f02", "#1b9e76", "#d95f02", "#1b9e76" ], "line": { "width": 0 }, "opacity": 0.7 }, "name": "Volume", "type": "bar", "uid": "a755c6b7-2976-4a9e-bc6a-217b14ba7701", "x": [ "2018-01-01T00:00:00.000000", "2018-01-02T00:00:00.000000", "2018-01-03T00:00:00.000000", "2018-01-04T00:00:00.000000", "2018-01-05T00:00:00.000000", "2018-01-06T00:00:00.000000", "2018-01-07T00:00:00.000000", "2018-01-08T00:00:00.000000", "2018-01-09T00:00:00.000000", "2018-01-10T00:00:00.000000" ], "xaxis": "x", "y": { "dtype": "float64", "shape": [ 10 ], "value": {} }, "yaxis": "y" } ], "_js2py_layoutDelta": {}, "_js2py_pointsCallback": {}, "_js2py_relayout": {}, "_js2py_restyle": {}, "_js2py_traceDeltas": {}, "_js2py_update": {}, "_last_layout_edit_id": 6, "_last_trace_edit_id": 6, "_layout": { "autosize": false, "bargap": 0, "colorway": [ "#1f77b4", "#ff7f0e", "#2ca02c", "#dc3912", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf" ], "height": 350, "hovermode": "closest", "legend": { "orientation": "h", "traceorder": "normal", "x": 1, "xanchor": "right", "y": 1.02, "yanchor": "bottom" }, "margin": { "b": 30, "l": 30, "r": 30, "t": 30 }, "showlegend": true, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "width": 700, "xaxis": { "rangeslider": { "visible": false }, "showgrid": true }, "yaxis": { "domain": [ 0, 0.33 ], "showgrid": true }, "yaxis2": { "domain": [ 0.33, 1 ] } }, "_py2js_animate": {}, "_py2js_deleteTraces": {}, "_py2js_moveTraces": {}, "_py2js_removeLayoutProps": {}, "_py2js_removeTraceProps": {}, "_py2js_restyle": {}, "_view_count": 0 } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }