From 005b49793e1273059b3557d019aa4ba4d5fa90ef Mon Sep 17 00:00:00 2001 From: "ap550083@gmail.com" Date: Fri, 19 Jul 2024 18:41:27 +0530 Subject: [PATCH] Dynamic Hedging Strategies using Reinforcement Learning added --- ..._Hedging_StrategiesReinforcementLear.ipynb | 1122 +++++++++++++++++ .../dqn_agent.h5 | Bin 0 -> 41232 bytes .../readme.md | 23 + .../requirement.txt | 12 + 4 files changed, 1157 insertions(+) create mode 100644 Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/Dynamic_Hedging_StrategiesReinforcementLear.ipynb create mode 100644 Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/dqn_agent.h5 create mode 100644 Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/readme.md create mode 100644 Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/requirement.txt diff --git a/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/Dynamic_Hedging_StrategiesReinforcementLear.ipynb b/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/Dynamic_Hedging_StrategiesReinforcementLear.ipynb new file mode 100644 index 00000000..bb229aba --- /dev/null +++ b/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/Dynamic_Hedging_StrategiesReinforcementLear.ipynb @@ -0,0 +1,1122 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "id": "okgB-pZMZ5vH" + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "id": "lQMYLRlFY7e_" + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "data=pd.read_csv(\"/content/HistoricalData_1719635817381 .csv\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "yAxlj88ZoT9r" + }, + "source": [ + "**Preprocessing the data**" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "GNvzBTbgZ6tz", + "outputId": "a939d7b3-2744-4465-fc03-bd3d0cb36071" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Index(['Date', 'Close/Last', 'Open', 'High', 'Low'], dtype='object')\n", + " Date Close/Last Open High Low Daily Return\n", + "1 2024-06-27 0.983463 0.897188 0.875375 0.986483 0.099511\n", + "2 2024-06-26 0.963705 0.847029 0.846259 0.930446 -0.020090\n", + "3 2024-06-25 0.929517 0.847106 0.807311 0.911458 -0.035476\n", + "4 2024-06-24 0.844325 0.842628 0.874805 0.915141 -0.091652\n", + "5 2024-06-21 0.910912 0.870629 0.827924 0.931018 0.078864\n", + "Index(['Date', 'Close/Last', 'Open', 'High', 'Low', 'Daily Return'], dtype='object')\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "from sklearn.preprocessing import MinMaxScaler\n", + "\n", + "# Convert the 'Date' column to datetime format\n", + "data['Date'] = pd.to_datetime(data['Date'], format='%m/%d/%Y')\n", + "\n", + "# Check column names\n", + "print(data.columns)\n", + "\n", + "# Initialize the scaler\n", + "scaler = MinMaxScaler()\n", + "\n", + "# Normalize the price columns\n", + "data[['Close/Last', 'Open', 'High', 'Low']] = scaler.fit_transform(data[['Close/Last', 'Open', 'High', 'Low']])\n", + "\n", + "# Create a column for daily returns\n", + "data['Daily Return'] = data['Close/Last'].pct_change()\n", + "\n", + "# Drop the first row with NaN value in 'Daily Return'\n", + "data = data.dropna()\n", + "\n", + "# Verify 'Daily Return' column is created\n", + "print(data.head())\n", + "print(data.columns)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "GOlb7u9qoghx" + }, + "source": [ + "**Define the Environment**" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ZLWxYZ4-jqgE", + "outputId": "17232637-d854-4b74-a72f-d2817de04b23" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0.9834625322997432 0.8971882545369603 0.8753748623922881\n", + " 0.9864826205120885 0.09951111111111066]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "import gym\n", + "from gym import spaces\n", + "\n", + "class HedgingEnv(gym.Env):\n", + " def __init__(self, data):\n", + " super(HedgingEnv, self).__init__()\n", + " self.data = data\n", + " self.current_step = 0\n", + "\n", + " # State space: normalized prices and daily returns\n", + " self.observation_space = spaces.Box(\n", + " low=-np.inf, high=np.inf, shape=(5,), dtype=np.float32\n", + " )\n", + "\n", + " # Action space: increase, decrease, or maintain hedge ratio\n", + " self.action_space = spaces.Discrete(3)\n", + "\n", + " # Initial hedge ratio\n", + " self.hedge_ratio = 0.5\n", + "\n", + " def reset(self):\n", + " self.current_step = 0\n", + " self.hedge_ratio = 0.5\n", + " return self._next_observation()\n", + "\n", + " def _next_observation(self):\n", + " obs = self.data.iloc[self.current_step][['Close/Last', 'Open', 'High', 'Low', 'Daily Return']].values\n", + " return obs\n", + "\n", + " def step(self, action):\n", + " self.current_step += 1\n", + "\n", + " if self.current_step >= len(self.data) - 1:\n", + " done = True\n", + " else:\n", + " done = False\n", + "\n", + " # Update hedge ratio based on action\n", + " if action == 0:\n", + " self.hedge_ratio -= 0.1\n", + " elif action == 1:\n", + " self.hedge_ratio += 0.1\n", + " self.hedge_ratio = np.clip(self.hedge_ratio, 0, 1)\n", + "\n", + " # Calculate reward (simplified example)\n", + " reward = -abs(self.data.iloc[self.current_step]['Daily Return'] - self.hedge_ratio)\n", + "\n", + " return self._next_observation(), reward, done, {}\n", + "\n", + " def render(self, mode='human'):\n", + " pass\n", + "\n", + "# Example usage\n", + "env = HedgingEnv(data)\n", + "initial_observation = env.reset()\n", + "print(initial_observation)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Wy8HuOTdqBAs", + "outputId": "beeca121-241c-4f17-aa7c-a651c5b085d0" + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "import gym\n", + "from gym import spaces\n", + "from collections import deque\n", + "import random\n", + "import tensorflow as tf\n", + "from tensorflow.keras.models import Sequential\n", + "from tensorflow.keras.layers import Dense\n", + "from tensorflow.keras.optimizers import Adam\n", + "\n", + "class DQNAgent:\n", + " def __init__(self, state_size, action_size):\n", + " self.state_size = state_size\n", + " self.action_size = action_size\n", + " self.memory = deque(maxlen=2000)\n", + " self.gamma = 0.95 # discount rate\n", + " self.epsilon = 1.0 # exploration rate\n", + " self.epsilon_min = 0.01\n", + " self.epsilon_decay = 0.995\n", + " self.learning_rate = 0.001\n", + " self.model = self._build_model()\n", + "\n", + " def _build_model(self):\n", + " # Neural Net for Deep Q-learning Model\n", + " model = Sequential()\n", + " model.add(Dense(24, input_dim=self.state_size, activation='relu'))\n", + " model.add(Dense(24, activation='relu'))\n", + " model.add(Dense(self.action_size, activation='linear'))\n", + " model.compile(loss='mse',\n", + " optimizer=Adam(learning_rate=self.learning_rate))\n", + " return model\n", + "\n", + " def remember(self, state, action, reward, next_state, done):\n", + " self.memory.append((state, action, reward, next_state, done))\n", + "\n", + " def act(self, state):\n", + " if np.random.rand() <= self.epsilon:\n", + " return random.randrange(self.action_size)\n", + " act_values = self.model.predict(state)\n", + " return np.argmax(act_values[0])\n", + "\n", + " def replay(self, batch_size):\n", + " minibatch = random.sample(self.memory, batch_size)\n", + " for state, action, reward, next_state, done in minibatch:\n", + " target = reward\n", + " if not done:\n", + " target = (reward + self.gamma *\n", + " np.amax(self.model.predict(next_state)[0]))\n", + " target_f = self.model.predict(state)\n", + " target_f[0][action] = target\n", + " self.model.fit(state, target_f, epochs=1, verbose=0)\n", + " if self.epsilon > self.epsilon_min:\n", + " self.epsilon *= self.epsilon_decay\n", + "\n", + "# Initialize the environment and the agent\n", + "state_size = 5\n", + "action_size = 3\n", + "agent = DQNAgent(state_size, action_size)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "AQoKYI0SonyI" + }, + "source": [ + "Train the DQN **Agent**" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "FvQgpcsxk2q6", + "outputId": "4d0c2e3b-5bc2-41e5-de6a-09e861cef77b" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1/1 [==============================] - 0s 84ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 42ms/step\n", + "1/1 [==============================] - 0s 43ms/step\n", + "1/1 [==============================] - 0s 32ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 45ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 45ms/step\n", + "1/1 [==============================] - 0s 42ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 31ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 41ms/step\n", + "1/1 [==============================] - 0s 42ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 32ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 59ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 31ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "episode: 0/2, score: 19, e: 0.96\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 31ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 41ms/step\n", + "1/1 [==============================] - 0s 41ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 44ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 41ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 44ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 20ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 41ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 45ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 46ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 44ms/step\n", + "1/1 [==============================] - 0s 42ms/step\n", + "1/1 [==============================] - 0s 43ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 41ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 43ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 41ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 42ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 31ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 43ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 45ms/step\n", + "1/1 [==============================] - 0s 41ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 46ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 31ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 31ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 21ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 43ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 33ms/step\n", + "1/1 [==============================] - 0s 40ms/step\n", + "1/1 [==============================] - 0s 43ms/step\n", + "1/1 [==============================] - 0s 44ms/step\n", + "1/1 [==============================] - 0s 45ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 32ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 28ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 31ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 30ms/step\n", + "1/1 [==============================] - 0s 29ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 23ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 31ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 39ms/step\n", + "1/1 [==============================] - 0s 24ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 22ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 25ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 26ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 27ms/step\n", + "1/1 [==============================] - 0s 42ms/step\n", + "1/1 [==============================] - 0s 51ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 35ms/step\n", + "1/1 [==============================] - 0s 34ms/step\n", + "1/1 [==============================] - 0s 51ms/step\n", + "1/1 [==============================] - 0s 38ms/step\n", + "1/1 [==============================] - 0s 36ms/step\n", + "episode: 1/2, score: 19, e: 0.87\n" + ] + } + ], + "source": [ + "env = HedgingEnv(data)\n", + "done = False\n", + "batch_size = 10\n", + "EPISODES = 2\n", + "\n", + "for e in range(EPISODES):\n", + " state = env.reset()\n", + " state = np.reshape(state, [1, state_size]).astype(np.float32) # Ensure the correct data type\n", + " for time in range(500):\n", + " action = agent.act(state)\n", + " next_state, reward, done, _ = env.step(action)\n", + " reward = reward if not done else -10\n", + " next_state = np.reshape(next_state, [1, state_size]).astype(np.float32) # Ensure the correct data type\n", + " agent.remember(state, action, reward, next_state, done)\n", + " state = next_state\n", + " if done:\n", + " print(f\"episode: {e}/{EPISODES}, score: {time}, e: {agent.epsilon:.2}\")\n", + " break\n", + " if len(agent.memory) > batch_size:\n", + " agent.replay(batch_size)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "nIQ9pIgcpEoe" + }, + "source": [ + "**Evaluate Agent**" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 527 + }, + "id": "lwmM62mQnfC3", + "outputId": "ee5fa4e7-f070-421a-a0e4-5720baec641e" + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAksAAAHHCAYAAACvJxw8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABGwklEQVR4nO3deVxWZf7/8ffNvsjiAq64AE5oWprmjqJZWqlZWaa5zRiW2uZSaqW4lFtmNY5pZWGLZbbYmFtSZlnqjJNLaUKRogaCqAWuqHD9/ujH/e0OON63gnDb6/l43I/xnHOdc3/OBXS/55zrXLfNGGMEAACAYnmUdwEAAAAVGWEJAADAAmEJAADAAmEJAADAAmEJAADAAmEJAADAAmEJAADAAmEJAADAAmEJAADAAmEJAC6TIUOGqH79+qV6zMWLF8tmsyktLa1Uj4vf2Ww2TZ48ubzLQDkjLAEXUPhhVPjy8/NTrVq11K1bN/3zn//U8ePHS9z3m2++0e23367q1avL19dX9evX1wMPPKCDBw8WaTt58mTZbDZVr15dp06dKrK9fv366tGjh0u1t2rVSjabTQsWLHBpv8shIyNDkydP1o4dO1za7+eff9b999+vyMhI+fn5KTg4WO3bt9eLL76o06dPl02xFcD06dP18ccfl3cZdn/+u/Dy8lLt2rU1ZMgQpaenl3d5QKkiLAFOmjp1qt566y0tWLBADz30kCTp0UcfVdOmTfXdd98VaT9v3jzFxsbq+++/10MPPaSXXnpJffr00dKlS3XNNddoy5Ytxb7P4cOHSyXc/PTTT9q6davq16+vJUuWXPLxSltGRoamTJniUlhatWqVmjZtqmXLlqlnz56aN2+eZsyYobp16+qxxx7TI488UnYFl7OSwtLAgQN1+vRp1atX7/IXpf/7u1i4cKFuvvlmvf322+rUqZPOnDlTLvUAZcGrvAsA3MXNN9+sli1b2pcnTJig9evXq0ePHurVq5f27Nkjf39/Sb9fUXr00UfVoUMHrV27VgEBAfb9hg8frvbt2+vOO+/U7t27FRoa6vA+zZo107PPPqsRI0bYj3cx3n77bYWHh+u5555Tnz59lJaWVuq3gC6nffv26Z577lG9evW0fv161axZ075t5MiRSk1N1apVq8qxwvLh6ekpT0/Pcnv/P/5d3HfffapWrZpmzZqlFStW6O677y63upx18uRJBQYGlncZqOC4sgRcgi5dumjixInav3+/3n77bfv6adOmyWaz6Y033nAISpIUFRWl2bNnKyMjQ6+88kqRY06aNElZWVmXfHXpnXfeUZ8+fdSjRw+FhITonXfeKbbdhg0b1LJlS/n5+SkqKkovv/yy/Zbgn7399ttq0aKF/P39VaVKFd1zzz1FbinGxcWpSZMm+uGHH9S5c2cFBASodu3amj17tsN7Xn/99ZKkv//97/ZbOYsXLy7xfGbPnq0TJ07otddecwhKhaKjo+1XltLS0ko83p/HoBSe648//qgBAwYoJCREYWFhmjhxoowxOnjwoG677TYFBwerRo0aeu655xyOV9KYoQ0bNshms2nDhg0lnpMkzZkzR+3atVPVqlXl7++vFi1a6IMPPihS88mTJ/XGG2/Y+2rIkCHFvn+PHj0UGRlZ7Hu1bdvWIfBLzv1MXREbGyvp99ulf5ScnKw+ffqoSpUq8vPzU8uWLbVixQr79t9++02enp765z//aV935MgReXh4qGrVqjLG2NcPHz5cNWrUsC9v3LhRd911l+rWrStfX19FRERo1KhRRW7LDhkyRJUqVdLPP/+sW265RUFBQbr33nslSXl5eRo1apTCwsIUFBSkXr166ZdffrnofsCVhbAEXKKBAwdKktatWydJOnXqlD7//HPFxsaqQYMGxe7Tt29f+fr66pNPPimyLTY2Vl26dNHs2bMvegzOf/7zH6Wmpqpfv37y8fHRHXfcUeytuO3bt6t79+46evSopkyZoqFDh2rq1KnF3u555plnNGjQIDVs2FBz587Vo48+qs8//1wdO3bUb7/95tD2119/Vffu3XXttdfqueeeU0xMjMaNG6c1a9ZIkho1aqSpU6dKkoYNG6a33npLb731ljp27FjiOX3yySeKjIxUu3btLqpPLqRv374qKCjQzJkz1bp1az399NN64YUXdOONN6p27dqaNWuWoqOjNXbsWH311Vel9r4vvviimjdvrqlTp2r69Ony8vLSXXfd5XCV7K233pKvr69iY2PtfXX//feXeB779u3T1q1bHdbv379fW7Zs0T333GNf58rP1FmFoa1y5cr2dbt371abNm20Z88ejR8/Xs8995wCAwPVu3dvLV++XJIUGhqqJk2aOPTt119/LZvNpmPHjumHH36wr9+4caM9lEnS+++/r1OnTmn48OGaN2+eunXrpnnz5mnQoEFF6jt//ry6deum8PBwzZkzR3feeaek36+KvfDCC7rppps0c+ZMeXt769Zbb72oPsAVyACwlJiYaCSZrVu3ltgmJCTENG/e3BhjzI4dO4wk88gjj1ge95prrjFVqlSxLyckJBhJJjs723z55ZdGkpk7d659e7169cytt97qVM0PPvigiYiIMAUFBcYYY9atW2ckme3btzu069mzpwkICDDp6en2dT/99JPx8vIyf/zPQ1pamvH09DTPPPOMw/7ff/+98fLycljfqVMnI8m8+eab9nV5eXmmRo0a5s4777Sv27p1q5FkEhMTL3g+OTk5RpK57bbbnDl9s2/fvhKPLckkJCTYlwv7fdiwYfZ158+fN3Xq1DE2m83MnDnTvv7XX381/v7+ZvDgwfZ1hb8f+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sQi75OQkCBJ9vcqDEAbN27UyZMntX37dsXGxqpjx472sLRx40YFBwfr2muvtb/HgQMHNGTIEFWpUkWVKlVSWFiYOnXqJElF+tHLy8se5Art379fHh4eioqKclh/1VVXOdUHuPLxNBxwiX755Rfl5OTYA0bDhg3l5eVV7HQChfLy8pSSkqJWrVqV2KZjx46Ki4vT7Nmz9cADDzhdT+HVo5KeRPryyy/VuXNnp48nSQUFBbLZbFqzZk2xT15VqlTJYbmkp7P+eKXDFcHBwapVq5Z27drlVPviBqdLv19NK0lxNTtzHhfzXoU2btyoXr16qWPHjnrppZdUs2ZNeXt7KzExscQB+c7o2bOnAgICtGzZMrVr107Lli2Th4eH7rrrLnsbV3+mJWnVqpV90Hjv3r3VoUMH9e/fXykpKapUqZI9nI8dO1bdunUr9hiFfzu1atVSgwYN9NVXX6l+/foyxqht27YKCwvTI488ov3792vjxo1q166dPDx+///6+fn5uvHGG3Xs2DGNGzdOMTExCgwMVHp6uoYMGWJ//0K+vr72fQFnEZaAS/TWW29Jkv2DICAgQDfccIM+++wz7d+/v9j5b5YtW6a8vDyHD6/iTJ48WXFxcXr55ZedquXkyZP697//rb59+6pPnz5Ftj/88MNasmSJOnfurPDwcPn5+Sk1NbVIuz+vi4qKkjFGDRo00N/+9jenarmQkkJGSXr06KFXXnlFmzdvVtu2bS3bFg4u/vMg5f3797v0ns64lPf68MMP5efnp08//dThakxiYmKRtq70V2BgoHr06KH3339fc+fO1XvvvafY2FiH261l8TP19PTUjBkz1LlzZ/3rX//S+PHj7U/meXt7q2vXrhc8RmxsrL766is1aNBAzZo1U1BQkK699lqFhIRo7dq12rZtm6ZMmWJv//333+vHH3/UG2+84TCgOykpyem669Wrp4KCAv38888OV5MKbwcCxGvgEqxfv17Tpk1TgwYN7I8gS9JTTz0lY4yGDBlSZMzRvn379PjjjysiIsL+JF1JOnXqpLi4OM2aNcupSf6WL1+ukydPauTIkerTp0+RV48ePfThhx8qLy9Pnp6e6tq1qz7++GNlZGTYj5Gammp/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px4oR92RijgoICeXp66pVXXil2WoNJkyZpxYoV2rFjh33dvn37FBkZqW3btql58+ZOnQdjlgAAcD/Ofn67fBsuOTlZgYGBiomJUUxMjBo1anRRQUmSwsLCFBYW5lTb9PR0de7cWS1atFBiYqJDUJJ+H3/0x1uA//73vzVr1ixt2rRJtWvXLvaYbdu21TPPPKPDhw8rPDxckpSUlKTg4GA1btz4os4JAABcWVy+DXf06FGtX79ebdq00aeffqr27durdu3a6t+/v1599dWyqFHp6emKi4tT3bp1NWfOHGVnZyszM9NhXFGjRo3UpEkT+6t27dry8PBQkyZN7GFu+fLliomJse9z0003qXHjxho4cKB27typTz/9VE899ZRGjhzJbOQAAEDSRVxZstlsuuaaa3TNNdfooYce0rfffqt//etfWrJkid577z2HcUSlJSkpSampqUpNTVWdOnUctrlyFzEnJ0cpKSn2ZU9PT61cuVLDhw9X27ZtFRgYqMGDB2vq1KmlVjsAAHBvLo9Z2rZtmzZs2KANGzbo66+/1vHjx9W0aVP7+KXbbrutrGqtsBizBACA+ymzMUutWrVS8+bN1alTJ8XHx6tjx44KCQm5pGIBAAAqKpfD0rFjx7h6AgAA/jJcHuAdHBys3377TYsWLdKECRN07NgxSb/fnktPTy/1AgEAAMqTy1eWvvvuO91www0KDQ1VWlqa4uPjVaVKFX300Uc6cOCA3nzzzbKoEwAAoFy4fGVp9OjR+vvf/66ffvpJfn5+9vW33HKLvvrqq1ItDgAAoLy5HJa2bt2q+++/v8j62rVrW36fGgAAgDtyOSz5+voqNze3yPoff/zR6dm4AQAA3IXLYalXr16aOnWqzp07J+n3SSoPHDigcePG6c477yz1AgEAAMqTy2Hpueee04kTJxQeHq7Tp0+rU6dOio6OVqVKlfTMM8+URY0AAADlxuWn4UJCQpSUlKSvv/5a3333nU6cOKHrrrtOXbt2LYv6AAAAypXLX3dSkm3btmnSpElauXJlaRzOrfB1JwAAuB9nP79dug336aefauzYsXriiSe0d+9eSVJycrJ69+6t66+/XgUFBZdWNQAAQAXj9G241157zT4B5a+//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GuvvbYs6gEAAKhQXB6zFBMTo9OnT5dFLQAAABWOy2Fp5syZGjNmjDZs2KCjR48qNzfX4QUAAHAlsRljjCs7eHj8nq/+PFbJGCObzab8/PzSq85NOPutxQAAoOJw9vPb5TFLX3zxxSUVBgAA4E5cDkudOnUqizoAAAAqJJfD0ldffWW5vWPHjhddDAAAQEXjcliKi4srsu6P45f+imOWAADAlcvlp+F+/fVXh9fhw4e1du1aXX/99Vq3bl1Z1AgAAFBuXL6yFBISUmTdjTfeKB8fH40ePVrffvttqRQGAABQEbh8Zakk1atXV0pKSmkdDgAAoEJw+crSd99957BsjNGhQ4c0c+ZMNWvWrLTqAgAAqBBcDkvNmjWTzWbTn+eybNOmjV5//fVSKwwAAKAicDks7du3z2HZw8NDYWFh8vPzK7WiAAAAKgqXw1K9evXKog4AAIAKyekB3uvXr1fjxo2L/bLcnJwcXX311dq4cWOpFgcAAFDenA5LL7zwguLj44v9ormQkBDdf//9mjt3bqkWBwAAUN6cDks7d+5U9+7dS9x+0003MccSAAC44jgdlrKysuTt7V3idi8vL2VnZ5dKUQAAABWF02Gpdu3a2rVrV4nbv/vuO9WsWbNUigIAAKgonA5Lt9xyiyZOnKgzZ84U2Xb69GklJCSoR48epVocAABAebOZP88uWYKsrCxdd9118vT01IMPPqirrrpKkpScnKz58+crPz9f27ZtU/Xq1cu04IooNzdXISEhysnJKXYAPAAAqHic/fx2ep6l6tWra9OmTRo+fLgmTJhgn8HbZrOpW7dumj9//l8yKAEAgCubS5NS1qtXT6tXr9avv/6q1NRUGWPUsGFDVa5cuazqAwAAKFcuz+AtSZUrV9b1119f2rUAAABUOE4P8AYAAPgrIiwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYICwBAABYcIuwlJaWpqFDh6pBgwby9/dXVFSUEhISdPbsWYc2NputyGvLli2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AACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACwQlgAAACy4RVhKS0vT0KFD1aBBA/n7+ysqKkoJCQk6e/asQxubzVbktWXLFstjF7fP0qVLy/qUAACAm/Aq7wKckZycrIKCAr388suKjo7Wrl27FB8fr5MnT2rOnDkObT/77DNdffXV9uWqVate8PiJiYnq3r27fTk0NLTUagcAAO7NLcJS9+7dHcJMZGSkUlJStGDBgiJhqWrVqqpRo4ZLxw8NDXV5HwAA8NfgFrfhipOTk6MqVaoUWd+rVy+Fh4erQ4cOWrFihVPHGjlypKpVq6ZWrVrp9ddflzGmtMsFAABuyi2uLP1Zamqq5s2b53BVqVKlSnruuefUvn17eXh46MMPP1Tv3r318ccfq1evXiUea+rUqerSpYsCAgK0bt06jRgxQidOnNDDDz9c4j55eXnKy8uzL+fm5pbOiQEAgArHZsrxMsr48eM1a9YsyzZ79uxRTEyMfTk9PV2dOnVSXFycFi1aZLnvoEGDtG/fPm3cuNHpmiZNmqTExEQdPHiwxDaTJ0/WlClTiqzPyclRcHCw0+8FAADKT25urkJCQi74+V2uYSk7O1tHjx61bBMZGSkfHx9JUkZGhuLi4tSmTRstXrxYHh7WdxHnz5+vp59+WocOHXK6plWrVqlHjx46c+aMfH19i21T3JWliIgIwhIAAG7E2bBUrrfhwsLCFBYW5lTb9PR0de7cWS1atFBiYuIFg5Ik7dixQzVr1nSpph07dqhy5colBiVJ8vX1td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BAfr000/1yCOP6Prrr1dAQIDuvPNOzZ07177/mDFjdOjQIQ0ePFgeHh76xz/+odtvv105OTn2NtOmTVNYWJhmzJihvXv3KjQ0VNddd52eeOKJ0u4aAKXEZsyfJgEBgCuEzWbT8uXL+boRAJeEMUsAAAAWCEsAAAAWGLME4IrFKAMApYErSwAAABYISwAAABYISwAAABYISwAAABYISwAAABYISwAAABYISwAAABYISwAAABYISwAAABb+H44e8Z8JwvEwAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "\n", + "import matplotlib.pyplot as plt\n", + "\n", + "# Plot the cumulative reward for each episode\n", + "episodes = range(EPISODES)\n", + "rewards = [0] * EPISODES\n", + "for i in range(EPISODES):\n", + " rewards[i] = sum([reward for _, _, reward, _, _ in agent.memory if reward != -10])\n", + "\n", + "plt.plot(episodes, rewards)\n", + "plt.xlabel('Episode')\n", + "plt.ylabel('Cumulative Reward')\n", + "plt.title('DQN Agent Cumulative Reward')\n", + "plt.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 472 + }, + "id": "IRN2dYAKniV_", + "outputId": "41d121ef-75e3-4e0f-d8bb-134e25f025ff" + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAHHCAYAAABXx+fLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAv1klEQVR4nO3de1hVVf7H8c8B5aIBmgKikXjLu6KSBOpoRZEWXcZJS1Oki2OaU+pMgylimqJdiEZNs/KSlzRLy0nTlPLXmKYF2k3UDG+ZeCkF00Dl7N8fPZ7pBDpwBA643q/n2c/jWWftfb57jXk+s/baZ9ssy7IEAABgEA93FwAAAFDRCEAAAMA4BCAA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mjAgAGlPSXAOPxfBACX5d1339WhQ4ccr7du3aotW7aoZ8+ekqQzZ84oPz/faZ8mTZrIz89PBQUFJf6ckJAQhYeHa/78+U5B4JtvvtGHH36oXr16Xd6JlNCUKVP04Ycfqm/fvo7Lf7GxsfL399fkyZN17ty5IvscO3ZMkhQYGKg//elPmjNnjg4cOODU5/ezUp6enkVmqaZNm6bCwsIix65WrZruv/9+vfXWW5o3b57atm2rdu3aXfZ5Alc6ZoAAFOuDDz7Qzp07i7RHR0c7ZjKk3y4Dde3aVY8++qgKCgqUlpamOnXq6Mknn5T022zQzTffrD59+qhVq1aqVq2aVqxYoSNHjui+++4rVU3PPfecevbsqaioKD300EOO2+ADAgI0fvz4yzrfPzp//rxjdio/P1/79+/XypUr9dVXX+nGG2/U7NmzHX39/f01c+ZMDRgwQB07dtR9992nwMBAHThwQKtWrVKXLl00ffp0SdK//vUvde3aVR07dtTgwYPVqFEj7du3T6tWrdL27dslSXfccYcWLFiggIAAtWrVSps3b9b69euL/ATBBQMHDtS//vUvffzxx5d9iz9gCgIQgGKNGzeu2Pa5c+c6BaCBAwfKw8NDaWlpOnr0qDp37qzp06crJCREkhQaGqr7779f6enpWrBggapVq6YWLVrorbfeUu/evUtVU0xMjNasWaPk5GSNGzdO1atXV/fu3TV16tRiH9txOQoKChyXkmrUqKGgoCB16tRJ48aN0z333FNkjU2/fv1Uv359TZkyRc8995wKCgrUoEEDdevWTQkJCY5+7du312effaakpCTNnDlT+fn5atiwofr06ePo89JLL8nT01OLFi1Sfn6+unTpovXr1ys2NrbYWjt16qTWrVsrKytL/fv3L9NxAK5UNutyVwMCMNK+ffvUqFEjPffcc/r73//u7nKM16FDB1199dVKT093dylAlcAaIACo4r744gtt375dAwcOdHcpQJXBJTAAqKK++eYbZWRk6IUXXlBISIj69u3r7pKAKoMZIACoot5++20lJCTo3LlzevPNN+Xj4+PukoAqgzVAAADAOMwAAQAA4xCAAACAcVgEXQy73a4ff/xRfn5+Tk9oBgAAlZdlWTp16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AQbdmyxfH++fPnlZGR4XjdqlUreXt768CBA2ratKnTFhoaWlanDKAcMAMEoFIpKChQTk6OU1u1atUci5eXLVumiIgIde3aVYsWLdLWrVv1+uuvF3uscePGqVOnTmrdurUKCgr0/vvvO8JS//79lZycrPj4eI0fP17Hjh3T8OHDNWDAAAUHB0uSHn/8cU2ZMkXNmjVTixYtlJqaqpMnTzqO7+fnp7///e8aMWKE7Ha7unbtqtzcXH366afy9/dXfHx8OYwQgLJAAAJQqaxZs0YhISFObc2bN9fOnTslSU8//bSWLFmioUOHKiQkRG+++aZatWpV7LG8vLw0evRo7du3T76+vurWrZuWLFkiSapRo4bWrl2rxx9/XNdff71q1Kih3r17KzU11bH/qFGjdPjwYcXHx8vDw0MPPvig7rnnHuXm5jr6TJw4UYGBgUpJSVF2drZq1aqljh076qmnnirroQFQhmyW9YcftQCASspms2nFihU8igLAZWMNEAAAMA4BCAAAGIc1QACqDK7YAygrzAABAADjEIAAAIBxCEAAAMA4BCAAAGAcAhAAADAOAQgAABiHAAQAAIxDAAIAAMYhAAEAAOP8P/2OQNDRSx2SAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Plot the epsilon decay over episodes\n", + "plt.plot(episodes, [agent.epsilon for i in range(EPISODES)])\n", + "plt.xlabel('Episode')\n", + "plt.ylabel('Epsilon')\n", + "plt.title('Epsilon Decay')\n", + "plt.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "5PNJWRBmnlBt", + "outputId": "7abb130f-3299-4ef8-e67c-e857fc16aacf" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1/1 [==============================] - 0s 36ms/step\n", + "1/1 [==============================] - 0s 37ms/step\n" + ] + } + ], + "source": [ + "# Evaluate the agent\n", + "state = env.reset()\n", + "state = np.reshape(state, [1, state_size]).astype(np.float32)\n", + "for time in range(200):\n", + " action = agent.act(state)\n", + " next_state, reward, done, _ = env.step(action)\n", + " next_state = np.reshape(next_state, [1, state_size]).astype(np.float32)\n", + " state = next_state\n", + " if done:\n", + " break\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Ffmk3EcXpLzL" + }, + "source": [ + "**Saving the model**" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "z_2HH4SRlhXY", + "outputId": "01aa3b0d-8262-45a0-f821-2895e1a97833" + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n", + "/usr/local/lib/python3.10/dist-packages/keras/src/engine/training.py:3103: UserWarning: You are saving your model as an HDF5 file via `model.save()`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')`.\n", + " saving_api.save_model(\n" + ] + } + ], + "source": [ + "# prompt: after doing the evaluation of agent what can we do here\n", + "\n", + "# Save the model\n", + "agent.model.save('dqn_agent.h5')\n", + "\n", + "# Load the model\n", + "agent.model.load_weights('dqn_agent.h5')\n", + "\n", + "# Use the model to make predictions on new data\n", + "new_state = env.reset()\n", + "new_state = np.reshape(new_state, [1, state_size]).astype(np.float32)\n", + "action = agent.act(new_state)\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "0ipH2zFcpU3c" + }, + "source": [ + "**Testing the Model**" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7NesUUCNjwsG", + "outputId": "d57bd4f7-c2eb-4102-c9d9-87a981e00aad" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Predicted action: 0\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], + "source": [ + "\n", + "import numpy as np\n", + "\n", + "# Load the trained model\n", + "agent.model.load_weights('dqn_agent.h5')\n", + "\n", + "# Create a new state\n", + "new_state = np.array([0.5, 0.6, 0.7, 0.8, 0.9])\n", + "\n", + "# Reshape the state to match the model input\n", + "new_state = np.reshape(new_state, [1, state_size]).astype(np.float32)\n", + "\n", + "# Predict the action using the loaded model\n", + "action = agent.act(new_state)\n", + "\n", + "# Print the predicted action\n", + "print(\"Predicted action:\", action)\n" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/dqn_agent.h5 b/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/dqn_agent.h5 new file mode 100644 index 0000000000000000000000000000000000000000..2d7539b7c74926ac4c986d38110dd443e28cd4c8 GIT binary patch literal 41232 zcmeHw30zIv_xNp~q$rXyrj%spcIR{MJ-ZB%DW0hb6zWwxc+URh| zOIw?x$?9V6W($AqwSeUK%WHM?@n!u#F>U2hp)0jin88hYj41H4#x?mX7aO7|Y z2aW=hrO&2JGbI6*j54 z(E6AV95m6-hwQ*a!3@b$eSD47QdBbZ$SL}no<2n{Jk-lC$S=spgCY4XdY4Jz8G4$E zY<>QKOZKa{(&>crEq{>Ojz%hm96A*+sgM&M z9O4lmpQ7*;bv*{_7fe5ssFP#YFGmx)xPYnEt8fVZL4=BwhEQh=73ZroyoblHTFds4_DJ+g{;(9@#uB#49w6M4adq5GGd?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z*Ws%Wq`8SmO}~cMy>h&y@5)l?$R)U>W<-IwyvRt_)U*fH#w)*{>|t*Mw4<>b`fh`Z z2zmVp@jpfX?XC4sqfuYe=8}Ry14>qd%{<|R)zc73$!X#K2W5y?jiy+0>s)?OD1to7 zYlS{LGY^Sgw^8DEYBKs#gZ7su4^q(&%L0*%-Z-jxy^~n4Z#c5lIsxgyjX^iv>M9eM z?2;N-#8JF7-`Y&zrEVx)HSz>%VCaT4ZD-8;pz(+8=`Jop9i&3)f545hYf+`S?1HY0 zYUAYUBI}o?gLZI!LFwx#|1C0BxSy(j*P z14YIocH3^=uu-!3lnv5poGns)qqW4$Z5cxB-A0X>Nz*Fi*CVBp;ZFMK)OF89nITCM zWYt2duJ(NRZ_GDt?}Eg5@x>j-ji%%o)oTw=&pS}!(0QQk5vjQ(`eqYhtfL9<+5Vy8 zw-v3C+bP#XAJZK~7N)*PE1eXo&E5}l5X1Z{;>af2$Sr4%prDb3B**mD->#o8&t+EB z5UAciXTN)9%nT3v#>V_Dj2>S1dN}`gz@=HS_)J dS0VGhi>``_6I9?I3;uKZh@MPK`tR1q{{wCsn<@YR literal 0 HcmV?d00001 diff --git a/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/readme.md b/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/readme.md new file mode 100644 index 00000000..6db05e3a --- /dev/null +++ b/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/readme.md @@ -0,0 +1,23 @@ +# Reinforcement Learning Model for Dynamic Hedging Strategies + +## Project Description- + +This project involves implementing a reinforcement learning (RL) model to develop dynamic hedging strategies for financial derivatives. The objective is to create an adaptive hedging strategy that optimizes the portfolio performance by dynamically adjusting positions based on market conditions. + +## Key Objectives- + +1. Data Collection and Preprocessing: Gather historical market data and preprocess it for analysis. +2. Environment Setup: Create a financial environment that simulates the market for training the RL model. +3. Model Development: Develop and train the RL model using stable-baselines3. +4. Evaluation and Validation: Evaluate the model's performance and validate its effectiveness. + +## Project Structure + +- `data/`: Contains historical market data used for training and testing. +- `notebooks/`: Jupyter notebooks for data analysis, model development, and evaluation. +- `src/`: Source code for data preprocessing, environment setup, and model implementation. +- `models/`: Saved RL models. +- `results/`: Evaluation results and visualizations. +- `README.md`: Project overview and instructions. +- `requirements.txt`: List of dependencies. + diff --git a/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/requirement.txt b/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/requirement.txt new file mode 100644 index 00000000..ea92a31b --- /dev/null +++ b/Finacial Domain/Dynamic Hedging Strategies using Reinforcement Learning/requirement.txt @@ -0,0 +1,12 @@ +### Dependencies to install before implementation +numpy +pandas +matplotlib +seaborn +scikit-learn +stable-baselines3[extra] +gym +tensorflow +torch +plotly +