daily update

This commit is contained in:
David Brazda
2024-10-21 20:57:56 +02:00
parent 132172855a
commit e3da60c647
196 changed files with 1722489 additions and 1134 deletions

View File

@ -9,11 +9,33 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"None\n",
"Loaded env variables from file None\n"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Activating profile profile1\n",
"</pre>\n"
],
"text/plain": [
"Activating profile profile1\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from lightweight_charts import Panel, chart, PlotAccessor\n",
"from lightweight_charts import Panel, chart, PlotDFAccessor\n",
"from v2realbot.utils.utils import zoneNY\n",
"import pandas as pd\n",
"import numpy as np\n",
@ -496,7 +518,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
@ -508,25 +530,34 @@
"trades_df-SPY-2024-01-01T09:30:00-2024-05-14T16:00:00.parquet\n",
"trades_df-BAC-2023-01-01T09_30_00-2024-05-25T16_00_00-47BCFOPUVWZ-100.parquet\n",
"ohlcv_df-BAC-2024-01-11T09:30:00-2024-01-12T16:00:00.parquet\n",
"trades_df-BAC-2024-10-03T09:30:00-2024-10-16T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\n",
"trades_df-BAC-2023-01-01T09:30:00-2024-10-02T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\n",
"trades_df-BAC-2024-05-15T09_30_00-2024-05-25T16_00_00-47BCFOPUVWZ-100.parquet\n",
"ohlcv_df-BAC-2024-10-03T09:30:00-2024-10-16T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\n",
"ohlcv_df-BAC-2023-01-01T09:30:00-2024-10-02T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\n",
"ohlcv_df-BAC-2024-01-01T09_30_00-2024-05-25T16_00_00-47BCFOPUVWZ-100.parquet\n",
"ohlcv_df-SPY-2024-01-01T09:30:00-2024-05-14T16:00:00.parquet\n",
"ohlcv_df-BAC-2024-01-01T09_30_00-2024-05-14T16_00_00-CO4B7VPWUZF-100.parquet\n",
"ohlcv_df-BAC-2023-01-01T09_30_00-2024-05-25T16_00_00-47BCFOPUVWZ-100.parquet\n",
"ohlcv_df-BAC-2023-01-01T09_30_00-2024-05-25T15_30_00-47BCFOPUVWZ-100.parquet\n"
"ohlcv_df-BAC-2023-01-01T09_30_00-2024-05-25T15_30_00-47BCFOPUVWZ-100.parquet\n",
"<class 'pandas.core.frame.DataFrame'>\n",
"DatetimeIndex: 114097 entries, 2024-10-03 09:30:00-04:00 to 2024-10-16 15:59:59-04:00\n",
"Data columns (total 10 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 open 114097 non-null float64 \n",
" 1 high 114097 non-null float64 \n",
" 2 low 114097 non-null float64 \n",
" 3 close 114097 non-null float64 \n",
" 4 volume 114097 non-null float64 \n",
" 5 trades 114097 non-null float64 \n",
" 6 updated 114097 non-null datetime64[ns, US/Eastern]\n",
" 7 vwap 114097 non-null float64 \n",
" 8 buyvolume 114097 non-null float64 \n",
" 9 sellvolume 114097 non-null float64 \n",
"dtypes: datetime64[ns, US/Eastern](1), float64(9)\n",
"memory usage: 9.6 MB\n"
]
},
{
"data": {
"text/plain": [
"440"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
@ -545,7 +576,8 @@
"files = [f for f in os.listdir(dir) if f.endswith(\".parquet\")]\n",
"print('\\n'.join(map(str, files)))\n",
"#file_name = \"ohlcv_df-BAC-2023-01-01T09_30_00-2024-05-25T15_30_00-47BCFOPUVWZ-100.parquet\"\n",
"file_name = \"ohlcv_df-BAC-2023-01-01T09:30:00-2024-10-02T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\"\n",
"#file_name = \"ohlcv_df-BAC-2023-01-01T09:30:00-2024-10-02T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\"\n",
"file_name = \"ohlcv_df-BAC-2024-10-03T09:30:00-2024-10-16T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\"\n",
"ohlcv_df = pd.read_parquet(dir+file_name,engine='pyarrow')\n",
"#filter ohlcv_df to certain date range (assuming datetime index)\n",
"#ohlcv_df = ohlcv_df.loc[\"2024-02-12 9:30\":\"2024-02-16 16:00\"]\n",
@ -555,9 +587,29 @@
"\n",
"basic_data = vbt.Data.from_data(vbt.symbol_dict({\"BAC\": ohlcv_df}), tz_convert=zoneNY)\n",
"#ohlcv_df= None\n",
"basic_data.wrapper.index.normalize().nunique()\n",
"bd = basic_data.transform(lambda df: df[:1000000])\n",
"bd.data[\"BAC\"].info()\n"
"# basic_data.wrapper.index.normalize().nunique()\n",
"# bd = basic_data.transform(lambda df: df[:1000000])\n",
"basic_data.data[\"BAC\"].info()\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"10"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"basic_data.wrapper.index.normalize().nunique()"
]
},
{
@ -569,19 +621,30 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"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",
"from lib.db import Connection\n",
"SYMBOL = \"BAC\"\n",
"SCHEMA = \"ohlcv_1s\" #time based 1s other options ohlcv_vol_200 (volume based ohlcv with resolution of 200), ohlcv_renko_20 (renko with 20 bricks size) ...\n",
"DB = \"market_data\"\n",
"\n",
"try:\n",
" con = Connection(db_name=DB, default_schema=SCHEMA, create_db=True)\n",
" con.force_rollback_all() # Force cleanup before attempting to save\n",
" con.save(basic_data,1000)\n",
" con = Connection(db_name=DB, default_schema=SCHEMA, create_db=False)\n",
" #con.force_rollback_all() # Force cleanup before attempting to save\n",
" con.save(basic_data, chunksize=500)\n",
"except Exception as e:\n",
" print(f\"Error occurred: {str(e)}\")\n",
"\n",

View File

@ -29,9 +29,30 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"None\n",
"Loaded env variables from file None\n"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Activating profile profile1\n",
"</pre>\n"
],
"text/plain": [
"Activating profile profile1\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
@ -43,6 +64,7 @@
"ohlcv_df-BAC-2024-01-11T09:30:00-2024-01-12T16:00:00.parquet\n",
"trades_df-BAC-2023-01-01T09:30:00-2024-10-02T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\n",
"trades_df-BAC-2024-05-15T09_30_00-2024-05-25T16_00_00-47BCFOPUVWZ-100.parquet\n",
"ohlcv_df-BAC-2023-01-01T09:30:00-2024-10-02T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\n",
"ohlcv_df-BAC-2024-01-01T09_30_00-2024-05-25T16_00_00-47BCFOPUVWZ-100.parquet\n",
"ohlcv_df-SPY-2024-01-01T09:30:00-2024-05-14T16:00:00.parquet\n",
"ohlcv_df-BAC-2024-01-01T09_30_00-2024-05-14T16_00_00-CO4B7VPWUZF-100.parquet\n",
@ -56,7 +78,7 @@
"['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']"
]
},
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
@ -92,8 +114,8 @@
"\n",
"symbol = \"BAC\"\n",
"#datetime in zoneNY \n",
"day_start = datetime(2023, 1, 1, 9, 30, 0)\n",
"day_stop = datetime(2024, 10, 2, 16, 00, 0)\n",
"day_start = datetime(2024, 10, 3, 9, 30, 0)\n",
"day_stop = datetime(2024, 10, 16, 16, 00, 0)\n",
"day_start = zoneNY.localize(day_start)\n",
"day_stop = zoneNY.localize(day_stop)\n",
"#filename of trades_df parquet, date are in isoformat but without time zone part\n",
@ -114,30 +136,187 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Contains 10 market days\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Processing market days: 100%|██████████| 10/10 [00:00<00:00, 267.74it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"NOT FOUND. Fetching from remote\n",
"NOT FOUND. Fetching from remote\n",
"NOT FOUND. Fetching from remote\n",
"NOT FOUND. Fetching from remote\n",
"NOT FOUND. Fetching from remote\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Fetching data: 0%| | 0/10 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Remote fetched: is_empty=False 2024-10-03 09:30:00-04:00 2024-10-03 16:00:00-04:00\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1727962200-1727985600.cache.gz\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Fetching data: 10%|█ | 1/10 [00:21<03:12, 21.41s/it]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n",
"minsize 100\n",
"NOT FOUND. Fetching from remote\n",
"Remote fetched: is_empty=False 2024-10-08 09:30:00-04:00 2024-10-08 16:00:00-04:00\n",
"Remote fetched: is_empty=False 2024-10-09 09:30:00-04:00 2024-10-09 16:00:00-04:00\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1728394200-1728417600.cache.gz\n",
"Remote fetched: is_empty=False 2024-10-07 09:30:00-04:00 2024-10-07 16:00:00-04:00\n",
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n",
"minsize 100\n",
"NOT FOUND. Fetching from remote\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1728480600-1728504000.cache.gz\n",
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n",
"minsize 100\n",
"NOT FOUND. Fetching from remote\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1728307800-1728331200.cache.gz\n",
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n",
"minsize 100\n",
"NOT FOUND. Fetching from remote\n",
"Remote fetched: is_empty=False 2024-10-04 09:30:00-04:00 2024-10-04 16:00:00-04:00\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1728048600-1728072000.cache.gz\n",
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Fetching data: 20%|██ | 2/10 [00:32<02:01, 15.24s/it]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"minsize 100\n",
"NOT FOUND. Fetching from remote\n",
"Remote fetched: is_empty=False 2024-10-10 09:30:00-04:00 2024-10-10 16:00:00-04:00\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1728567000-1728590400.cache.gz\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Fetching data: 60%|██████ | 6/10 [00:47<00:25, 6.40s/it]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n",
"minsize 100\n",
"Remote fetched: is_empty=False 2024-10-14 09:30:00-04:00 2024-10-14 16:00:00-04:00\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1728912600-1728936000.cache.gz\n",
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n",
"minsize 100\n",
"Remote fetched: is_empty=False 2024-10-16 09:30:00-04:00 2024-10-16 16:00:00-04:00\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1729085400-1729108800.cache.gz\n",
"Remote fetched: is_empty=False 2024-10-11 09:30:00-04:00 2024-10-11 16:00:00-04:00\n",
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n",
"minsize 100\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1728653400-1728676800.cache.gz\n",
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Fetching data: 70%|███████ | 7/10 [01:13<00:31, 10.55s/it]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"minsize 100\n",
"Remote fetched: is_empty=False 2024-10-15 09:30:00-04:00 2024-10-15 16:00:00-04:00\n",
"Saving to Trade CACHE /Users/davidbrazda/Library/Application Support/v2realbot/tradecache/BAC-1728999000-1729022400.cache.gz\n",
"excluding conditions ['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Fetching data: 100%|██████████| 10/10 [01:25<00:00, 8.53s/it]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"minsize 100\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n"
]
}
],
"source": [
"from v2realbot.loader.aggregator_vectorized import fetch_daily_stock_trades, fetch_trades_parallel, generate_time_bars_nb, aggregate_trades, fetch_trades_parallel_optimized\n",
"#fetch trades in one go\n",
"#trades_df = fetch_daily_stock_trades(symbol, day_start, day_stop, exclude_conditions=exclude_conditions, minsize=minsize, force_remote=False, max_retries=5, backoff_factor=1)\n",
"#fetch trades in parallel - for longer intervals\n",
"#trades_df = fetch_trades_parallel(symbol, day_start, day_stop, exclude_conditions=exclude_conditions, minsize=minsize, force_remote=False, max_workers=None)\n",
"trades_df = fetch_trades_parallel(symbol, day_start, day_stop, exclude_conditions=exclude_conditions, minsize=minsize, force_remote=True, max_workers=None)\n",
" \n",
"##trades_df.info()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"#trades_df.to_parquet(file_trades, engine='pyarrow', compression='gzip')"
"trades_df.to_parquet(file_trades, engine='pyarrow', compression='gzip')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
@ -156,7 +335,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
@ -170,9 +349,275 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"\"/Users/davidbrazda/Library/Application Support/v2realbot/notebooks/ohlcv_df-BAC-2024-10-03T09:30:00-2024-10-16T16:00:00-['4', '7', 'B', 'C', 'F', 'O', 'P', 'U', 'V', 'W', 'Z']-100.parquet\""
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"file_ohlcv"
]
},
{
"cell_type": "code",
"execution_count": 7,
"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>open</th>\n",
" <th>high</th>\n",
" <th>low</th>\n",
" <th>close</th>\n",
" <th>volume</th>\n",
" <th>trades</th>\n",
" <th>updated</th>\n",
" <th>vwap</th>\n",
" <th>buyvolume</th>\n",
" <th>sellvolume</th>\n",
" </tr>\n",
" <tr>\n",
" <th>time</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2024-10-03 09:30:00-04:00</th>\n",
" <td>38.9800</td>\n",
" <td>39.0000</td>\n",
" <td>38.940</td>\n",
" <td>38.970</td>\n",
" <td>249774.0</td>\n",
" <td>6.0</td>\n",
" <td>2024-10-03 09:30:01.061997-04:00</td>\n",
" <td>38.960055</td>\n",
" <td>500.0</td>\n",
" <td>249088.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-03 09:30:01-04:00</th>\n",
" <td>38.9500</td>\n",
" <td>39.0001</td>\n",
" <td>38.950</td>\n",
" <td>39.000</td>\n",
" <td>13553.0</td>\n",
" <td>44.0</td>\n",
" <td>2024-10-03 09:30:02.171691-04:00</td>\n",
" <td>38.985179</td>\n",
" <td>2133.0</td>\n",
" <td>1894.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-03 09:30:02-04:00</th>\n",
" <td>38.9992</td>\n",
" <td>39.0100</td>\n",
" <td>38.990</td>\n",
" <td>39.010</td>\n",
" <td>4600.0</td>\n",
" <td>20.0</td>\n",
" <td>2024-10-03 09:30:03.091339-04:00</td>\n",
" <td>39.000123</td>\n",
" <td>1031.0</td>\n",
" <td>797.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-03 09:30:03-04:00</th>\n",
" <td>38.9900</td>\n",
" <td>39.0400</td>\n",
" <td>38.990</td>\n",
" <td>39.030</td>\n",
" <td>7533.0</td>\n",
" <td>36.0</td>\n",
" <td>2024-10-03 09:30:04.193646-04:00</td>\n",
" <td>39.030827</td>\n",
" <td>1733.0</td>\n",
" <td>713.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-03 09:30:04-04:00</th>\n",
" <td>39.0320</td>\n",
" <td>39.0350</td>\n",
" <td>39.032</td>\n",
" <td>39.035</td>\n",
" <td>9142.0</td>\n",
" <td>2.0</td>\n",
" <td>2024-10-03 09:30:07.260896-04:00</td>\n",
" <td>39.032033</td>\n",
" <td>9142.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-16 15:59:55-04:00</th>\n",
" <td>42.8100</td>\n",
" <td>42.8100</td>\n",
" <td>42.810</td>\n",
" <td>42.810</td>\n",
" <td>8681.0</td>\n",
" <td>22.0</td>\n",
" <td>2024-10-16 15:59:56.000104-04:00</td>\n",
" <td>42.810000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-16 15:59:56-04:00</th>\n",
" <td>42.8150</td>\n",
" <td>42.8150</td>\n",
" <td>42.810</td>\n",
" <td>42.810</td>\n",
" <td>4128.0</td>\n",
" <td>9.0</td>\n",
" <td>2024-10-16 15:59:57.010896-04:00</td>\n",
" <td>42.811550</td>\n",
" <td>1100.0</td>\n",
" <td>603.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-16 15:59:57-04:00</th>\n",
" <td>42.8150</td>\n",
" <td>42.8150</td>\n",
" <td>42.810</td>\n",
" <td>42.810</td>\n",
" <td>5301.0</td>\n",
" <td>20.0</td>\n",
" <td>2024-10-16 15:59:58.006387-04:00</td>\n",
" <td>42.812493</td>\n",
" <td>789.0</td>\n",
" <td>1708.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-16 15:59:58-04:00</th>\n",
" <td>42.8160</td>\n",
" <td>42.8200</td>\n",
" <td>42.800</td>\n",
" <td>42.800</td>\n",
" <td>21469.0</td>\n",
" <td>33.0</td>\n",
" <td>2024-10-16 15:59:59.088188-04:00</td>\n",
" <td>42.809572</td>\n",
" <td>542.0</td>\n",
" <td>632.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-10-16 15:59:59-04:00</th>\n",
" <td>42.8087</td>\n",
" <td>42.8100</td>\n",
" <td>42.800</td>\n",
" <td>42.810</td>\n",
" <td>26899.0</td>\n",
" <td>16.0</td>\n",
" <td>2024-10-16 15:59:59.997799-04:00</td>\n",
" <td>42.801563</td>\n",
" <td>4757.0</td>\n",
" <td>16482.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>114097 rows × 10 columns</p>\n",
"</div>"
],
"text/plain": [
" open high low close volume trades \\\n",
"time \n",
"2024-10-03 09:30:00-04:00 38.9800 39.0000 38.940 38.970 249774.0 6.0 \n",
"2024-10-03 09:30:01-04:00 38.9500 39.0001 38.950 39.000 13553.0 44.0 \n",
"2024-10-03 09:30:02-04:00 38.9992 39.0100 38.990 39.010 4600.0 20.0 \n",
"2024-10-03 09:30:03-04:00 38.9900 39.0400 38.990 39.030 7533.0 36.0 \n",
"2024-10-03 09:30:04-04:00 39.0320 39.0350 39.032 39.035 9142.0 2.0 \n",
"... ... ... ... ... ... ... \n",
"2024-10-16 15:59:55-04:00 42.8100 42.8100 42.810 42.810 8681.0 22.0 \n",
"2024-10-16 15:59:56-04:00 42.8150 42.8150 42.810 42.810 4128.0 9.0 \n",
"2024-10-16 15:59:57-04:00 42.8150 42.8150 42.810 42.810 5301.0 20.0 \n",
"2024-10-16 15:59:58-04:00 42.8160 42.8200 42.800 42.800 21469.0 33.0 \n",
"2024-10-16 15:59:59-04:00 42.8087 42.8100 42.800 42.810 26899.0 16.0 \n",
"\n",
" updated vwap \\\n",
"time \n",
"2024-10-03 09:30:00-04:00 2024-10-03 09:30:01.061997-04:00 38.960055 \n",
"2024-10-03 09:30:01-04:00 2024-10-03 09:30:02.171691-04:00 38.985179 \n",
"2024-10-03 09:30:02-04:00 2024-10-03 09:30:03.091339-04:00 39.000123 \n",
"2024-10-03 09:30:03-04:00 2024-10-03 09:30:04.193646-04:00 39.030827 \n",
"2024-10-03 09:30:04-04:00 2024-10-03 09:30:07.260896-04:00 39.032033 \n",
"... ... ... \n",
"2024-10-16 15:59:55-04:00 2024-10-16 15:59:56.000104-04:00 42.810000 \n",
"2024-10-16 15:59:56-04:00 2024-10-16 15:59:57.010896-04:00 42.811550 \n",
"2024-10-16 15:59:57-04:00 2024-10-16 15:59:58.006387-04:00 42.812493 \n",
"2024-10-16 15:59:58-04:00 2024-10-16 15:59:59.088188-04:00 42.809572 \n",
"2024-10-16 15:59:59-04:00 2024-10-16 15:59:59.997799-04:00 42.801563 \n",
"\n",
" buyvolume sellvolume \n",
"time \n",
"2024-10-03 09:30:00-04:00 500.0 249088.0 \n",
"2024-10-03 09:30:01-04:00 2133.0 1894.0 \n",
"2024-10-03 09:30:02-04:00 1031.0 797.0 \n",
"2024-10-03 09:30:03-04:00 1733.0 713.0 \n",
"2024-10-03 09:30:04-04:00 9142.0 0.0 \n",
"... ... ... \n",
"2024-10-16 15:59:55-04:00 0.0 0.0 \n",
"2024-10-16 15:59:56-04:00 1100.0 603.0 \n",
"2024-10-16 15:59:57-04:00 789.0 1708.0 \n",
"2024-10-16 15:59:58-04:00 542.0 632.0 \n",
"2024-10-16 15:59:59-04:00 4757.0 16482.0 \n",
"\n",
"[114097 rows x 10 columns]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ohlcv_df"
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long