{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Activating profile profile1\n",
"\n"
],
"text/plain": [
"Activating profile profile1\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Profile profile1 loaded successfully.\n",
"\n"
],
"text/plain": [
"Profile profile1 loaded successfully.\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Current values:\n",
"{\n",
" 'AGG_EXCLUDED_TRADES': ['C', 'O', '4', 'B', '7', 'V', 'P', 'W', 'U', 'Z', 'F'],\n",
" 'BT_DELAYS': {\n",
" 'trigger_to_strat': 0.02,\n",
" 'strat_to_sub': 0.023,\n",
" 'sub_to_fill': 0.008,\n",
" 'fill_to_not': 0.023,\n",
" 'limit_order_offset': 0\n",
" },\n",
" 'BT_FILL_CONDITION_BUY_LIMIT': <FillCondition.SLOW: 'slow'>,\n",
" 'BT_FILL_CONDITION_SELL_LIMIT': <FillCondition.SLOW: 'slow'>,\n",
" 'BT_FILL_CONS_TRADES_REQUIRED': 2,\n",
" 'BT_FILL_LOG_SURROUNDING_TRADES': 10,\n",
" 'BT_FILL_PRICE_MARKET_ORDER_PREMIUM': 0.005,\n",
" 'COUNT_API_REQUESTS': False,\n",
" 'GROUP_TRADES_WITH_TIMESTAMP_LESS_THAN': 0.003,\n",
" 'ILOG_SAVE_LEVEL_FROM': 1,\n",
" 'LIVE_DATA_FEED': 'sip',\n",
" 'NORMALIZED_TICK_BASE_PRICE': 30.0,\n",
" 'OFFLINE_MODE': False,\n",
" 'PROD_SERVER_HOSTNAMES': ['tradingeastcoast', 'David-MacBook-Pro.local'],\n",
" 'QUIET_MODE': True,\n",
" 'TEST_SERVER_HOSTNAMES': ['tradingtest']\n",
"}\n",
"\n"
],
"text/plain": [
"Current values:\n",
"\u001b[1m{\u001b[0m\n",
" \u001b[32m'AGG_EXCLUDED_TRADES'\u001b[0m: \u001b[1m[\u001b[0m\u001b[32m'C'\u001b[0m, \u001b[32m'O'\u001b[0m, \u001b[32m'4'\u001b[0m, \u001b[32m'B'\u001b[0m, \u001b[32m'7'\u001b[0m, \u001b[32m'V'\u001b[0m, \u001b[32m'P'\u001b[0m, \u001b[32m'W'\u001b[0m, \u001b[32m'U'\u001b[0m, \u001b[32m'Z'\u001b[0m, \u001b[32m'F'\u001b[0m\u001b[1m]\u001b[0m,\n",
" \u001b[32m'BT_DELAYS'\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[32m'trigger_to_strat'\u001b[0m: \u001b[1;36m0.02\u001b[0m,\n",
" \u001b[32m'strat_to_sub'\u001b[0m: \u001b[1;36m0.023\u001b[0m,\n",
" \u001b[32m'sub_to_fill'\u001b[0m: \u001b[1;36m0.008\u001b[0m,\n",
" \u001b[32m'fill_to_not'\u001b[0m: \u001b[1;36m0.023\u001b[0m,\n",
" \u001b[32m'limit_order_offset'\u001b[0m: \u001b[1;36m0\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[32m'BT_FILL_CONDITION_BUY_LIMIT'\u001b[0m: \u001b[1m<\u001b[0m\u001b[1;95mFillCondition.SLOW:\u001b[0m\u001b[39m \u001b[0m\u001b[32m'slow'\u001b[0m\u001b[39m>,\u001b[0m\n",
"\u001b[39m \u001b[0m\u001b[32m'BT_FILL_CONDITION_SELL_LIMIT'\u001b[0m\u001b[39m: config_handler.active_profile='profile1'\n", "\n" ], "text/plain": [ "config_handler.\u001b[33mactive_profile\u001b[0m=\u001b[32m'profile1'\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
config handler initialized\n",
"\n"
],
"text/plain": [
"config handler initialized\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Realtime Websocket connection will use FEED: sip and credential of ACCOUNT1\n"
]
}
],
"source": [
"from v2realbot.tools.loadbatch import load_batch\n",
"from v2realbot.utils.utils import zoneNY\n",
"import pandas as pd\n",
"import numpy as np\n",
"import vectorbtpro as vbt\n",
"\n",
"vbt.settings.set_theme(\"dark\")\n",
"vbt.settings['plotting']['layout']['width'] = 1280\n",
"vbt.settings.plotting.auto_rangebreaks = True\n",
"# Set the option to display with pagination\n",
"pd.set_option('display.notebook_repr_html', True)\n",
"pd.set_option('display.max_rows', 10) # Number of rows per page"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Resolution : 23\n",
"\n"
],
"text/plain": [
"Resolution : \u001b[1;36m23\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"NOTE: DUPLICATES 100/3034 in bars. REMOVING.\n", "\n" ], "text/plain": [ "NOTE: DUPLICATES \u001b[1;36m100\u001b[0m/\u001b[1;36m3034\u001b[0m in bars. REMOVING.\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Now there are 0/2934\n", "\n" ], "text/plain": [ "Now there are \u001b[1;36m0\u001b[0m/\u001b[1;36m2934\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "
| \n", " | Open | \n", "High | \n", "Low | \n", "Close | \n", "Volume | \n", "Vwap | \n", "updated | \n", "Rsi14 | \n", "
|---|---|---|---|---|---|---|---|---|
| time | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
| 2024-03-11 09:30:00-04:00 | \n", "35.3900 | \n", "35.440 | \n", "35.2800 | \n", "35.380 | \n", "473759 | \n", "35.425685 | \n", "2024-03-11 09:30:23.673966885-04:00 | \n", "0.0000 | \n", "
| 2024-03-11 09:30:23-04:00 | \n", "35.3900 | \n", "35.490 | \n", "35.3895 | \n", "35.475 | \n", "14119 | \n", "35.447393 | \n", "2024-03-11 09:30:46.228593111-04:00 | \n", "0.0000 | \n", "
| 2024-03-11 09:30:46-04:00 | \n", "35.4750 | \n", "35.480 | \n", "35.4200 | \n", "35.460 | \n", "22169 | \n", "35.448066 | \n", "2024-03-11 09:31:09.993794918-04:00 | \n", "0.0000 | \n", "
| 2024-03-11 09:31:09-04:00 | \n", "35.4579 | \n", "35.540 | \n", "35.4400 | \n", "35.535 | \n", "29984 | \n", "35.490282 | \n", "2024-03-11 09:31:32.450469017-04:00 | \n", "0.0000 | \n", "
| 2024-03-11 09:31:32-04:00 | \n", "35.5350 | \n", "35.595 | \n", "35.5100 | \n", "35.590 | \n", "20348 | \n", "35.560566 | \n", "2024-03-11 09:31:55.688961983-04:00 | \n", "0.0000 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 2024-03-13 15:58:19-04:00 | \n", "36.1450 | \n", "36.155 | \n", "36.1300 | \n", "36.145 | \n", "120386 | \n", "36.142679 | \n", "2024-03-13 15:58:42.028856993-04:00 | \n", "59.6001 | \n", "
| 2024-03-13 15:58:42-04:00 | \n", "36.1500 | \n", "36.150 | \n", "36.1300 | \n", "36.130 | \n", "139068 | \n", "36.139540 | \n", "2024-03-13 15:59:05.012445927-04:00 | \n", "58.2072 | \n", "
| 2024-03-13 15:59:05-04:00 | \n", "36.1300 | \n", "36.140 | \n", "36.0900 | \n", "36.090 | \n", "545827 | \n", "36.118307 | \n", "2024-03-13 15:59:28.043910027-04:00 | \n", "49.7763 | \n", "
| 2024-03-13 15:59:28-04:00 | \n", "36.0950 | \n", "36.110 | \n", "36.0500 | \n", "36.080 | \n", "734354 | \n", "36.072968 | \n", "2024-03-13 15:59:51.012413979-04:00 | \n", "37.3871 | \n", "
| 2024-03-13 15:59:51-04:00 | \n", "36.0800 | \n", "36.100 | \n", "36.0650 | \n", "36.070 | \n", "321567 | \n", "36.074857 | \n", "2024-03-13 15:59:59.987827063-04:00 | \n", "37.3871 | \n", "
2934 rows × 8 columns
\n", "