Resolve the start and end time issue on candles

This commit is contained in:
Gavin.Chan
2018-02-01 11:09:35 +00:00
parent f4182abb70
commit de6d0732d4
4 changed files with 54 additions and 39 deletions
+25 -13
View File
@@ -2,21 +2,30 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 7,
"metadata": {
"ExecuteTime": {
"end_time": "2018-01-31T15:32:12.633315Z",
"start_time": "2018-01-31T15:32:11.476421Z"
"end_time": "2018-02-01T03:07:19.370253Z",
"start_time": "2018-02-01T03:07:19.320425Z"
}
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import pandas as pd\n",
"\n",
"from libcryptomarket.core import candles, latest_candles"
"from libcryptomarket.core import candles, latest_candles, FREQUENCY_TO_SEC_DICT"
]
},
{
@@ -28,11 +37,11 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 22,
"metadata": {
"ExecuteTime": {
"end_time": "2018-01-31T15:32:18.992459Z",
"start_time": "2018-01-31T15:32:12.637992Z"
"end_time": "2018-02-01T11:08:13.573415Z",
"start_time": "2018-02-01T11:08:06.960801Z"
},
"scrolled": true
},
@@ -68,11 +77,11 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 24,
"metadata": {
"ExecuteTime": {
"end_time": "2018-01-31T15:33:04.405264Z",
"start_time": "2018-01-31T15:33:00.256283Z"
"end_time": "2018-02-01T11:08:52.923410Z",
"start_time": "2018-02-01T11:08:40.223787Z"
}
},
"outputs": [
@@ -80,7 +89,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Running exchange poloniex for instrument ['BTC_LTC', 'BTC_ETH']\n"
"Running exchange poloniex for instrument ['BTC_LTC', 'BTC_ETH']\n",
"Running exchange bitfinex for instrument ['tBTCUSD', 'tETHUSD']\n",
"Running exchange gdax for instrument ['BTC-USD', 'ETH-USD']\n"
]
}
],
@@ -88,9 +99,10 @@
"for source, symbols in [\n",
" (\"poloniex\", [\"BTC_LTC\", \"BTC_ETH\"]), \n",
" (\"bitfinex\", [\"tBTCUSD\", \"tETHUSD\"]),\n",
" (\"gdax\", [\"BTC-USD\", \"ETH-USD\"])\n",
" ]:\n",
" print(\"Running exchange {} for instrument {}\".format(source, symbols))\n",
" data = latest_candles(source=source, symbols=symbols, frequency=\"30m\", frequency_count=1)\n",
" data = latest_candles(source=source, symbols=symbols, frequency=\"5m\", frequency_count=1)\n",
" assert data.shape[0] == 1"
]
},