diff --git a/quants_lab/research_notebooks/supertrend_multitimeframe/01_strategy_design_supertrend_multitimeframe.ipynb b/quants_lab/research_notebooks/supertrend_multitimeframe/01_strategy_design_supertrend_multitimeframe.ipynb index 7841ab9..605a18f 100644 --- a/quants_lab/research_notebooks/supertrend_multitimeframe/01_strategy_design_supertrend_multitimeframe.ipynb +++ b/quants_lab/research_notebooks/supertrend_multitimeframe/01_strategy_design_supertrend_multitimeframe.ipynb @@ -11,7 +11,39 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 25, + "outputs": [], + "source": [ + "import sys\n", + "import os\n", + "\n", + "root_path = os.path.abspath(os.path.join(os.getcwd(), '../../..'))\n", + "sys.path.append(root_path)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-12-12T23:32:30.950209Z", + "start_time": "2023-12-12T23:32:30.930263Z" + } + } + }, + { + "cell_type": "code", + "execution_count": 17, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-12-12T23:32:13.047434Z", + "start_time": "2023-12-12T23:32:13.042314Z" + } + } + }, + { + "cell_type": "code", + "execution_count": 27, "outputs": [], "source": [ "from typing import Optional, Callable\n", @@ -23,7 +55,7 @@ "\n", "def get_market_data_dfs(trading_pair: str, intervals: list, base_path: Optional[str] = None):\n", " if base_path is None:\n", - " base_path = \"/Users/dardonacci/Documents/work/dashboard/data/candles/\"\n", + " base_path = f\"{root_path}/data/candles/\"\n", " market_data = {}\n", " for file_path in glob.glob(f\"{base_path}*.csv\"):\n", " tp = file_path.split(\"_\")[-2]\n", @@ -70,14 +102,14 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-12-11T22:49:11.468119Z", - "start_time": "2023-12-11T22:49:11.445037Z" + "end_time": "2023-12-12T23:33:11.159384Z", + "start_time": "2023-12-12T23:33:11.154356Z" } } }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 28, "outputs": [], "source": [ "trading_pair = \"WLD-USDT\"\n", @@ -88,21 +120,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-12-11T22:49:12.635737Z", - "start_time": "2023-12-11T22:49:12.554125Z" + "end_time": "2023-12-12T23:33:11.527517Z", + "start_time": "2023-12-12T23:33:11.489614Z" } } }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 29, "outputs": [ { "data": { "text/plain": " date date_1h\n0 2023-09-12 22:00:00 2023-09-12 22:00:00\n1 2023-09-12 22:03:00 2023-09-12 22:00:00\n2 2023-09-12 22:06:00 2023-09-12 22:00:00\n3 2023-09-12 22:09:00 2023-09-12 22:00:00\n4 2023-09-12 22:12:00 2023-09-12 22:00:00", "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
datedate_1h
02023-09-12 22:00:002023-09-12 22:00:00
12023-09-12 22:03:002023-09-12 22:00:00
22023-09-12 22:06:002023-09-12 22:00:00
32023-09-12 22:09:002023-09-12 22:00:00
42023-09-12 22:12:002023-09-12 22:00:00
\n
" }, - "execution_count": 4, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -113,14 +145,14 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-12-11T22:49:13.670013Z", - "start_time": "2023-12-11T22:49:13.639838Z" + "end_time": "2023-12-12T23:33:11.813341Z", + "start_time": "2023-12-12T23:33:11.807231Z" } } }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 24, "outputs": [], "source": [ "def add_indicators(df, length=50, multiplier=3):\n", @@ -130,8 +162,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-12-11T22:49:14.566166Z", - "start_time": "2023-12-11T22:49:14.562194Z" + "end_time": "2023-12-12T23:32:25.137032Z", + "start_time": "2023-12-12T23:32:25.131080Z" } } },