{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# First Steps with the OANDA API"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Install API"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<pre>\n",
    "conda install ujson\n",
    "pip install v20\n",
    "conda install git pip\n",
    "pip install --upgrade git+https://github.com/yhilpisch/tpqoa.git\n",
    "pip install yfinance\n",
    "</pre>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If it does not work, there are other commands:\n",
    "<pre>\n",
    "conda update anaconda\n",
    "pip install PyYAML\n",
    "pip install git+git://github.com/yhilpisch/tpqoa\n",
    "pip install yfinance --upgrade --no-cache-dir\n",
    "</pre>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Build configuration file"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Go to OANDA Hub and get yout account id, a long number below the account starting with 101-. Then go to Tools, API and get an API access token."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<pre>\n",
    "[oanda]\n",
    "account_id = INSERT HERE\n",
    "access_token = INSERT HERE\n",
    "account_type = practice\n",
    "</pre>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Connecting to the API / Server"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import tpqoa"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "api = tpqoa.tpqoa(\"oandaMY.cfg\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': '101-011-27030320-002',\n",
       " 'alias': 'Paolo',\n",
       " 'currency': 'EUR',\n",
       " 'balance': '98987.5586',\n",
       " 'createdByUserID': 27030320,\n",
       " 'createdTime': '2023-10-03T15:26:25.580818880Z',\n",
       " 'guaranteedStopLossOrderMode': 'ALLOWED',\n",
       " 'pl': '1926.9272',\n",
       " 'resettablePL': '1926.9272',\n",
       " 'resettablePLTime': '0',\n",
       " 'financing': '-2939.3686',\n",
       " 'commission': '0.0',\n",
       " 'guaranteedExecutionFees': '0.0',\n",
       " 'marginRate': '0.03333333333333',\n",
       " 'openTradeCount': 0,\n",
       " 'openPositionCount': 0,\n",
       " 'pendingOrderCount': 0,\n",
       " 'hedgingEnabled': False,\n",
       " 'unrealizedPL': '0.0',\n",
       " 'NAV': '98987.5586',\n",
       " 'marginUsed': '0.0',\n",
       " 'marginAvailable': '98987.5586',\n",
       " 'positionValue': '0.0',\n",
       " 'marginCloseoutUnrealizedPL': '0.0',\n",
       " 'marginCloseoutNAV': '98987.5586',\n",
       " 'marginCloseoutMarginUsed': '0.0',\n",
       " 'marginCloseoutPercent': '0.0',\n",
       " 'marginCloseoutPositionValue': '0.0',\n",
       " 'withdrawalLimit': '98987.5586',\n",
       " 'marginCallMarginUsed': '0.0',\n",
       " 'marginCallPercent': '0.0',\n",
       " 'lastTransactionID': '570'}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_account_summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'practice'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.account_type"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'101-011-27030320-002'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.account_id"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('AUD/CAD', 'AUD_CAD'),\n",
       " ('AUD/CHF', 'AUD_CHF'),\n",
       " ('AUD/HKD', 'AUD_HKD'),\n",
       " ('AUD/JPY', 'AUD_JPY'),\n",
       " ('AUD/NZD', 'AUD_NZD'),\n",
       " ('AUD/SGD', 'AUD_SGD'),\n",
       " ('AUD/USD', 'AUD_USD'),\n",
       " ('Australia 200', 'AU200_AUD'),\n",
       " ('Bitcoin', 'BTC_USD'),\n",
       " ('Bitcoin Cash', 'BCH_USD'),\n",
       " ('Brent Crude Oil', 'BCO_USD'),\n",
       " ('Bund', 'DE10YB_EUR'),\n",
       " ('CAD/CHF', 'CAD_CHF'),\n",
       " ('CAD/HKD', 'CAD_HKD'),\n",
       " ('CAD/JPY', 'CAD_JPY'),\n",
       " ('CAD/SGD', 'CAD_SGD'),\n",
       " ('CHF/HKD', 'CHF_HKD'),\n",
       " ('CHF/JPY', 'CHF_JPY'),\n",
       " ('CHF/ZAR', 'CHF_ZAR'),\n",
       " ('China A50', 'CN50_USD'),\n",
       " ('China H Shares', 'CHINAH_HKD'),\n",
       " ('Copper', 'XCU_USD'),\n",
       " ('Corn', 'CORN_USD'),\n",
       " ('EUR/AUD', 'EUR_AUD'),\n",
       " ('EUR/CAD', 'EUR_CAD'),\n",
       " ('EUR/CHF', 'EUR_CHF'),\n",
       " ('EUR/CZK', 'EUR_CZK'),\n",
       " ('EUR/DKK', 'EUR_DKK'),\n",
       " ('EUR/GBP', 'EUR_GBP'),\n",
       " ('EUR/HKD', 'EUR_HKD'),\n",
       " ('EUR/HUF', 'EUR_HUF'),\n",
       " ('EUR/JPY', 'EUR_JPY'),\n",
       " ('EUR/NOK', 'EUR_NOK'),\n",
       " ('EUR/NZD', 'EUR_NZD'),\n",
       " ('EUR/PLN', 'EUR_PLN'),\n",
       " ('EUR/SEK', 'EUR_SEK'),\n",
       " ('EUR/SGD', 'EUR_SGD'),\n",
       " ('EUR/TRY', 'EUR_TRY'),\n",
       " ('EUR/USD', 'EUR_USD'),\n",
       " ('EUR/ZAR', 'EUR_ZAR'),\n",
       " ('Ether', 'ETH_USD'),\n",
       " ('Europe 50', 'EU50_EUR'),\n",
       " ('France 40', 'FR40_EUR'),\n",
       " ('GBP/AUD', 'GBP_AUD'),\n",
       " ('GBP/CAD', 'GBP_CAD'),\n",
       " ('GBP/CHF', 'GBP_CHF'),\n",
       " ('GBP/HKD', 'GBP_HKD'),\n",
       " ('GBP/JPY', 'GBP_JPY'),\n",
       " ('GBP/NZD', 'GBP_NZD'),\n",
       " ('GBP/PLN', 'GBP_PLN'),\n",
       " ('GBP/SGD', 'GBP_SGD'),\n",
       " ('GBP/USD', 'GBP_USD'),\n",
       " ('GBP/ZAR', 'GBP_ZAR'),\n",
       " ('Germany 30', 'DE30_EUR'),\n",
       " ('Gold', 'XAU_USD'),\n",
       " ('Gold/AUD', 'XAU_AUD'),\n",
       " ('Gold/CAD', 'XAU_CAD'),\n",
       " ('Gold/CHF', 'XAU_CHF'),\n",
       " ('Gold/EUR', 'XAU_EUR'),\n",
       " ('Gold/GBP', 'XAU_GBP'),\n",
       " ('Gold/HKD', 'XAU_HKD'),\n",
       " ('Gold/JPY', 'XAU_JPY'),\n",
       " ('Gold/NZD', 'XAU_NZD'),\n",
       " ('Gold/SGD', 'XAU_SGD'),\n",
       " ('Gold/Silver', 'XAU_XAG'),\n",
       " ('HKD/JPY', 'HKD_JPY'),\n",
       " ('Hong Kong 33', 'HK33_HKD'),\n",
       " ('Japan 225', 'JP225_USD'),\n",
       " ('Japan 225 (JPY)', 'JP225Y_JPY'),\n",
       " ('Litecoin', 'LTC_USD'),\n",
       " ('NZD/CAD', 'NZD_CAD'),\n",
       " ('NZD/CHF', 'NZD_CHF'),\n",
       " ('NZD/HKD', 'NZD_HKD'),\n",
       " ('NZD/JPY', 'NZD_JPY'),\n",
       " ('NZD/SGD', 'NZD_SGD'),\n",
       " ('NZD/USD', 'NZD_USD'),\n",
       " ('Natural Gas', 'NATGAS_USD'),\n",
       " ('Netherlands 25', 'NL25_EUR'),\n",
       " ('Palladium', 'XPD_USD'),\n",
       " ('Platinum', 'XPT_USD'),\n",
       " ('SGD/CHF', 'SGD_CHF'),\n",
       " ('SGD/JPY', 'SGD_JPY'),\n",
       " ('Silver', 'XAG_USD'),\n",
       " ('Silver/AUD', 'XAG_AUD'),\n",
       " ('Silver/CAD', 'XAG_CAD'),\n",
       " ('Silver/CHF', 'XAG_CHF'),\n",
       " ('Silver/EUR', 'XAG_EUR'),\n",
       " ('Silver/GBP', 'XAG_GBP'),\n",
       " ('Silver/HKD', 'XAG_HKD'),\n",
       " ('Silver/JPY', 'XAG_JPY'),\n",
       " ('Silver/NZD', 'XAG_NZD'),\n",
       " ('Silver/SGD', 'XAG_SGD'),\n",
       " ('Singapore 30', 'SG30_SGD'),\n",
       " ('Soybeans', 'SOYBN_USD'),\n",
       " ('Spain 35', 'ESPIX_EUR'),\n",
       " ('Sugar', 'SUGAR_USD'),\n",
       " ('Switzerland 20', 'CH20_CHF'),\n",
       " ('TRY/JPY', 'TRY_JPY'),\n",
       " ('UK 100', 'UK100_GBP'),\n",
       " ('UK 10Y Gilt', 'UK10YB_GBP'),\n",
       " ('US 10Y T-Note', 'USB10Y_USD'),\n",
       " ('US 2Y T-Note', 'USB02Y_USD'),\n",
       " ('US 5Y T-Note', 'USB05Y_USD'),\n",
       " ('US Nas 100', 'NAS100_USD'),\n",
       " ('US Russ 2000', 'US2000_USD'),\n",
       " ('US SPX 500', 'SPX500_USD'),\n",
       " ('US T-Bond', 'USB30Y_USD'),\n",
       " ('US Wall St 30', 'US30_USD'),\n",
       " ('USD/CAD', 'USD_CAD'),\n",
       " ('USD/CHF', 'USD_CHF'),\n",
       " ('USD/CNH', 'USD_CNH'),\n",
       " ('USD/CZK', 'USD_CZK'),\n",
       " ('USD/DKK', 'USD_DKK'),\n",
       " ('USD/HKD', 'USD_HKD'),\n",
       " ('USD/HUF', 'USD_HUF'),\n",
       " ('USD/JPY', 'USD_JPY'),\n",
       " ('USD/MXN', 'USD_MXN'),\n",
       " ('USD/NOK', 'USD_NOK'),\n",
       " ('USD/PLN', 'USD_PLN'),\n",
       " ('USD/SEK', 'USD_SEK'),\n",
       " ('USD/SGD', 'USD_SGD'),\n",
       " ('USD/THB', 'USD_THB'),\n",
       " ('USD/TRY', 'USD_TRY'),\n",
       " ('USD/ZAR', 'USD_ZAR'),\n",
       " ('West Texas Oil', 'WTICO_USD'),\n",
       " ('Wheat', 'WHEAT_USD'),\n",
       " ('ZAR/JPY', 'ZAR_JPY')]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_instruments()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "instr = api.get_instruments()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "127"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(instr)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Getting Historical Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import tpqoa"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "api = tpqoa.tpqoa(\"oandaMY.cfg\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method get_history in module tpqoa.tpqoa:\n",
      "\n",
      "get_history(instrument, start, end, granularity, price, localize=True) method of tpqoa.tpqoa.tpqoa instance\n",
      "    Retrieves historical data for instrument.\n",
      "    \n",
      "    Parameters\n",
      "    ==========\n",
      "    instrument: string\n",
      "        valid instrument name\n",
      "    start, end: datetime, str\n",
      "        Python datetime or string objects for start and end\n",
      "    granularity: string\n",
      "        a string like 'S5', 'M1' or 'D'\n",
      "    price: string\n",
      "        one of 'A' (ask), 'B' (bid) or 'M' (middle)\n",
      "    \n",
      "    Returns\n",
      "    =======\n",
      "    data: pd.DataFrame\n",
      "        pandas DataFrame object with data\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(api.get_history)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": false
   },
   "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>o</th>\n",
       "      <th>h</th>\n",
       "      <th>l</th>\n",
       "      <th>c</th>\n",
       "      <th>volume</th>\n",
       "      <th>complete</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",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-06-30 21:00:00</th>\n",
       "      <td>1.04818</td>\n",
       "      <td>1.04844</td>\n",
       "      <td>1.03647</td>\n",
       "      <td>1.04250</td>\n",
       "      <td>145041</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-03 21:00:00</th>\n",
       "      <td>1.04195</td>\n",
       "      <td>1.04621</td>\n",
       "      <td>1.04144</td>\n",
       "      <td>1.04213</td>\n",
       "      <td>66012</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-04 21:00:00</th>\n",
       "      <td>1.04184</td>\n",
       "      <td>1.04481</td>\n",
       "      <td>1.02344</td>\n",
       "      <td>1.02642</td>\n",
       "      <td>146797</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-05 21:00:00</th>\n",
       "      <td>1.02626</td>\n",
       "      <td>1.02759</td>\n",
       "      <td>1.01607</td>\n",
       "      <td>1.01840</td>\n",
       "      <td>158288</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-06 21:00:00</th>\n",
       "      <td>1.01798</td>\n",
       "      <td>1.02204</td>\n",
       "      <td>1.01434</td>\n",
       "      <td>1.01604</td>\n",
       "      <td>122991</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-07 21:00:00</th>\n",
       "      <td>1.01589</td>\n",
       "      <td>1.01906</td>\n",
       "      <td>1.00705</td>\n",
       "      <td>1.01838</td>\n",
       "      <td>138828</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-10 21:00:00</th>\n",
       "      <td>1.01733</td>\n",
       "      <td>1.01827</td>\n",
       "      <td>1.00329</td>\n",
       "      <td>1.00381</td>\n",
       "      <td>119074</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-11 21:00:00</th>\n",
       "      <td>1.00350</td>\n",
       "      <td>1.00733</td>\n",
       "      <td>0.99993</td>\n",
       "      <td>1.00365</td>\n",
       "      <td>140546</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-12 21:00:00</th>\n",
       "      <td>1.00352</td>\n",
       "      <td>1.01215</td>\n",
       "      <td>0.99972</td>\n",
       "      <td>1.00568</td>\n",
       "      <td>158173</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-13 21:00:00</th>\n",
       "      <td>1.00545</td>\n",
       "      <td>1.00582</td>\n",
       "      <td>0.99515</td>\n",
       "      <td>1.00194</td>\n",
       "      <td>167428</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-14 21:00:00</th>\n",
       "      <td>1.00144</td>\n",
       "      <td>1.00973</td>\n",
       "      <td>1.00061</td>\n",
       "      <td>1.00868</td>\n",
       "      <td>127690</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-17 21:00:00</th>\n",
       "      <td>1.00817</td>\n",
       "      <td>1.02006</td>\n",
       "      <td>1.00767</td>\n",
       "      <td>1.01434</td>\n",
       "      <td>120545</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-18 21:00:00</th>\n",
       "      <td>1.01383</td>\n",
       "      <td>1.02685</td>\n",
       "      <td>1.01189</td>\n",
       "      <td>1.02248</td>\n",
       "      <td>135438</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-19 21:00:00</th>\n",
       "      <td>1.02231</td>\n",
       "      <td>1.02723</td>\n",
       "      <td>1.01547</td>\n",
       "      <td>1.01800</td>\n",
       "      <td>126659</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-20 21:00:00</th>\n",
       "      <td>1.01747</td>\n",
       "      <td>1.02773</td>\n",
       "      <td>1.01527</td>\n",
       "      <td>1.02290</td>\n",
       "      <td>163593</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-21 21:00:00</th>\n",
       "      <td>1.02255</td>\n",
       "      <td>1.02547</td>\n",
       "      <td>1.01290</td>\n",
       "      <td>1.02135</td>\n",
       "      <td>142936</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-24 21:00:00</th>\n",
       "      <td>1.02115</td>\n",
       "      <td>1.02572</td>\n",
       "      <td>1.01776</td>\n",
       "      <td>1.02212</td>\n",
       "      <td>127680</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-25 21:00:00</th>\n",
       "      <td>1.02147</td>\n",
       "      <td>1.02494</td>\n",
       "      <td>1.01068</td>\n",
       "      <td>1.01163</td>\n",
       "      <td>109878</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-26 21:00:00</th>\n",
       "      <td>1.01127</td>\n",
       "      <td>1.02202</td>\n",
       "      <td>1.00960</td>\n",
       "      <td>1.01984</td>\n",
       "      <td>124883</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-27 21:00:00</th>\n",
       "      <td>1.01940</td>\n",
       "      <td>1.02338</td>\n",
       "      <td>1.01132</td>\n",
       "      <td>1.01955</td>\n",
       "      <td>151022</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-07-28 21:00:00</th>\n",
       "      <td>1.01946</td>\n",
       "      <td>1.02535</td>\n",
       "      <td>1.01452</td>\n",
       "      <td>1.02254</td>\n",
       "      <td>144389</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                           o        h        l        c  volume  complete\n",
       "time                                                                     \n",
       "2022-06-30 21:00:00  1.04818  1.04844  1.03647  1.04250  145041      True\n",
       "2022-07-03 21:00:00  1.04195  1.04621  1.04144  1.04213   66012      True\n",
       "2022-07-04 21:00:00  1.04184  1.04481  1.02344  1.02642  146797      True\n",
       "2022-07-05 21:00:00  1.02626  1.02759  1.01607  1.01840  158288      True\n",
       "2022-07-06 21:00:00  1.01798  1.02204  1.01434  1.01604  122991      True\n",
       "2022-07-07 21:00:00  1.01589  1.01906  1.00705  1.01838  138828      True\n",
       "2022-07-10 21:00:00  1.01733  1.01827  1.00329  1.00381  119074      True\n",
       "2022-07-11 21:00:00  1.00350  1.00733  0.99993  1.00365  140546      True\n",
       "2022-07-12 21:00:00  1.00352  1.01215  0.99972  1.00568  158173      True\n",
       "2022-07-13 21:00:00  1.00545  1.00582  0.99515  1.00194  167428      True\n",
       "2022-07-14 21:00:00  1.00144  1.00973  1.00061  1.00868  127690      True\n",
       "2022-07-17 21:00:00  1.00817  1.02006  1.00767  1.01434  120545      True\n",
       "2022-07-18 21:00:00  1.01383  1.02685  1.01189  1.02248  135438      True\n",
       "2022-07-19 21:00:00  1.02231  1.02723  1.01547  1.01800  126659      True\n",
       "2022-07-20 21:00:00  1.01747  1.02773  1.01527  1.02290  163593      True\n",
       "2022-07-21 21:00:00  1.02255  1.02547  1.01290  1.02135  142936      True\n",
       "2022-07-24 21:00:00  1.02115  1.02572  1.01776  1.02212  127680      True\n",
       "2022-07-25 21:00:00  1.02147  1.02494  1.01068  1.01163  109878      True\n",
       "2022-07-26 21:00:00  1.01127  1.02202  1.00960  1.01984  124883      True\n",
       "2022-07-27 21:00:00  1.01940  1.02338  1.01132  1.01955  151022      True\n",
       "2022-07-28 21:00:00  1.01946  1.02535  1.01452  1.02254  144389      True"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_history(instrument = \"EUR_USD\", start = \"2022-07-01\", end = \"2022-07-31\",\n",
    "                granularity = \"D\", price = \"B\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font color=RED>Important remark</font>: the timstamp is the **beginning** of the period, so if you consider the closing price its correct timestamp is the next one!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = api.get_history(instrument = \"EUR_USD\", start = \"2022-07-01\", end = \"2022-07-31\",\n",
    "                granularity = \"D\", price = \"B\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "DatetimeIndex: 21 entries, 2022-06-30 21:00:00 to 2022-07-28 21:00:00\n",
      "Data columns (total 6 columns):\n",
      " #   Column    Non-Null Count  Dtype  \n",
      "---  ------    --------------  -----  \n",
      " 0   o         21 non-null     float64\n",
      " 1   h         21 non-null     float64\n",
      " 2   l         21 non-null     float64\n",
      " 3   c         21 non-null     float64\n",
      " 4   volume    21 non-null     int64  \n",
      " 5   complete  21 non-null     bool   \n",
      "dtypes: bool(1), float64(4), int64(1)\n",
      "memory usage: 1.0 KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": false
   },
   "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>o</th>\n",
       "      <th>h</th>\n",
       "      <th>l</th>\n",
       "      <th>c</th>\n",
       "      <th>volume</th>\n",
       "      <th>complete</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",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-06-30 21:00:00</th>\n",
       "      <td>1.04856</td>\n",
       "      <td>1.04876</td>\n",
       "      <td>1.03663</td>\n",
       "      <td>1.0428</td>\n",
       "      <td>145041</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                           o        h        l       c  volume  complete\n",
       "time                                                                    \n",
       "2022-06-30 21:00:00  1.04856  1.04876  1.03663  1.0428  145041      True"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_history(instrument = \"EUR_USD\", start = \"2022-07-01\", end = \"2022-07-01\",\n",
    "                granularity = \"D\", price = \"A\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "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>o</th>\n",
       "      <th>h</th>\n",
       "      <th>l</th>\n",
       "      <th>c</th>\n",
       "      <th>volume</th>\n",
       "      <th>complete</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",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-06-30 21:00:00</th>\n",
       "      <td>1.04818</td>\n",
       "      <td>1.04844</td>\n",
       "      <td>1.03647</td>\n",
       "      <td>1.0425</td>\n",
       "      <td>145041</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                           o        h        l       c  volume  complete\n",
       "time                                                                    \n",
       "2022-06-30 21:00:00  1.04818  1.04844  1.03647  1.0425  145041      True"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_history(instrument = \"EUR_USD\", start = \"2022-07-01\", end = \"2022-07-01\",\n",
    "                granularity = \"D\", price = \"B\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "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>o</th>\n",
       "      <th>h</th>\n",
       "      <th>l</th>\n",
       "      <th>c</th>\n",
       "      <th>volume</th>\n",
       "      <th>complete</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",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:00:00</th>\n",
       "      <td>1.01566</td>\n",
       "      <td>1.01643</td>\n",
       "      <td>1.01500</td>\n",
       "      <td>1.01582</td>\n",
       "      <td>4316</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 01:00:00</th>\n",
       "      <td>1.01585</td>\n",
       "      <td>1.01712</td>\n",
       "      <td>1.01568</td>\n",
       "      <td>1.01709</td>\n",
       "      <td>4765</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 02:00:00</th>\n",
       "      <td>1.01710</td>\n",
       "      <td>1.01823</td>\n",
       "      <td>1.01687</td>\n",
       "      <td>1.01805</td>\n",
       "      <td>3932</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 03:00:00</th>\n",
       "      <td>1.01805</td>\n",
       "      <td>1.01940</td>\n",
       "      <td>1.01774</td>\n",
       "      <td>1.01914</td>\n",
       "      <td>3507</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 04:00:00</th>\n",
       "      <td>1.01915</td>\n",
       "      <td>1.01933</td>\n",
       "      <td>1.01813</td>\n",
       "      <td>1.01860</td>\n",
       "      <td>3764</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 05:00:00</th>\n",
       "      <td>1.01860</td>\n",
       "      <td>1.01870</td>\n",
       "      <td>1.01744</td>\n",
       "      <td>1.01764</td>\n",
       "      <td>3595</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 06:00:00</th>\n",
       "      <td>1.01758</td>\n",
       "      <td>1.01802</td>\n",
       "      <td>1.01542</td>\n",
       "      <td>1.01598</td>\n",
       "      <td>6233</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 07:00:00</th>\n",
       "      <td>1.01600</td>\n",
       "      <td>1.01914</td>\n",
       "      <td>1.01594</td>\n",
       "      <td>1.01780</td>\n",
       "      <td>8249</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 08:00:00</th>\n",
       "      <td>1.01784</td>\n",
       "      <td>1.01891</td>\n",
       "      <td>1.01784</td>\n",
       "      <td>1.01881</td>\n",
       "      <td>6491</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 09:00:00</th>\n",
       "      <td>1.01880</td>\n",
       "      <td>1.01980</td>\n",
       "      <td>1.01812</td>\n",
       "      <td>1.01863</td>\n",
       "      <td>5513</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 10:00:00</th>\n",
       "      <td>1.01866</td>\n",
       "      <td>1.02005</td>\n",
       "      <td>1.01787</td>\n",
       "      <td>1.01878</td>\n",
       "      <td>6506</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 11:00:00</th>\n",
       "      <td>1.01876</td>\n",
       "      <td>1.02104</td>\n",
       "      <td>1.01802</td>\n",
       "      <td>1.01842</td>\n",
       "      <td>6671</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 12:00:00</th>\n",
       "      <td>1.01844</td>\n",
       "      <td>1.01969</td>\n",
       "      <td>1.01800</td>\n",
       "      <td>1.01862</td>\n",
       "      <td>7709</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 13:00:00</th>\n",
       "      <td>1.01860</td>\n",
       "      <td>1.01876</td>\n",
       "      <td>1.01656</td>\n",
       "      <td>1.01700</td>\n",
       "      <td>7491</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 14:00:00</th>\n",
       "      <td>1.01702</td>\n",
       "      <td>1.01702</td>\n",
       "      <td>1.01252</td>\n",
       "      <td>1.01304</td>\n",
       "      <td>15605</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 15:00:00</th>\n",
       "      <td>1.01303</td>\n",
       "      <td>1.01466</td>\n",
       "      <td>1.01228</td>\n",
       "      <td>1.01446</td>\n",
       "      <td>7960</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 16:00:00</th>\n",
       "      <td>1.01447</td>\n",
       "      <td>1.01666</td>\n",
       "      <td>1.01402</td>\n",
       "      <td>1.01501</td>\n",
       "      <td>6200</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 17:00:00</th>\n",
       "      <td>1.01500</td>\n",
       "      <td>1.01601</td>\n",
       "      <td>1.01486</td>\n",
       "      <td>1.01578</td>\n",
       "      <td>3085</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 18:00:00</th>\n",
       "      <td>1.01579</td>\n",
       "      <td>1.01605</td>\n",
       "      <td>1.01494</td>\n",
       "      <td>1.01550</td>\n",
       "      <td>3366</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 19:00:00</th>\n",
       "      <td>1.01546</td>\n",
       "      <td>1.01740</td>\n",
       "      <td>1.01542</td>\n",
       "      <td>1.01684</td>\n",
       "      <td>3328</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 20:00:00</th>\n",
       "      <td>1.01688</td>\n",
       "      <td>1.01724</td>\n",
       "      <td>1.01676</td>\n",
       "      <td>1.01692</td>\n",
       "      <td>2147</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 21:00:00</th>\n",
       "      <td>1.01660</td>\n",
       "      <td>1.01702</td>\n",
       "      <td>1.01660</td>\n",
       "      <td>1.01696</td>\n",
       "      <td>208</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 22:00:00</th>\n",
       "      <td>1.01698</td>\n",
       "      <td>1.01710</td>\n",
       "      <td>1.01564</td>\n",
       "      <td>1.01618</td>\n",
       "      <td>1955</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 23:00:00</th>\n",
       "      <td>1.01618</td>\n",
       "      <td>1.01626</td>\n",
       "      <td>1.01565</td>\n",
       "      <td>1.01566</td>\n",
       "      <td>1358</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 00:00:00</th>\n",
       "      <td>1.01564</td>\n",
       "      <td>1.01664</td>\n",
       "      <td>1.01542</td>\n",
       "      <td>1.01652</td>\n",
       "      <td>3582</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 01:00:00</th>\n",
       "      <td>1.01649</td>\n",
       "      <td>1.01762</td>\n",
       "      <td>1.01614</td>\n",
       "      <td>1.01692</td>\n",
       "      <td>3489</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 02:00:00</th>\n",
       "      <td>1.01692</td>\n",
       "      <td>1.01730</td>\n",
       "      <td>1.01616</td>\n",
       "      <td>1.01648</td>\n",
       "      <td>2246</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 03:00:00</th>\n",
       "      <td>1.01650</td>\n",
       "      <td>1.01707</td>\n",
       "      <td>1.01603</td>\n",
       "      <td>1.01628</td>\n",
       "      <td>1888</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 04:00:00</th>\n",
       "      <td>1.01629</td>\n",
       "      <td>1.01674</td>\n",
       "      <td>1.01610</td>\n",
       "      <td>1.01642</td>\n",
       "      <td>1949</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 05:00:00</th>\n",
       "      <td>1.01641</td>\n",
       "      <td>1.01740</td>\n",
       "      <td>1.01618</td>\n",
       "      <td>1.01630</td>\n",
       "      <td>3120</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 06:00:00</th>\n",
       "      <td>1.01632</td>\n",
       "      <td>1.01726</td>\n",
       "      <td>1.01566</td>\n",
       "      <td>1.01680</td>\n",
       "      <td>5102</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 07:00:00</th>\n",
       "      <td>1.01682</td>\n",
       "      <td>1.01864</td>\n",
       "      <td>1.01664</td>\n",
       "      <td>1.01791</td>\n",
       "      <td>6953</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 08:00:00</th>\n",
       "      <td>1.01789</td>\n",
       "      <td>1.01942</td>\n",
       "      <td>1.01746</td>\n",
       "      <td>1.01917</td>\n",
       "      <td>5354</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 09:00:00</th>\n",
       "      <td>1.01916</td>\n",
       "      <td>1.01980</td>\n",
       "      <td>1.01858</td>\n",
       "      <td>1.01886</td>\n",
       "      <td>4937</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 10:00:00</th>\n",
       "      <td>1.01886</td>\n",
       "      <td>1.01962</td>\n",
       "      <td>1.01854</td>\n",
       "      <td>1.01906</td>\n",
       "      <td>4682</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 11:00:00</th>\n",
       "      <td>1.01904</td>\n",
       "      <td>1.01958</td>\n",
       "      <td>1.01604</td>\n",
       "      <td>1.01760</td>\n",
       "      <td>10910</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 12:00:00</th>\n",
       "      <td>1.01756</td>\n",
       "      <td>1.01953</td>\n",
       "      <td>1.01655</td>\n",
       "      <td>1.01881</td>\n",
       "      <td>10518</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 13:00:00</th>\n",
       "      <td>1.01883</td>\n",
       "      <td>1.01966</td>\n",
       "      <td>1.01733</td>\n",
       "      <td>1.01916</td>\n",
       "      <td>9768</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 14:00:00</th>\n",
       "      <td>1.01920</td>\n",
       "      <td>1.02123</td>\n",
       "      <td>1.01862</td>\n",
       "      <td>1.02118</td>\n",
       "      <td>9939</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 15:00:00</th>\n",
       "      <td>1.02118</td>\n",
       "      <td>1.02339</td>\n",
       "      <td>1.02062</td>\n",
       "      <td>1.02222</td>\n",
       "      <td>7623</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 16:00:00</th>\n",
       "      <td>1.02222</td>\n",
       "      <td>1.02396</td>\n",
       "      <td>1.02181</td>\n",
       "      <td>1.02368</td>\n",
       "      <td>5666</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 17:00:00</th>\n",
       "      <td>1.02365</td>\n",
       "      <td>1.02426</td>\n",
       "      <td>1.02306</td>\n",
       "      <td>1.02375</td>\n",
       "      <td>3536</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 18:00:00</th>\n",
       "      <td>1.02373</td>\n",
       "      <td>1.02504</td>\n",
       "      <td>1.02366</td>\n",
       "      <td>1.02500</td>\n",
       "      <td>3297</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 19:00:00</th>\n",
       "      <td>1.02500</td>\n",
       "      <td>1.02538</td>\n",
       "      <td>1.02442</td>\n",
       "      <td>1.02455</td>\n",
       "      <td>2967</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 20:00:00</th>\n",
       "      <td>1.02452</td>\n",
       "      <td>1.02473</td>\n",
       "      <td>1.02425</td>\n",
       "      <td>1.02468</td>\n",
       "      <td>1214</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 21:00:00</th>\n",
       "      <td>1.02473</td>\n",
       "      <td>1.02481</td>\n",
       "      <td>1.02452</td>\n",
       "      <td>1.02459</td>\n",
       "      <td>343</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 22:00:00</th>\n",
       "      <td>1.02466</td>\n",
       "      <td>1.02484</td>\n",
       "      <td>1.02428</td>\n",
       "      <td>1.02482</td>\n",
       "      <td>1509</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 23:00:00</th>\n",
       "      <td>1.02480</td>\n",
       "      <td>1.02523</td>\n",
       "      <td>1.02460</td>\n",
       "      <td>1.02474</td>\n",
       "      <td>1863</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                           o        h        l        c  volume  complete\n",
       "time                                                                     \n",
       "2022-08-03 00:00:00  1.01566  1.01643  1.01500  1.01582    4316      True\n",
       "2022-08-03 01:00:00  1.01585  1.01712  1.01568  1.01709    4765      True\n",
       "2022-08-03 02:00:00  1.01710  1.01823  1.01687  1.01805    3932      True\n",
       "2022-08-03 03:00:00  1.01805  1.01940  1.01774  1.01914    3507      True\n",
       "2022-08-03 04:00:00  1.01915  1.01933  1.01813  1.01860    3764      True\n",
       "2022-08-03 05:00:00  1.01860  1.01870  1.01744  1.01764    3595      True\n",
       "2022-08-03 06:00:00  1.01758  1.01802  1.01542  1.01598    6233      True\n",
       "2022-08-03 07:00:00  1.01600  1.01914  1.01594  1.01780    8249      True\n",
       "2022-08-03 08:00:00  1.01784  1.01891  1.01784  1.01881    6491      True\n",
       "2022-08-03 09:00:00  1.01880  1.01980  1.01812  1.01863    5513      True\n",
       "2022-08-03 10:00:00  1.01866  1.02005  1.01787  1.01878    6506      True\n",
       "2022-08-03 11:00:00  1.01876  1.02104  1.01802  1.01842    6671      True\n",
       "2022-08-03 12:00:00  1.01844  1.01969  1.01800  1.01862    7709      True\n",
       "2022-08-03 13:00:00  1.01860  1.01876  1.01656  1.01700    7491      True\n",
       "2022-08-03 14:00:00  1.01702  1.01702  1.01252  1.01304   15605      True\n",
       "2022-08-03 15:00:00  1.01303  1.01466  1.01228  1.01446    7960      True\n",
       "2022-08-03 16:00:00  1.01447  1.01666  1.01402  1.01501    6200      True\n",
       "2022-08-03 17:00:00  1.01500  1.01601  1.01486  1.01578    3085      True\n",
       "2022-08-03 18:00:00  1.01579  1.01605  1.01494  1.01550    3366      True\n",
       "2022-08-03 19:00:00  1.01546  1.01740  1.01542  1.01684    3328      True\n",
       "2022-08-03 20:00:00  1.01688  1.01724  1.01676  1.01692    2147      True\n",
       "2022-08-03 21:00:00  1.01660  1.01702  1.01660  1.01696     208      True\n",
       "2022-08-03 22:00:00  1.01698  1.01710  1.01564  1.01618    1955      True\n",
       "2022-08-03 23:00:00  1.01618  1.01626  1.01565  1.01566    1358      True\n",
       "2022-08-04 00:00:00  1.01564  1.01664  1.01542  1.01652    3582      True\n",
       "2022-08-04 01:00:00  1.01649  1.01762  1.01614  1.01692    3489      True\n",
       "2022-08-04 02:00:00  1.01692  1.01730  1.01616  1.01648    2246      True\n",
       "2022-08-04 03:00:00  1.01650  1.01707  1.01603  1.01628    1888      True\n",
       "2022-08-04 04:00:00  1.01629  1.01674  1.01610  1.01642    1949      True\n",
       "2022-08-04 05:00:00  1.01641  1.01740  1.01618  1.01630    3120      True\n",
       "2022-08-04 06:00:00  1.01632  1.01726  1.01566  1.01680    5102      True\n",
       "2022-08-04 07:00:00  1.01682  1.01864  1.01664  1.01791    6953      True\n",
       "2022-08-04 08:00:00  1.01789  1.01942  1.01746  1.01917    5354      True\n",
       "2022-08-04 09:00:00  1.01916  1.01980  1.01858  1.01886    4937      True\n",
       "2022-08-04 10:00:00  1.01886  1.01962  1.01854  1.01906    4682      True\n",
       "2022-08-04 11:00:00  1.01904  1.01958  1.01604  1.01760   10910      True\n",
       "2022-08-04 12:00:00  1.01756  1.01953  1.01655  1.01881   10518      True\n",
       "2022-08-04 13:00:00  1.01883  1.01966  1.01733  1.01916    9768      True\n",
       "2022-08-04 14:00:00  1.01920  1.02123  1.01862  1.02118    9939      True\n",
       "2022-08-04 15:00:00  1.02118  1.02339  1.02062  1.02222    7623      True\n",
       "2022-08-04 16:00:00  1.02222  1.02396  1.02181  1.02368    5666      True\n",
       "2022-08-04 17:00:00  1.02365  1.02426  1.02306  1.02375    3536      True\n",
       "2022-08-04 18:00:00  1.02373  1.02504  1.02366  1.02500    3297      True\n",
       "2022-08-04 19:00:00  1.02500  1.02538  1.02442  1.02455    2967      True\n",
       "2022-08-04 20:00:00  1.02452  1.02473  1.02425  1.02468    1214      True\n",
       "2022-08-04 21:00:00  1.02473  1.02481  1.02452  1.02459     343      True\n",
       "2022-08-04 22:00:00  1.02466  1.02484  1.02428  1.02482    1509      True\n",
       "2022-08-04 23:00:00  1.02480  1.02523  1.02460  1.02474    1863      True"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_history(\"EUR_USD\", \"2022-08-03\", \"2022-08-05\", \"H1\", \"M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "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>o</th>\n",
       "      <th>h</th>\n",
       "      <th>l</th>\n",
       "      <th>c</th>\n",
       "      <th>volume</th>\n",
       "      <th>complete</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",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-08-02 21:00:00</th>\n",
       "      <td>1.01657</td>\n",
       "      <td>1.01940</td>\n",
       "      <td>1.01500</td>\n",
       "      <td>1.01881</td>\n",
       "      <td>51042</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 09:00:00</th>\n",
       "      <td>1.01880</td>\n",
       "      <td>1.02104</td>\n",
       "      <td>1.01228</td>\n",
       "      <td>1.01692</td>\n",
       "      <td>75581</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 21:00:00</th>\n",
       "      <td>1.01660</td>\n",
       "      <td>1.01942</td>\n",
       "      <td>1.01542</td>\n",
       "      <td>1.01917</td>\n",
       "      <td>37204</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 09:00:00</th>\n",
       "      <td>1.01916</td>\n",
       "      <td>1.02538</td>\n",
       "      <td>1.01604</td>\n",
       "      <td>1.02468</td>\n",
       "      <td>75057</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 21:00:00</th>\n",
       "      <td>1.02473</td>\n",
       "      <td>1.02523</td>\n",
       "      <td>1.02183</td>\n",
       "      <td>1.02238</td>\n",
       "      <td>35443</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                           o        h        l        c  volume  complete\n",
       "time                                                                     \n",
       "2022-08-02 21:00:00  1.01657  1.01940  1.01500  1.01881   51042      True\n",
       "2022-08-03 09:00:00  1.01880  1.02104  1.01228  1.01692   75581      True\n",
       "2022-08-03 21:00:00  1.01660  1.01942  1.01542  1.01917   37204      True\n",
       "2022-08-04 09:00:00  1.01916  1.02538  1.01604  1.02468   75057      True\n",
       "2022-08-04 21:00:00  1.02473  1.02523  1.02183  1.02238   35443      True"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_history(\"EUR_USD\", \"2022-08-03\", \"2022-08-05\", \"H12\", \"M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "scrolled": false
   },
   "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>o</th>\n",
       "      <th>h</th>\n",
       "      <th>l</th>\n",
       "      <th>c</th>\n",
       "      <th>volume</th>\n",
       "      <th>complete</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",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:00:00</th>\n",
       "      <td>1.01566</td>\n",
       "      <td>1.01600</td>\n",
       "      <td>1.01564</td>\n",
       "      <td>1.01575</td>\n",
       "      <td>147</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:01:00</th>\n",
       "      <td>1.01577</td>\n",
       "      <td>1.01592</td>\n",
       "      <td>1.01575</td>\n",
       "      <td>1.01579</td>\n",
       "      <td>112</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:02:00</th>\n",
       "      <td>1.01578</td>\n",
       "      <td>1.01612</td>\n",
       "      <td>1.01578</td>\n",
       "      <td>1.01612</td>\n",
       "      <td>120</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:03:00</th>\n",
       "      <td>1.01612</td>\n",
       "      <td>1.01617</td>\n",
       "      <td>1.01600</td>\n",
       "      <td>1.01608</td>\n",
       "      <td>108</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:04:00</th>\n",
       "      <td>1.01607</td>\n",
       "      <td>1.01622</td>\n",
       "      <td>1.01601</td>\n",
       "      <td>1.01618</td>\n",
       "      <td>114</td>\n",
       "      <td>True</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",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 23:55:00</th>\n",
       "      <td>1.02487</td>\n",
       "      <td>1.02487</td>\n",
       "      <td>1.02473</td>\n",
       "      <td>1.02474</td>\n",
       "      <td>36</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 23:56:00</th>\n",
       "      <td>1.02475</td>\n",
       "      <td>1.02480</td>\n",
       "      <td>1.02474</td>\n",
       "      <td>1.02480</td>\n",
       "      <td>28</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 23:57:00</th>\n",
       "      <td>1.02478</td>\n",
       "      <td>1.02478</td>\n",
       "      <td>1.02474</td>\n",
       "      <td>1.02475</td>\n",
       "      <td>28</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 23:58:00</th>\n",
       "      <td>1.02476</td>\n",
       "      <td>1.02477</td>\n",
       "      <td>1.02474</td>\n",
       "      <td>1.02476</td>\n",
       "      <td>26</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 23:59:00</th>\n",
       "      <td>1.02476</td>\n",
       "      <td>1.02486</td>\n",
       "      <td>1.02472</td>\n",
       "      <td>1.02474</td>\n",
       "      <td>35</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2855 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                           o        h        l        c  volume  complete\n",
       "time                                                                     \n",
       "2022-08-03 00:00:00  1.01566  1.01600  1.01564  1.01575     147      True\n",
       "2022-08-03 00:01:00  1.01577  1.01592  1.01575  1.01579     112      True\n",
       "2022-08-03 00:02:00  1.01578  1.01612  1.01578  1.01612     120      True\n",
       "2022-08-03 00:03:00  1.01612  1.01617  1.01600  1.01608     108      True\n",
       "2022-08-03 00:04:00  1.01607  1.01622  1.01601  1.01618     114      True\n",
       "...                      ...      ...      ...      ...     ...       ...\n",
       "2022-08-04 23:55:00  1.02487  1.02487  1.02473  1.02474      36      True\n",
       "2022-08-04 23:56:00  1.02475  1.02480  1.02474  1.02480      28      True\n",
       "2022-08-04 23:57:00  1.02478  1.02478  1.02474  1.02475      28      True\n",
       "2022-08-04 23:58:00  1.02476  1.02477  1.02474  1.02476      26      True\n",
       "2022-08-04 23:59:00  1.02476  1.02486  1.02472  1.02474      35      True\n",
       "\n",
       "[2855 rows x 6 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_history(\"EUR_USD\", \"2022-08-03\", \"2022-08-05\", \"M1\", \"M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "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>o</th>\n",
       "      <th>h</th>\n",
       "      <th>l</th>\n",
       "      <th>c</th>\n",
       "      <th>volume</th>\n",
       "      <th>complete</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",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:00:00</th>\n",
       "      <td>1.01566</td>\n",
       "      <td>1.01584</td>\n",
       "      <td>1.01564</td>\n",
       "      <td>1.01580</td>\n",
       "      <td>28</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:00:05</th>\n",
       "      <td>1.01580</td>\n",
       "      <td>1.01582</td>\n",
       "      <td>1.01580</td>\n",
       "      <td>1.01581</td>\n",
       "      <td>5</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:00:10</th>\n",
       "      <td>1.01581</td>\n",
       "      <td>1.01592</td>\n",
       "      <td>1.01581</td>\n",
       "      <td>1.01590</td>\n",
       "      <td>10</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:00:15</th>\n",
       "      <td>1.01592</td>\n",
       "      <td>1.01592</td>\n",
       "      <td>1.01584</td>\n",
       "      <td>1.01592</td>\n",
       "      <td>17</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:00:20</th>\n",
       "      <td>1.01592</td>\n",
       "      <td>1.01593</td>\n",
       "      <td>1.01591</td>\n",
       "      <td>1.01592</td>\n",
       "      <td>6</td>\n",
       "      <td>True</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",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 23:59:35</th>\n",
       "      <td>1.01570</td>\n",
       "      <td>1.01572</td>\n",
       "      <td>1.01570</td>\n",
       "      <td>1.01572</td>\n",
       "      <td>5</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 23:59:40</th>\n",
       "      <td>1.01572</td>\n",
       "      <td>1.01574</td>\n",
       "      <td>1.01570</td>\n",
       "      <td>1.01570</td>\n",
       "      <td>4</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 23:59:45</th>\n",
       "      <td>1.01568</td>\n",
       "      <td>1.01572</td>\n",
       "      <td>1.01568</td>\n",
       "      <td>1.01570</td>\n",
       "      <td>4</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 23:59:50</th>\n",
       "      <td>1.01568</td>\n",
       "      <td>1.01568</td>\n",
       "      <td>1.01566</td>\n",
       "      <td>1.01566</td>\n",
       "      <td>2</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-04 00:00:00</th>\n",
       "      <td>1.01564</td>\n",
       "      <td>1.01565</td>\n",
       "      <td>1.01562</td>\n",
       "      <td>1.01565</td>\n",
       "      <td>12</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>15240 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                           o        h        l        c  volume  complete\n",
       "time                                                                     \n",
       "2022-08-03 00:00:00  1.01566  1.01584  1.01564  1.01580      28      True\n",
       "2022-08-03 00:00:05  1.01580  1.01582  1.01580  1.01581       5      True\n",
       "2022-08-03 00:00:10  1.01581  1.01592  1.01581  1.01590      10      True\n",
       "2022-08-03 00:00:15  1.01592  1.01592  1.01584  1.01592      17      True\n",
       "2022-08-03 00:00:20  1.01592  1.01593  1.01591  1.01592       6      True\n",
       "...                      ...      ...      ...      ...     ...       ...\n",
       "2022-08-03 23:59:35  1.01570  1.01572  1.01570  1.01572       5      True\n",
       "2022-08-03 23:59:40  1.01572  1.01574  1.01570  1.01570       4      True\n",
       "2022-08-03 23:59:45  1.01568  1.01572  1.01568  1.01570       4      True\n",
       "2022-08-03 23:59:50  1.01568  1.01568  1.01566  1.01566       2      True\n",
       "2022-08-04 00:00:00  1.01564  1.01565  1.01562  1.01565      12      True\n",
       "\n",
       "[15240 rows x 6 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_history(\"EUR_USD\", \"2022-08-03\", \"2022-08-04\", \"S5\", \"M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('AUD/CAD', 'AUD_CAD'),\n",
       " ('AUD/CHF', 'AUD_CHF'),\n",
       " ('AUD/HKD', 'AUD_HKD'),\n",
       " ('AUD/JPY', 'AUD_JPY'),\n",
       " ('AUD/NZD', 'AUD_NZD'),\n",
       " ('AUD/SGD', 'AUD_SGD'),\n",
       " ('AUD/USD', 'AUD_USD'),\n",
       " ('Australia 200', 'AU200_AUD'),\n",
       " ('Bitcoin', 'BTC_USD'),\n",
       " ('Bitcoin Cash', 'BCH_USD'),\n",
       " ('Brent Crude Oil', 'BCO_USD'),\n",
       " ('Bund', 'DE10YB_EUR'),\n",
       " ('CAD/CHF', 'CAD_CHF'),\n",
       " ('CAD/HKD', 'CAD_HKD'),\n",
       " ('CAD/JPY', 'CAD_JPY'),\n",
       " ('CAD/SGD', 'CAD_SGD'),\n",
       " ('CHF/HKD', 'CHF_HKD'),\n",
       " ('CHF/JPY', 'CHF_JPY'),\n",
       " ('CHF/ZAR', 'CHF_ZAR'),\n",
       " ('China A50', 'CN50_USD'),\n",
       " ('China H Shares', 'CHINAH_HKD'),\n",
       " ('Copper', 'XCU_USD'),\n",
       " ('Corn', 'CORN_USD'),\n",
       " ('EUR/AUD', 'EUR_AUD'),\n",
       " ('EUR/CAD', 'EUR_CAD'),\n",
       " ('EUR/CHF', 'EUR_CHF'),\n",
       " ('EUR/CZK', 'EUR_CZK'),\n",
       " ('EUR/DKK', 'EUR_DKK'),\n",
       " ('EUR/GBP', 'EUR_GBP'),\n",
       " ('EUR/HKD', 'EUR_HKD'),\n",
       " ('EUR/HUF', 'EUR_HUF'),\n",
       " ('EUR/JPY', 'EUR_JPY'),\n",
       " ('EUR/NOK', 'EUR_NOK'),\n",
       " ('EUR/NZD', 'EUR_NZD'),\n",
       " ('EUR/PLN', 'EUR_PLN'),\n",
       " ('EUR/SEK', 'EUR_SEK'),\n",
       " ('EUR/SGD', 'EUR_SGD'),\n",
       " ('EUR/TRY', 'EUR_TRY'),\n",
       " ('EUR/USD', 'EUR_USD'),\n",
       " ('EUR/ZAR', 'EUR_ZAR'),\n",
       " ('Ether', 'ETH_USD'),\n",
       " ('Europe 50', 'EU50_EUR'),\n",
       " ('France 40', 'FR40_EUR'),\n",
       " ('GBP/AUD', 'GBP_AUD'),\n",
       " ('GBP/CAD', 'GBP_CAD'),\n",
       " ('GBP/CHF', 'GBP_CHF'),\n",
       " ('GBP/HKD', 'GBP_HKD'),\n",
       " ('GBP/JPY', 'GBP_JPY'),\n",
       " ('GBP/NZD', 'GBP_NZD'),\n",
       " ('GBP/PLN', 'GBP_PLN'),\n",
       " ('GBP/SGD', 'GBP_SGD'),\n",
       " ('GBP/USD', 'GBP_USD'),\n",
       " ('GBP/ZAR', 'GBP_ZAR'),\n",
       " ('Germany 30', 'DE30_EUR'),\n",
       " ('Gold', 'XAU_USD'),\n",
       " ('Gold/AUD', 'XAU_AUD'),\n",
       " ('Gold/CAD', 'XAU_CAD'),\n",
       " ('Gold/CHF', 'XAU_CHF'),\n",
       " ('Gold/EUR', 'XAU_EUR'),\n",
       " ('Gold/GBP', 'XAU_GBP'),\n",
       " ('Gold/HKD', 'XAU_HKD'),\n",
       " ('Gold/JPY', 'XAU_JPY'),\n",
       " ('Gold/NZD', 'XAU_NZD'),\n",
       " ('Gold/SGD', 'XAU_SGD'),\n",
       " ('Gold/Silver', 'XAU_XAG'),\n",
       " ('HKD/JPY', 'HKD_JPY'),\n",
       " ('Hong Kong 33', 'HK33_HKD'),\n",
       " ('Japan 225', 'JP225_USD'),\n",
       " ('Japan 225 (JPY)', 'JP225Y_JPY'),\n",
       " ('Litecoin', 'LTC_USD'),\n",
       " ('NZD/CAD', 'NZD_CAD'),\n",
       " ('NZD/CHF', 'NZD_CHF'),\n",
       " ('NZD/HKD', 'NZD_HKD'),\n",
       " ('NZD/JPY', 'NZD_JPY'),\n",
       " ('NZD/SGD', 'NZD_SGD'),\n",
       " ('NZD/USD', 'NZD_USD'),\n",
       " ('Natural Gas', 'NATGAS_USD'),\n",
       " ('Netherlands 25', 'NL25_EUR'),\n",
       " ('Palladium', 'XPD_USD'),\n",
       " ('Platinum', 'XPT_USD'),\n",
       " ('SGD/CHF', 'SGD_CHF'),\n",
       " ('SGD/JPY', 'SGD_JPY'),\n",
       " ('Silver', 'XAG_USD'),\n",
       " ('Silver/AUD', 'XAG_AUD'),\n",
       " ('Silver/CAD', 'XAG_CAD'),\n",
       " ('Silver/CHF', 'XAG_CHF'),\n",
       " ('Silver/EUR', 'XAG_EUR'),\n",
       " ('Silver/GBP', 'XAG_GBP'),\n",
       " ('Silver/HKD', 'XAG_HKD'),\n",
       " ('Silver/JPY', 'XAG_JPY'),\n",
       " ('Silver/NZD', 'XAG_NZD'),\n",
       " ('Silver/SGD', 'XAG_SGD'),\n",
       " ('Singapore 30', 'SG30_SGD'),\n",
       " ('Soybeans', 'SOYBN_USD'),\n",
       " ('Spain 35', 'ESPIX_EUR'),\n",
       " ('Sugar', 'SUGAR_USD'),\n",
       " ('Switzerland 20', 'CH20_CHF'),\n",
       " ('TRY/JPY', 'TRY_JPY'),\n",
       " ('UK 100', 'UK100_GBP'),\n",
       " ('UK 10Y Gilt', 'UK10YB_GBP'),\n",
       " ('US 10Y T-Note', 'USB10Y_USD'),\n",
       " ('US 2Y T-Note', 'USB02Y_USD'),\n",
       " ('US 5Y T-Note', 'USB05Y_USD'),\n",
       " ('US Nas 100', 'NAS100_USD'),\n",
       " ('US Russ 2000', 'US2000_USD'),\n",
       " ('US SPX 500', 'SPX500_USD'),\n",
       " ('US T-Bond', 'USB30Y_USD'),\n",
       " ('US Wall St 30', 'US30_USD'),\n",
       " ('USD/CAD', 'USD_CAD'),\n",
       " ('USD/CHF', 'USD_CHF'),\n",
       " ('USD/CNH', 'USD_CNH'),\n",
       " ('USD/CZK', 'USD_CZK'),\n",
       " ('USD/DKK', 'USD_DKK'),\n",
       " ('USD/HKD', 'USD_HKD'),\n",
       " ('USD/HUF', 'USD_HUF'),\n",
       " ('USD/JPY', 'USD_JPY'),\n",
       " ('USD/MXN', 'USD_MXN'),\n",
       " ('USD/NOK', 'USD_NOK'),\n",
       " ('USD/PLN', 'USD_PLN'),\n",
       " ('USD/SEK', 'USD_SEK'),\n",
       " ('USD/SGD', 'USD_SGD'),\n",
       " ('USD/THB', 'USD_THB'),\n",
       " ('USD/TRY', 'USD_TRY'),\n",
       " ('USD/ZAR', 'USD_ZAR'),\n",
       " ('West Texas Oil', 'WTICO_USD'),\n",
       " ('Wheat', 'WHEAT_USD'),\n",
       " ('ZAR/JPY', 'ZAR_JPY')]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_instruments()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "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>o</th>\n",
       "      <th>h</th>\n",
       "      <th>l</th>\n",
       "      <th>c</th>\n",
       "      <th>volume</th>\n",
       "      <th>complete</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",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-08-03 00:00:00</th>\n",
       "      <td>4090.9</td>\n",
       "      <td>4095.2</td>\n",
       "      <td>4082.2</td>\n",
       "      <td>4087.6</td>\n",
       "      <td>2163</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 01:00:00</th>\n",
       "      <td>4087.4</td>\n",
       "      <td>4098.1</td>\n",
       "      <td>4086.9</td>\n",
       "      <td>4095.7</td>\n",
       "      <td>2033</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 02:00:00</th>\n",
       "      <td>4096.2</td>\n",
       "      <td>4100.3</td>\n",
       "      <td>4093.8</td>\n",
       "      <td>4097.1</td>\n",
       "      <td>1212</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 03:00:00</th>\n",
       "      <td>4097.2</td>\n",
       "      <td>4099.2</td>\n",
       "      <td>4095.4</td>\n",
       "      <td>4097.2</td>\n",
       "      <td>878</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 04:00:00</th>\n",
       "      <td>4096.9</td>\n",
       "      <td>4102.7</td>\n",
       "      <td>4096.3</td>\n",
       "      <td>4098.2</td>\n",
       "      <td>726</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 05:00:00</th>\n",
       "      <td>4098.3</td>\n",
       "      <td>4104.2</td>\n",
       "      <td>4098.2</td>\n",
       "      <td>4102.1</td>\n",
       "      <td>1089</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 06:00:00</th>\n",
       "      <td>4101.4</td>\n",
       "      <td>4105.4</td>\n",
       "      <td>4098.4</td>\n",
       "      <td>4100.6</td>\n",
       "      <td>1162</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 07:00:00</th>\n",
       "      <td>4100.4</td>\n",
       "      <td>4101.4</td>\n",
       "      <td>4092.2</td>\n",
       "      <td>4095.2</td>\n",
       "      <td>3444</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 08:00:00</th>\n",
       "      <td>4094.9</td>\n",
       "      <td>4102.2</td>\n",
       "      <td>4090.4</td>\n",
       "      <td>4099.9</td>\n",
       "      <td>1731</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 09:00:00</th>\n",
       "      <td>4099.8</td>\n",
       "      <td>4111.2</td>\n",
       "      <td>4098.7</td>\n",
       "      <td>4106.7</td>\n",
       "      <td>1333</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 10:00:00</th>\n",
       "      <td>4106.6</td>\n",
       "      <td>4109.9</td>\n",
       "      <td>4103.8</td>\n",
       "      <td>4106.7</td>\n",
       "      <td>1271</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 11:00:00</th>\n",
       "      <td>4106.4</td>\n",
       "      <td>4113.2</td>\n",
       "      <td>4104.9</td>\n",
       "      <td>4110.9</td>\n",
       "      <td>1294</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 12:00:00</th>\n",
       "      <td>4110.6</td>\n",
       "      <td>4120.2</td>\n",
       "      <td>4108.8</td>\n",
       "      <td>4116.7</td>\n",
       "      <td>1383</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 13:00:00</th>\n",
       "      <td>4116.8</td>\n",
       "      <td>4127.4</td>\n",
       "      <td>4110.4</td>\n",
       "      <td>4125.6</td>\n",
       "      <td>4940</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 14:00:00</th>\n",
       "      <td>4122.6</td>\n",
       "      <td>4135.0</td>\n",
       "      <td>4112.2</td>\n",
       "      <td>4126.4</td>\n",
       "      <td>6401</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 15:00:00</th>\n",
       "      <td>4126.6</td>\n",
       "      <td>4145.6</td>\n",
       "      <td>4124.6</td>\n",
       "      <td>4144.6</td>\n",
       "      <td>3755</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 16:00:00</th>\n",
       "      <td>4145.0</td>\n",
       "      <td>4157.4</td>\n",
       "      <td>4137.4</td>\n",
       "      <td>4154.4</td>\n",
       "      <td>2642</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 17:00:00</th>\n",
       "      <td>4154.2</td>\n",
       "      <td>4159.0</td>\n",
       "      <td>4150.6</td>\n",
       "      <td>4156.6</td>\n",
       "      <td>1960</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 18:00:00</th>\n",
       "      <td>4156.6</td>\n",
       "      <td>4163.2</td>\n",
       "      <td>4153.4</td>\n",
       "      <td>4159.2</td>\n",
       "      <td>2123</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 19:00:00</th>\n",
       "      <td>4158.6</td>\n",
       "      <td>4167.6</td>\n",
       "      <td>4152.2</td>\n",
       "      <td>4154.6</td>\n",
       "      <td>2498</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 20:00:00</th>\n",
       "      <td>4155.0</td>\n",
       "      <td>4155.0</td>\n",
       "      <td>4148.2</td>\n",
       "      <td>4149.9</td>\n",
       "      <td>632</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 22:00:00</th>\n",
       "      <td>4148.9</td>\n",
       "      <td>4150.9</td>\n",
       "      <td>4146.9</td>\n",
       "      <td>4150.5</td>\n",
       "      <td>468</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-08-03 23:00:00</th>\n",
       "      <td>4150.4</td>\n",
       "      <td>4150.8</td>\n",
       "      <td>4147.5</td>\n",
       "      <td>4147.5</td>\n",
       "      <td>439</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                          o       h       l       c  volume  complete\n",
       "time                                                                 \n",
       "2022-08-03 00:00:00  4090.9  4095.2  4082.2  4087.6    2163      True\n",
       "2022-08-03 01:00:00  4087.4  4098.1  4086.9  4095.7    2033      True\n",
       "2022-08-03 02:00:00  4096.2  4100.3  4093.8  4097.1    1212      True\n",
       "2022-08-03 03:00:00  4097.2  4099.2  4095.4  4097.2     878      True\n",
       "2022-08-03 04:00:00  4096.9  4102.7  4096.3  4098.2     726      True\n",
       "2022-08-03 05:00:00  4098.3  4104.2  4098.2  4102.1    1089      True\n",
       "2022-08-03 06:00:00  4101.4  4105.4  4098.4  4100.6    1162      True\n",
       "2022-08-03 07:00:00  4100.4  4101.4  4092.2  4095.2    3444      True\n",
       "2022-08-03 08:00:00  4094.9  4102.2  4090.4  4099.9    1731      True\n",
       "2022-08-03 09:00:00  4099.8  4111.2  4098.7  4106.7    1333      True\n",
       "2022-08-03 10:00:00  4106.6  4109.9  4103.8  4106.7    1271      True\n",
       "2022-08-03 11:00:00  4106.4  4113.2  4104.9  4110.9    1294      True\n",
       "2022-08-03 12:00:00  4110.6  4120.2  4108.8  4116.7    1383      True\n",
       "2022-08-03 13:00:00  4116.8  4127.4  4110.4  4125.6    4940      True\n",
       "2022-08-03 14:00:00  4122.6  4135.0  4112.2  4126.4    6401      True\n",
       "2022-08-03 15:00:00  4126.6  4145.6  4124.6  4144.6    3755      True\n",
       "2022-08-03 16:00:00  4145.0  4157.4  4137.4  4154.4    2642      True\n",
       "2022-08-03 17:00:00  4154.2  4159.0  4150.6  4156.6    1960      True\n",
       "2022-08-03 18:00:00  4156.6  4163.2  4153.4  4159.2    2123      True\n",
       "2022-08-03 19:00:00  4158.6  4167.6  4152.2  4154.6    2498      True\n",
       "2022-08-03 20:00:00  4155.0  4155.0  4148.2  4149.9     632      True\n",
       "2022-08-03 22:00:00  4148.9  4150.9  4146.9  4150.5     468      True\n",
       "2022-08-03 23:00:00  4150.4  4150.8  4147.5  4147.5     439      True"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_history(\"SPX500_USD\", \"2022-08-03\", \"2022-08-04\", \"H1\", \"M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Streaming high-frequency real-time Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import tpqoa"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "api = tpqoa.tpqoa(\"oandaMY.cfg\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2024-10-08T13:58:12.933908084Z 1.09788 1.09798\n",
      "2024-10-08T13:58:19.863897072Z 1.09788 1.09797\n",
      "2024-10-08T13:58:23.031745598Z 1.09787 1.09798\n",
      "2024-10-08T13:58:23.081588312Z 1.09788 1.09798\n",
      "2024-10-08T13:58:25.250445384Z 1.09786 1.09796\n",
      "2024-10-08T13:58:28.183966791Z 1.09788 1.09798\n",
      "2024-10-08T13:58:30.313528292Z 1.09787 1.09798\n",
      "2024-10-08T13:58:31.238386932Z 1.09787 1.09797\n"
     ]
    }
   ],
   "source": [
    "api.stream_data('EUR_USD',stop=8) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'bool' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[26], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mapi\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstop_stream\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'bool' object is not callable"
     ]
    }
   ],
   "source": [
    "api.stop_stream()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Creating Orders and Executing Trades"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import tpqoa"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "api = tpqoa.tpqoa(\"oandaMY.cfg\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      " {'id': '571', 'time': '2024-10-08T13:58:36.026877844Z', 'userID': 27030320, 'accountID': '101-011-27030320-002', 'batchID': '571', 'requestID': '61292613435041729', 'type': 'LIMIT_ORDER_REJECT', 'instrument': 'EUR_USD', 'units': '100000.0', 'price': 1.12999999999999, 'timeInForce': 'GTC', 'positionFill': 'DEFAULT', 'triggerCondition': 'DEFAULT', 'reason': 'CLIENT_ORDER', 'takeProfitOnFill': {'price': 1.17999999999999, 'timeInForce': 'GTC'}, 'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'}, 'rejectReason': 'PRICE_PRECISION_EXCEEDED'} \n",
      "\n"
     ]
    }
   ],
   "source": [
    "api.create_order(instrument = \"EUR_USD\", units = 100000, sl_distance= 0.1, tp_price=1.18, price=1.13)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': '486',\n",
       "  'time': '2024-08-07T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '486',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6301',\n",
       "  'accountBalance': '96451.3461',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6301',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4356'},\n",
       "     {'tradeID': '222', 'financing': '-0.7315'},\n",
       "     {'tradeID': '226', 'financing': '-1.463'}]}]},\n",
       " {'id': '487',\n",
       "  'time': '2024-08-08T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '487',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96436.7708',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '488',\n",
       "  'time': '2024-08-09T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '488',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6301',\n",
       "  'accountBalance': '96422.1407',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6301',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4356'},\n",
       "     {'tradeID': '222', 'financing': '-0.7315'},\n",
       "     {'tradeID': '226', 'financing': '-1.463'}]}]},\n",
       " {'id': '489',\n",
       "  'time': '2024-08-10T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '489',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96422.1407',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '490',\n",
       "  'time': '2024-08-11T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '490',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96422.1407',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '491',\n",
       "  'time': '2024-08-12T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '491',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96407.4558',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '492',\n",
       "  'time': '2024-08-13T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '492',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96392.7709',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '493',\n",
       "  'time': '2024-08-14T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '493',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96378.086',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '494',\n",
       "  'time': '2024-08-15T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '494',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96363.4011',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '495',\n",
       "  'time': '2024-08-16T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '495',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96348.7162',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '496',\n",
       "  'time': '2024-08-17T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '496',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96348.7162',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '497',\n",
       "  'time': '2024-08-18T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '497',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96348.7162',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '498',\n",
       "  'time': '2024-08-19T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '498',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96334.0313',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '499',\n",
       "  'time': '2024-08-20T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '499',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96319.3464',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '500',\n",
       "  'time': '2024-08-21T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '500',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96304.7711',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '501',\n",
       "  'time': '2024-08-22T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '501',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96290.1958',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '502',\n",
       "  'time': '2024-08-23T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '502',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6301',\n",
       "  'accountBalance': '96275.5657',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6301',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4356'},\n",
       "     {'tradeID': '222', 'financing': '-0.7315'},\n",
       "     {'tradeID': '226', 'financing': '-1.463'}]}]},\n",
       " {'id': '503',\n",
       "  'time': '2024-08-24T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '503',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96275.5657',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '504',\n",
       "  'time': '2024-08-25T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '504',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96275.5657',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '505',\n",
       "  'time': '2024-08-26T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '505',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96260.9904',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '506',\n",
       "  'time': '2024-08-27T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '506',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96246.4151',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '507',\n",
       "  'time': '2024-08-28T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '507',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-15.1781',\n",
       "  'accountBalance': '96231.237',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-15.1781',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.9014'},\n",
       "     {'tradeID': '222', 'financing': '-0.7589'},\n",
       "     {'tradeID': '226', 'financing': '-1.5178'}]}]},\n",
       " {'id': '508',\n",
       "  'time': '2024-08-29T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '508',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96231.237',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '509',\n",
       "  'time': '2024-08-30T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '509',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96216.5521',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '510',\n",
       "  'time': '2024-08-31T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '510',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96216.5521',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '511',\n",
       "  'time': '2024-09-01T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '511',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96216.5521',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '512',\n",
       "  'time': '2024-09-02T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '512',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.7945',\n",
       "  'accountBalance': '96201.7576',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.7945',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.5753'},\n",
       "     {'tradeID': '222', 'financing': '-0.7397'},\n",
       "     {'tradeID': '226', 'financing': '-1.4795'}]}]},\n",
       " {'id': '513',\n",
       "  'time': '2024-09-03T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '513',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96187.0727',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '514',\n",
       "  'time': '2024-09-04T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '514',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96172.3878',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '515',\n",
       "  'time': '2024-09-05T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '515',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96157.7029',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '516',\n",
       "  'time': '2024-09-06T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '516',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96143.018',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '517',\n",
       "  'time': '2024-09-07T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '517',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96143.018',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '518',\n",
       "  'time': '2024-09-08T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '518',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96143.018',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '519',\n",
       "  'time': '2024-09-09T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '519',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.7398',\n",
       "  'accountBalance': '96128.2782',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.7398',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.5288'},\n",
       "     {'tradeID': '222', 'financing': '-0.737'},\n",
       "     {'tradeID': '226', 'financing': '-1.474'}]}]},\n",
       " {'id': '520',\n",
       "  'time': '2024-09-10T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '520',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.7398',\n",
       "  'accountBalance': '96113.5384',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.7398',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.5288'},\n",
       "     {'tradeID': '222', 'financing': '-0.737'},\n",
       "     {'tradeID': '226', 'financing': '-1.474'}]}]},\n",
       " {'id': '521',\n",
       "  'time': '2024-09-11T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '521',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.7398',\n",
       "  'accountBalance': '96098.7986',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.7398',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.5288'},\n",
       "     {'tradeID': '222', 'financing': '-0.737'},\n",
       "     {'tradeID': '226', 'financing': '-1.474'}]}]},\n",
       " {'id': '522',\n",
       "  'time': '2024-09-12T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '522',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96084.1137',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '523',\n",
       "  'time': '2024-09-13T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '523',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96069.4288',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '524',\n",
       "  'time': '2024-09-14T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '524',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96069.4288',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '525',\n",
       "  'time': '2024-09-15T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '525',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96069.4288',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '526',\n",
       "  'time': '2024-09-16T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '526',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-16.274',\n",
       "  'accountBalance': '96053.1548',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-16.274',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-13.8329'},\n",
       "     {'tradeID': '222', 'financing': '-0.8137'},\n",
       "     {'tradeID': '226', 'financing': '-1.6274'}]}]},\n",
       " {'id': '527',\n",
       "  'time': '2024-09-17T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '527',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.2466',\n",
       "  'accountBalance': '96038.9082',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.2466',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.1096'},\n",
       "     {'tradeID': '222', 'financing': '-0.7123'},\n",
       "     {'tradeID': '226', 'financing': '-1.4247'}]}]},\n",
       " {'id': '528',\n",
       "  'time': '2024-09-18T13:31:47.257349390Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '528',\n",
       "  'requestID': '115328554456699880',\n",
       "  'type': 'LIMIT_ORDER_REJECT',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'price': 1.12999999999999,\n",
       "  'timeInForce': 'GTC',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'takeProfitOnFill': {'price': 1.17999999999999, 'timeInForce': 'GTC'},\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'},\n",
       "  'rejectReason': 'PRICE_PRECISION_EXCEEDED'},\n",
       " {'id': '529',\n",
       "  'time': '2024-09-18T13:31:47.872579665Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '529',\n",
       "  'requestID': '61285358927666206',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'}},\n",
       " {'id': '530',\n",
       "  'time': '2024-09-18T13:31:47.872579665Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '529',\n",
       "  'requestID': '61285358927666206',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '529',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893386252746',\n",
       "  'lossQuoteHomeConversionFactor': '0.902365009055',\n",
       "  'price': 1.11369,\n",
       "  'fullVWAP': 1.11369,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11369, 'liquidity': '500000'},\n",
       "    {'price': 1.11368, 'liquidity': '2500000'},\n",
       "    {'price': 1.11367, 'liquidity': '2000000'},\n",
       "    {'price': 1.11366, 'liquidity': '5000000'},\n",
       "    {'price': 1.11363, 'liquidity': '10000000'},\n",
       "    {'price': 1.1136, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11379, 'liquidity': '500000'},\n",
       "    {'price': 1.1138, 'liquidity': '500000'},\n",
       "    {'price': 1.11381, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '2000000'},\n",
       "    {'price': 1.11383, 'liquidity': '5000000'},\n",
       "    {'price': 1.11385, 'liquidity': '10000000'},\n",
       "    {'price': 1.11388, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.1136,\n",
       "   'closeoutAsk': 1.11388},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '1981.5307',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98020.4389',\n",
       "  'tradeReduced': {'tradeID': '216',\n",
       "   'units': '-100000.0',\n",
       "   'price': 1.11369,\n",
       "   'realizedPL': '1981.5307',\n",
       "   'financing': '0.0',\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '4.4894'},\n",
       "  'halfSpreadCost': '4.4894'},\n",
       " {'id': '531',\n",
       "  'time': '2024-09-18T13:33:14.095307993Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '531',\n",
       "  'requestID': '97314156312956866',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'}},\n",
       " {'id': '532',\n",
       "  'time': '2024-09-18T13:33:14.095307993Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '531',\n",
       "  'requestID': '97314156312956866',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '531',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893265945407',\n",
       "  'lossQuoteHomeConversionFactor': '0.902243492597',\n",
       "  'price': 1.11393,\n",
       "  'fullVWAP': 1.11393,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11385, 'liquidity': '500000'},\n",
       "    {'price': 1.11384, 'liquidity': '2500000'},\n",
       "    {'price': 1.11383, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '5000000'},\n",
       "    {'price': 1.11379, 'liquidity': '10000000'},\n",
       "    {'price': 1.11376, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11393, 'liquidity': '500000'},\n",
       "    {'price': 1.11394, 'liquidity': '500000'},\n",
       "    {'price': 1.11395, 'liquidity': '2000000'},\n",
       "    {'price': 1.11396, 'liquidity': '2000000'},\n",
       "    {'price': 1.11397, 'liquidity': '5000000'},\n",
       "    {'price': 1.11399, 'liquidity': '10000000'},\n",
       "    {'price': 1.11402, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.11376,\n",
       "   'closeoutAsk': 1.11402},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98020.4389',\n",
       "  'tradeOpened': {'tradeID': '532',\n",
       "   'units': '100000.0',\n",
       "   'price': 1.11393,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '3.591',\n",
       "   'initialMarginRequired': '3333.3333'},\n",
       "  'halfSpreadCost': '3.591'},\n",
       " {'id': '533',\n",
       "  'time': '2024-09-18T13:33:14.095307993Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '531',\n",
       "  'requestID': '97314156312956866',\n",
       "  'type': 'STOP_LOSS_ORDER',\n",
       "  'tradeID': '532',\n",
       "  'price': 1.01393,\n",
       "  'distance': '0.1',\n",
       "  'timeInForce': 'GTC',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'ON_FILL'},\n",
       " {'id': '534',\n",
       "  'time': '2024-09-18T13:33:15.543790295Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '534',\n",
       "  'requestID': '115328554825894873',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '535',\n",
       "  'time': '2024-09-18T13:33:15.543790295Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '534',\n",
       "  'requestID': '115328554825894873',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '534',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893265945407',\n",
       "  'lossQuoteHomeConversionFactor': '0.902243492597',\n",
       "  'price': 1.11385,\n",
       "  'fullVWAP': 1.11385,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11385, 'liquidity': '500000'},\n",
       "    {'price': 1.11384, 'liquidity': '2500000'},\n",
       "    {'price': 1.11383, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '5000000'},\n",
       "    {'price': 1.11379, 'liquidity': '10000000'},\n",
       "    {'price': 1.11376, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11393, 'liquidity': '400000'},\n",
       "    {'price': 1.11394, 'liquidity': '500000'},\n",
       "    {'price': 1.11395, 'liquidity': '2000000'},\n",
       "    {'price': 1.11396, 'liquidity': '2000000'},\n",
       "    {'price': 1.11397, 'liquidity': '5000000'},\n",
       "    {'price': 1.11399, 'liquidity': '10000000'},\n",
       "    {'price': 1.11402, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.11376,\n",
       "   'closeoutAsk': 1.11402},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '2014.5827',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '100035.0216',\n",
       "  'tradesClosed': [{'tradeID': '216',\n",
       "    'units': '-70000.0',\n",
       "    'price': 1.11385,\n",
       "    'realizedPL': '1396.8893',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '2.5137'},\n",
       "   {'tradeID': '222',\n",
       "    'units': '-10000.0',\n",
       "    'price': 1.11385,\n",
       "    'realizedPL': '206.4338',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '0.3591'},\n",
       "   {'tradeID': '226',\n",
       "    'units': '-20000.0',\n",
       "    'price': 1.11385,\n",
       "    'realizedPL': '411.2596',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '0.7182'}],\n",
       "  'halfSpreadCost': '3.591'},\n",
       " {'id': '536',\n",
       "  'time': '2024-09-18T13:33:16.047734797Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '536',\n",
       "  'requestID': '97314156321347471',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '537',\n",
       "  'time': '2024-09-18T13:33:16.047734797Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '536',\n",
       "  'requestID': '97314156321347471',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '536',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893265945407',\n",
       "  'lossQuoteHomeConversionFactor': '0.902243492597',\n",
       "  'price': 1.11393,\n",
       "  'fullVWAP': 1.11393,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11385, 'liquidity': '400000'},\n",
       "    {'price': 1.11384, 'liquidity': '2500000'},\n",
       "    {'price': 1.11383, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '5000000'},\n",
       "    {'price': 1.11379, 'liquidity': '10000000'},\n",
       "    {'price': 1.11376, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11393, 'liquidity': '400000'},\n",
       "    {'price': 1.11394, 'liquidity': '500000'},\n",
       "    {'price': 1.11395, 'liquidity': '2000000'},\n",
       "    {'price': 1.11396, 'liquidity': '2000000'},\n",
       "    {'price': 1.11397, 'liquidity': '5000000'},\n",
       "    {'price': 1.11399, 'liquidity': '10000000'},\n",
       "    {'price': 1.11402, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.11376,\n",
       "   'closeoutAsk': 1.11402},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '100035.0216',\n",
       "  'tradeOpened': {'tradeID': '537',\n",
       "   'units': '100000.0',\n",
       "   'price': 1.11393,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '3.591',\n",
       "   'initialMarginRequired': '3333.3333'},\n",
       "  'halfSpreadCost': '3.591'},\n",
       " {'id': '538',\n",
       "  'time': '2024-09-18T13:33:16.278250857Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '538',\n",
       "  'requestID': '97314156321347721',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '539',\n",
       "  'time': '2024-09-18T13:33:16.278250857Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '538',\n",
       "  'requestID': '97314156321347721',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '538',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893265945407',\n",
       "  'lossQuoteHomeConversionFactor': '0.902243492597',\n",
       "  'price': 1.11385,\n",
       "  'fullVWAP': 1.11385,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11385, 'liquidity': '400000'},\n",
       "    {'price': 1.11384, 'liquidity': '2500000'},\n",
       "    {'price': 1.11383, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '5000000'},\n",
       "    {'price': 1.11379, 'liquidity': '10000000'},\n",
       "    {'price': 1.11376, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11393, 'liquidity': '300000'},\n",
       "    {'price': 1.11394, 'liquidity': '500000'},\n",
       "    {'price': 1.11395, 'liquidity': '2000000'},\n",
       "    {'price': 1.11396, 'liquidity': '2000000'},\n",
       "    {'price': 1.11397, 'liquidity': '5000000'},\n",
       "    {'price': 1.11399, 'liquidity': '10000000'},\n",
       "    {'price': 1.11402, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.11376,\n",
       "   'closeoutAsk': 1.11402},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '-7.2179',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '100027.8037',\n",
       "  'tradesClosed': [{'tradeID': '532',\n",
       "    'units': '-100000.0',\n",
       "    'price': 1.11385,\n",
       "    'realizedPL': '-7.2179',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '3.591'}],\n",
       "  'halfSpreadCost': '3.591'},\n",
       " {'id': '540',\n",
       "  'time': '2024-09-18T13:33:16.278250857Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '538',\n",
       "  'requestID': '97314156321347721',\n",
       "  'type': 'ORDER_CANCEL',\n",
       "  'orderID': '533',\n",
       "  'reason': 'LINKED_TRADE_CLOSED'},\n",
       " {'id': '541',\n",
       "  'time': '2024-09-18T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '541',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-7.1233',\n",
       "  'accountBalance': '100020.6804',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-7.1233',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-7.1233'}]}]},\n",
       " {'id': '542',\n",
       "  'time': '2024-09-19T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '542',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7945',\n",
       "  'accountBalance': '100013.8859',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7945',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7945'}]}]},\n",
       " {'id': '543',\n",
       "  'time': '2024-09-20T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '543',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7123',\n",
       "  'accountBalance': '100007.1736',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7123',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7123'}]}]},\n",
       " {'id': '544',\n",
       "  'time': '2024-09-21T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '544',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '100007.1736',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '0.0'}]}]},\n",
       " {'id': '545',\n",
       "  'time': '2024-09-22T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '545',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '100007.1736',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '0.0'}]}]},\n",
       " {'id': '546',\n",
       "  'time': '2024-09-23T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '546',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7123',\n",
       "  'accountBalance': '100000.4613',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7123',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7123'}]}]},\n",
       " {'id': '547',\n",
       "  'time': '2024-09-24T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '547',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6849',\n",
       "  'accountBalance': '99993.7764',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6849'}]}]},\n",
       " {'id': '548',\n",
       "  'time': '2024-09-25T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '548',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6849',\n",
       "  'accountBalance': '99987.0915',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6849'}]}]},\n",
       " {'id': '549',\n",
       "  'time': '2024-09-26T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '549',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.9041',\n",
       "  'accountBalance': '99980.1874',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.9041',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.9041'}]}]},\n",
       " {'id': '550',\n",
       "  'time': '2024-09-27T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '550',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6575',\n",
       "  'accountBalance': '99973.5299',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6575',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6575'}]}]},\n",
       " {'id': '551',\n",
       "  'time': '2024-09-28T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '551',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '99973.5299',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '0.0'}]}]},\n",
       " {'id': '552',\n",
       "  'time': '2024-09-29T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '552',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '99973.5299',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '0.0'}]}]},\n",
       " {'id': '553',\n",
       "  'time': '2024-09-30T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '553',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6849',\n",
       "  'accountBalance': '99966.845',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6849'}]}]},\n",
       " {'id': '554',\n",
       "  'time': '2024-10-01T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '554',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6849',\n",
       "  'accountBalance': '99960.1601',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6849'}]}]},\n",
       " {'id': '555',\n",
       "  'time': '2024-10-02T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '555',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7671',\n",
       "  'accountBalance': '99953.393',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7671',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7671'}]}]},\n",
       " {'id': '556',\n",
       "  'time': '2024-10-03T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '556',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7671',\n",
       "  'accountBalance': '99946.6259',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7671',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7671'}]}]},\n",
       " {'id': '557',\n",
       "  'time': '2024-10-04T07:17:56.076672210Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '557',\n",
       "  'requestID': '97319860071988230',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '1000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '558',\n",
       "  'time': '2024-10-04T07:17:56.076672210Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '557',\n",
       "  'requestID': '97319860071988230',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '557',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '1000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.902052514173',\n",
       "  'lossQuoteHomeConversionFactor': '0.911118368587',\n",
       "  'price': 1.10309,\n",
       "  'fullVWAP': 1.10309,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.10299, 'liquidity': '500000'},\n",
       "    {'price': 1.10298, 'liquidity': '2500000'},\n",
       "    {'price': 1.10297, 'liquidity': '2000000'},\n",
       "    {'price': 1.10296, 'liquidity': '5000000'},\n",
       "    {'price': 1.10293, 'liquidity': '10000000'},\n",
       "    {'price': 1.1029, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.10309, 'liquidity': '500000'},\n",
       "    {'price': 1.1031, 'liquidity': '500000'},\n",
       "    {'price': 1.10311, 'liquidity': '2000000'},\n",
       "    {'price': 1.10312, 'liquidity': '2000000'},\n",
       "    {'price': 1.10313, 'liquidity': '5000000'},\n",
       "    {'price': 1.10315, 'liquidity': '10000000'},\n",
       "    {'price': 1.10318, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.1029,\n",
       "   'closeoutAsk': 1.10318},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '99946.6259',\n",
       "  'tradeOpened': {'tradeID': '558',\n",
       "   'units': '1000.0',\n",
       "   'price': 1.10309,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '0.0453',\n",
       "   'initialMarginRequired': '33.3333'},\n",
       "  'halfSpreadCost': '0.0453'},\n",
       " {'id': '559',\n",
       "  'time': '2024-10-04T07:23:17.752248211Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '559',\n",
       "  'requestID': '97319861418583296',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-101000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'REDUCE_ONLY',\n",
       "  'longPositionCloseout': {'instrument': 'EUR_USD', 'units': 'ALL'},\n",
       "  'reason': 'POSITION_CLOSEOUT'},\n",
       " {'id': '560',\n",
       "  'time': '2024-10-04T07:23:17.752248211Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '559',\n",
       "  'requestID': '97319861418583296',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '559',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-101000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.902032070556',\n",
       "  'lossQuoteHomeConversionFactor': '0.911097719507',\n",
       "  'price': 1.10301,\n",
       "  'fullVWAP': 1.10301,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.10301, 'liquidity': '500000'},\n",
       "    {'price': 1.103, 'liquidity': '2500000'},\n",
       "    {'price': 1.10299, 'liquidity': '2000000'},\n",
       "    {'price': 1.10298, 'liquidity': '5000000'},\n",
       "    {'price': 1.10295, 'liquidity': '10000000'},\n",
       "    {'price': 1.10292, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.10312, 'liquidity': '500000'},\n",
       "    {'price': 1.10313, 'liquidity': '500000'},\n",
       "    {'price': 1.10314, 'liquidity': '2000000'},\n",
       "    {'price': 1.10315, 'liquidity': '2000000'},\n",
       "    {'price': 1.10316, 'liquidity': '5000000'},\n",
       "    {'price': 1.10318, 'liquidity': '10000000'},\n",
       "    {'price': 1.10321, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.10292,\n",
       "   'closeoutAsk': 1.10321},\n",
       "  'reason': 'MARKET_ORDER_POSITION_CLOSEOUT',\n",
       "  'pl': '-994.9916',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98951.6343',\n",
       "  'tradesClosed': [{'tradeID': '537',\n",
       "    'units': '-100000.0',\n",
       "    'price': 1.10301,\n",
       "    'realizedPL': '-994.9187',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '4.9861'},\n",
       "   {'tradeID': '558',\n",
       "    'units': '-1000.0',\n",
       "    'price': 1.10301,\n",
       "    'realizedPL': '-0.0729',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '0.0499'}],\n",
       "  'halfSpreadCost': '5.036'},\n",
       " {'id': '561',\n",
       "  'time': '2024-10-04T07:26:32.556639316Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '561',\n",
       "  'requestID': '97319862236606914',\n",
       "  'type': 'LIMIT_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-50000.0',\n",
       "  'price': 1.1034,\n",
       "  'timeInForce': 'GTD',\n",
       "  'gtdTime': '2024-10-11T07:25:39.000000000Z',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '562',\n",
       "  'time': '2024-10-04T07:26:42.465007999Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '562',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '561',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-50000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.901717344695',\n",
       "  'lossQuoteHomeConversionFactor': '0.910779830572',\n",
       "  'price': 1.10341,\n",
       "  'fullVWAP': 1.10341,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.10341, 'liquidity': '500000'},\n",
       "    {'price': 1.1034, 'liquidity': '2500000'},\n",
       "    {'price': 1.10339, 'liquidity': '2000000'},\n",
       "    {'price': 1.10338, 'liquidity': '5000000'},\n",
       "    {'price': 1.10335, 'liquidity': '10000000'},\n",
       "    {'price': 1.10332, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.10349, 'liquidity': '500000'},\n",
       "    {'price': 1.1035, 'liquidity': '500000'},\n",
       "    {'price': 1.10351, 'liquidity': '2000000'},\n",
       "    {'price': 1.10352, 'liquidity': '2000000'},\n",
       "    {'price': 1.10353, 'liquidity': '5000000'},\n",
       "    {'price': 1.10355, 'liquidity': '10000000'},\n",
       "    {'price': 1.10358, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.10332,\n",
       "   'closeoutAsk': 1.10358},\n",
       "  'reason': 'LIMIT_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98951.6343',\n",
       "  'tradeOpened': {'tradeID': '562',\n",
       "   'units': '-50000.0',\n",
       "   'price': 1.10341,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '1.8125',\n",
       "   'initialMarginRequired': '1666.6667'},\n",
       "  'halfSpreadCost': '1.8125'},\n",
       " {'id': '563',\n",
       "  'time': '2024-10-04T07:31:47.613577312Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '563',\n",
       "  'requestID': '61291066539621114',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'BTC_USD',\n",
       "  'units': '0.1',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'takeProfitOnFill': {'price': 61400.0, 'timeInForce': 'GTC'},\n",
       "  'stopLossOnFill': {'price': 61200.0, 'timeInForce': 'GTC'}},\n",
       " {'id': '564',\n",
       "  'time': '2024-10-04T07:31:47.613577312Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '563',\n",
       "  'requestID': '61291066539621114',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '563',\n",
       "  'instrument': 'BTC_USD',\n",
       "  'units': '0.1',\n",
       "  'gainQuoteHomeConversionFactor': '0.9018195055',\n",
       "  'lossQuoteHomeConversionFactor': '0.910883018118',\n",
       "  'price': 61298.8,\n",
       "  'fullVWAP': 61298.8,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 61255.8, 'liquidity': '20'}],\n",
       "   'asks': [{'price': 61298.8, 'liquidity': '20'}],\n",
       "   'closeoutBid': 61255.8,\n",
       "   'closeoutAsk': 61298.8},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98951.6343',\n",
       "  'tradeOpened': {'tradeID': '564',\n",
       "   'units': '0.1',\n",
       "   'price': 61298.8,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '1.9487',\n",
       "   'initialMarginRequired': '2776.94'},\n",
       "  'halfSpreadCost': '1.9487'},\n",
       " {'id': '565',\n",
       "  'time': '2024-10-04T07:31:47.613577312Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '563',\n",
       "  'requestID': '61291066539621114',\n",
       "  'type': 'TAKE_PROFIT_ORDER',\n",
       "  'tradeID': '564',\n",
       "  'price': 61400.0,\n",
       "  'timeInForce': 'GTC',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'ON_FILL'},\n",
       " {'id': '566',\n",
       "  'time': '2024-10-04T07:31:47.613577312Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '563',\n",
       "  'requestID': '61291066539621114',\n",
       "  'type': 'STOP_LOSS_ORDER',\n",
       "  'tradeID': '564',\n",
       "  'price': 61200.0,\n",
       "  'timeInForce': 'GTC',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'ON_FILL'},\n",
       " {'id': '567',\n",
       "  'time': '2024-10-04T07:45:54.872225381Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '567',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '565',\n",
       "  'instrument': 'BTC_USD',\n",
       "  'units': '-0.1',\n",
       "  'gainQuoteHomeConversionFactor': '0.901958479005',\n",
       "  'lossQuoteHomeConversionFactor': '0.911023388342',\n",
       "  'price': 61412.0,\n",
       "  'fullVWAP': 61412.0,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 61412.0, 'liquidity': '20'}],\n",
       "   'asks': [{'price': 61455.0, 'liquidity': '20'}],\n",
       "   'closeoutBid': 61412.0,\n",
       "   'closeoutAsk': 61455.0},\n",
       "  'reason': 'TAKE_PROFIT_ORDER',\n",
       "  'pl': '10.2102',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98961.8445',\n",
       "  'tradesClosed': [{'tradeID': '564',\n",
       "    'units': '-0.1',\n",
       "    'price': 61412.0,\n",
       "    'realizedPL': '10.2102',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '1.949'}],\n",
       "  'halfSpreadCost': '1.949'},\n",
       " {'id': '568',\n",
       "  'time': '2024-10-04T07:45:54.872225381Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '567',\n",
       "  'type': 'ORDER_CANCEL',\n",
       "  'orderID': '566',\n",
       "  'reason': 'LINKED_TRADE_CLOSED'},\n",
       " {'id': '569',\n",
       "  'time': '2024-10-04T07:49:23.535866641Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '569',\n",
       "  'requestID': '61291070965264994',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '50000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'REDUCE_ONLY',\n",
       "  'shortPositionCloseout': {'instrument': 'EUR_USD', 'units': 'ALL'},\n",
       "  'reason': 'POSITION_CLOSEOUT'},\n",
       " {'id': '570',\n",
       "  'time': '2024-10-04T07:49:23.535866641Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '569',\n",
       "  'requestID': '61291070965264994',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '569',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '50000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.902248824818',\n",
       "  'lossQuoteHomeConversionFactor': '0.911316652203',\n",
       "  'price': 1.10284,\n",
       "  'fullVWAP': 1.10284,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.10276, 'liquidity': '500000'},\n",
       "    {'price': 1.10275, 'liquidity': '2500000'},\n",
       "    {'price': 1.10274, 'liquidity': '2000000'},\n",
       "    {'price': 1.10273, 'liquidity': '5000000'},\n",
       "    {'price': 1.1027, 'liquidity': '10000000'},\n",
       "    {'price': 1.10267, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.10284, 'liquidity': '500000'},\n",
       "    {'price': 1.10285, 'liquidity': '500000'},\n",
       "    {'price': 1.10286, 'liquidity': '2000000'},\n",
       "    {'price': 1.10287, 'liquidity': '2000000'},\n",
       "    {'price': 1.10288, 'liquidity': '5000000'},\n",
       "    {'price': 1.1029, 'liquidity': '10000000'},\n",
       "    {'price': 1.10293, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.10267,\n",
       "   'closeoutAsk': 1.10293},\n",
       "  'reason': 'MARKET_ORDER_POSITION_CLOSEOUT',\n",
       "  'pl': '25.7141',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98987.5586',\n",
       "  'tradesClosed': [{'tradeID': '562',\n",
       "    'units': '50000.0',\n",
       "    'price': 1.10284,\n",
       "    'realizedPL': '25.7141',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '1.8136'}],\n",
       "  'halfSpreadCost': '1.8136'},\n",
       " {'id': '571',\n",
       "  'time': '2024-10-08T13:58:36.026877844Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '571',\n",
       "  'requestID': '61292613435041729',\n",
       "  'type': 'LIMIT_ORDER_REJECT',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'price': 1.12999999999999,\n",
       "  'timeInForce': 'GTC',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'takeProfitOnFill': {'price': 1.17999999999999, 'timeInForce': 'GTC'},\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'},\n",
       "  'rejectReason': 'PRICE_PRECISION_EXCEEDED'}]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_transactions(tid = 486-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 530 | 2024-09-18T13:31:47.87 | EUR_USD | -100000.0 | 1981.5307\n",
      " 532 | 2024-09-18T13:33:14.09 | EUR_USD | 100000.0 |      0.0\n",
      " 535 | 2024-09-18T13:33:15.54 | EUR_USD | -100000.0 | 2014.5827\n",
      " 537 | 2024-09-18T13:33:16.04 | EUR_USD | 100000.0 |      0.0\n",
      " 539 | 2024-09-18T13:33:16.27 | EUR_USD | -100000.0 |  -7.2179\n",
      " 558 | 2024-10-04T07:17:56.07 | EUR_USD |   1000.0 |      0.0\n",
      " 560 | 2024-10-04T07:23:17.75 | EUR_USD | -101000.0 | -994.9916\n",
      " 562 | 2024-10-04T07:26:42.46 | EUR_USD | -50000.0 |      0.0\n",
      " 564 | 2024-10-04T07:31:47.61 | BTC_USD |      0.1 |      0.0\n",
      " 567 | 2024-10-04T07:45:54.87 | BTC_USD |     -0.1 |  10.2102\n",
      " 570 | 2024-10-04T07:49:23.53 | EUR_USD |  50000.0 |  25.7141\n"
     ]
    }
   ],
   "source": [
    "api.print_transactions(tid = 486-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      " {'id': '573', 'time': '2024-10-08T13:58:36.684029330Z', 'userID': 27030320, 'accountID': '101-011-27030320-002', 'batchID': '572', 'requestID': '97321410454328518', 'type': 'ORDER_FILL', 'orderID': '572', 'instrument': 'EUR_USD', 'units': '-100000.0', 'gainQuoteHomeConversionFactor': '0.906374688266', 'lossQuoteHomeConversionFactor': '0.915483981615', 'price': 1.09773, 'fullVWAP': 1.09773, 'fullPrice': {'type': 'PRICE', 'bids': [{'price': 1.09773, 'liquidity': '500000'}, {'price': 1.09772, 'liquidity': '2500000'}, {'price': 1.09771, 'liquidity': '2000000'}, {'price': 1.0977, 'liquidity': '5000000'}, {'price': 1.09767, 'liquidity': '10000000'}, {'price': 1.09764, 'liquidity': '10000000'}], 'asks': [{'price': 1.09783, 'liquidity': '500000'}, {'price': 1.09784, 'liquidity': '500000'}, {'price': 1.09785, 'liquidity': '2000000'}, {'price': 1.09786, 'liquidity': '2000000'}, {'price': 1.09787, 'liquidity': '5000000'}, {'price': 1.09789, 'liquidity': '10000000'}, {'price': 1.09792, 'liquidity': '10000000'}], 'closeoutBid': 1.09764, 'closeoutAsk': 1.09792}, 'reason': 'MARKET_ORDER', 'pl': '0.0', 'financing': '0.0', 'commission': '0.0', 'guaranteedExecutionFee': '0.0', 'accountBalance': '98987.5586', 'tradeOpened': {'tradeID': '573', 'units': '-100000.0', 'price': 1.09773, 'guaranteedExecutionFee': '0.0', 'halfSpreadCost': '4.5546', 'initialMarginRequired': '3333.3333'}, 'halfSpreadCost': '4.5546'} \n",
      "\n"
     ]
    }
   ],
   "source": [
    "api.create_order(instrument = \"EUR_USD\", units = -100000, sl_distance= 0.1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': '486',\n",
       "  'time': '2024-08-07T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '486',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6301',\n",
       "  'accountBalance': '96451.3461',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6301',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4356'},\n",
       "     {'tradeID': '222', 'financing': '-0.7315'},\n",
       "     {'tradeID': '226', 'financing': '-1.463'}]}]},\n",
       " {'id': '487',\n",
       "  'time': '2024-08-08T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '487',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96436.7708',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '488',\n",
       "  'time': '2024-08-09T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '488',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6301',\n",
       "  'accountBalance': '96422.1407',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6301',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4356'},\n",
       "     {'tradeID': '222', 'financing': '-0.7315'},\n",
       "     {'tradeID': '226', 'financing': '-1.463'}]}]},\n",
       " {'id': '489',\n",
       "  'time': '2024-08-10T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '489',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96422.1407',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '490',\n",
       "  'time': '2024-08-11T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '490',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96422.1407',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '491',\n",
       "  'time': '2024-08-12T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '491',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96407.4558',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '492',\n",
       "  'time': '2024-08-13T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '492',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96392.7709',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '493',\n",
       "  'time': '2024-08-14T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '493',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96378.086',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '494',\n",
       "  'time': '2024-08-15T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '494',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96363.4011',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '495',\n",
       "  'time': '2024-08-16T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '495',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96348.7162',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '496',\n",
       "  'time': '2024-08-17T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '496',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96348.7162',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '497',\n",
       "  'time': '2024-08-18T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '497',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96348.7162',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '498',\n",
       "  'time': '2024-08-19T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '498',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96334.0313',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '499',\n",
       "  'time': '2024-08-20T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '499',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96319.3464',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '500',\n",
       "  'time': '2024-08-21T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '500',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96304.7711',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '501',\n",
       "  'time': '2024-08-22T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '501',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96290.1958',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '502',\n",
       "  'time': '2024-08-23T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '502',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6301',\n",
       "  'accountBalance': '96275.5657',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6301',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4356'},\n",
       "     {'tradeID': '222', 'financing': '-0.7315'},\n",
       "     {'tradeID': '226', 'financing': '-1.463'}]}]},\n",
       " {'id': '503',\n",
       "  'time': '2024-08-24T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '503',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96275.5657',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '504',\n",
       "  'time': '2024-08-25T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '504',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96275.5657',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '505',\n",
       "  'time': '2024-08-26T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '505',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96260.9904',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '506',\n",
       "  'time': '2024-08-27T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '506',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.5753',\n",
       "  'accountBalance': '96246.4151',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.5753',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.389'},\n",
       "     {'tradeID': '222', 'financing': '-0.7288'},\n",
       "     {'tradeID': '226', 'financing': '-1.4575'}]}]},\n",
       " {'id': '507',\n",
       "  'time': '2024-08-28T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '507',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-15.1781',\n",
       "  'accountBalance': '96231.237',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-15.1781',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.9014'},\n",
       "     {'tradeID': '222', 'financing': '-0.7589'},\n",
       "     {'tradeID': '226', 'financing': '-1.5178'}]}]},\n",
       " {'id': '508',\n",
       "  'time': '2024-08-29T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '508',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96231.237',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '509',\n",
       "  'time': '2024-08-30T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '509',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96216.5521',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '510',\n",
       "  'time': '2024-08-31T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '510',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96216.5521',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '511',\n",
       "  'time': '2024-09-01T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '511',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96216.5521',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '512',\n",
       "  'time': '2024-09-02T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '512',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.7945',\n",
       "  'accountBalance': '96201.7576',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.7945',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.5753'},\n",
       "     {'tradeID': '222', 'financing': '-0.7397'},\n",
       "     {'tradeID': '226', 'financing': '-1.4795'}]}]},\n",
       " {'id': '513',\n",
       "  'time': '2024-09-03T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '513',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96187.0727',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '514',\n",
       "  'time': '2024-09-04T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '514',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96172.3878',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '515',\n",
       "  'time': '2024-09-05T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '515',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96157.7029',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '516',\n",
       "  'time': '2024-09-06T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '516',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96143.018',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '517',\n",
       "  'time': '2024-09-07T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '517',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96143.018',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '518',\n",
       "  'time': '2024-09-08T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '518',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96143.018',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '519',\n",
       "  'time': '2024-09-09T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '519',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.7398',\n",
       "  'accountBalance': '96128.2782',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.7398',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.5288'},\n",
       "     {'tradeID': '222', 'financing': '-0.737'},\n",
       "     {'tradeID': '226', 'financing': '-1.474'}]}]},\n",
       " {'id': '520',\n",
       "  'time': '2024-09-10T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '520',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.7398',\n",
       "  'accountBalance': '96113.5384',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.7398',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.5288'},\n",
       "     {'tradeID': '222', 'financing': '-0.737'},\n",
       "     {'tradeID': '226', 'financing': '-1.474'}]}]},\n",
       " {'id': '521',\n",
       "  'time': '2024-09-11T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '521',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.7398',\n",
       "  'accountBalance': '96098.7986',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.7398',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.5288'},\n",
       "     {'tradeID': '222', 'financing': '-0.737'},\n",
       "     {'tradeID': '226', 'financing': '-1.474'}]}]},\n",
       " {'id': '522',\n",
       "  'time': '2024-09-12T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '522',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96084.1137',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '523',\n",
       "  'time': '2024-09-13T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '523',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.6849',\n",
       "  'accountBalance': '96069.4288',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.4822'},\n",
       "     {'tradeID': '222', 'financing': '-0.7342'},\n",
       "     {'tradeID': '226', 'financing': '-1.4685'}]}]},\n",
       " {'id': '524',\n",
       "  'time': '2024-09-14T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '524',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96069.4288',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '525',\n",
       "  'time': '2024-09-15T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '525',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '96069.4288',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '0.0'},\n",
       "     {'tradeID': '222', 'financing': '0.0'},\n",
       "     {'tradeID': '226', 'financing': '0.0'}]}]},\n",
       " {'id': '526',\n",
       "  'time': '2024-09-16T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '526',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-16.274',\n",
       "  'accountBalance': '96053.1548',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-16.274',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-13.8329'},\n",
       "     {'tradeID': '222', 'financing': '-0.8137'},\n",
       "     {'tradeID': '226', 'financing': '-1.6274'}]}]},\n",
       " {'id': '527',\n",
       "  'time': '2024-09-17T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '527',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-14.2466',\n",
       "  'accountBalance': '96038.9082',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-14.2466',\n",
       "    'openTradeFinancings': [{'tradeID': '216', 'financing': '-12.1096'},\n",
       "     {'tradeID': '222', 'financing': '-0.7123'},\n",
       "     {'tradeID': '226', 'financing': '-1.4247'}]}]},\n",
       " {'id': '528',\n",
       "  'time': '2024-09-18T13:31:47.257349390Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '528',\n",
       "  'requestID': '115328554456699880',\n",
       "  'type': 'LIMIT_ORDER_REJECT',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'price': 1.12999999999999,\n",
       "  'timeInForce': 'GTC',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'takeProfitOnFill': {'price': 1.17999999999999, 'timeInForce': 'GTC'},\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'},\n",
       "  'rejectReason': 'PRICE_PRECISION_EXCEEDED'},\n",
       " {'id': '529',\n",
       "  'time': '2024-09-18T13:31:47.872579665Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '529',\n",
       "  'requestID': '61285358927666206',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'}},\n",
       " {'id': '530',\n",
       "  'time': '2024-09-18T13:31:47.872579665Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '529',\n",
       "  'requestID': '61285358927666206',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '529',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893386252746',\n",
       "  'lossQuoteHomeConversionFactor': '0.902365009055',\n",
       "  'price': 1.11369,\n",
       "  'fullVWAP': 1.11369,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11369, 'liquidity': '500000'},\n",
       "    {'price': 1.11368, 'liquidity': '2500000'},\n",
       "    {'price': 1.11367, 'liquidity': '2000000'},\n",
       "    {'price': 1.11366, 'liquidity': '5000000'},\n",
       "    {'price': 1.11363, 'liquidity': '10000000'},\n",
       "    {'price': 1.1136, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11379, 'liquidity': '500000'},\n",
       "    {'price': 1.1138, 'liquidity': '500000'},\n",
       "    {'price': 1.11381, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '2000000'},\n",
       "    {'price': 1.11383, 'liquidity': '5000000'},\n",
       "    {'price': 1.11385, 'liquidity': '10000000'},\n",
       "    {'price': 1.11388, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.1136,\n",
       "   'closeoutAsk': 1.11388},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '1981.5307',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98020.4389',\n",
       "  'tradeReduced': {'tradeID': '216',\n",
       "   'units': '-100000.0',\n",
       "   'price': 1.11369,\n",
       "   'realizedPL': '1981.5307',\n",
       "   'financing': '0.0',\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '4.4894'},\n",
       "  'halfSpreadCost': '4.4894'},\n",
       " {'id': '531',\n",
       "  'time': '2024-09-18T13:33:14.095307993Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '531',\n",
       "  'requestID': '97314156312956866',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'}},\n",
       " {'id': '532',\n",
       "  'time': '2024-09-18T13:33:14.095307993Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '531',\n",
       "  'requestID': '97314156312956866',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '531',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893265945407',\n",
       "  'lossQuoteHomeConversionFactor': '0.902243492597',\n",
       "  'price': 1.11393,\n",
       "  'fullVWAP': 1.11393,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11385, 'liquidity': '500000'},\n",
       "    {'price': 1.11384, 'liquidity': '2500000'},\n",
       "    {'price': 1.11383, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '5000000'},\n",
       "    {'price': 1.11379, 'liquidity': '10000000'},\n",
       "    {'price': 1.11376, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11393, 'liquidity': '500000'},\n",
       "    {'price': 1.11394, 'liquidity': '500000'},\n",
       "    {'price': 1.11395, 'liquidity': '2000000'},\n",
       "    {'price': 1.11396, 'liquidity': '2000000'},\n",
       "    {'price': 1.11397, 'liquidity': '5000000'},\n",
       "    {'price': 1.11399, 'liquidity': '10000000'},\n",
       "    {'price': 1.11402, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.11376,\n",
       "   'closeoutAsk': 1.11402},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98020.4389',\n",
       "  'tradeOpened': {'tradeID': '532',\n",
       "   'units': '100000.0',\n",
       "   'price': 1.11393,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '3.591',\n",
       "   'initialMarginRequired': '3333.3333'},\n",
       "  'halfSpreadCost': '3.591'},\n",
       " {'id': '533',\n",
       "  'time': '2024-09-18T13:33:14.095307993Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '531',\n",
       "  'requestID': '97314156312956866',\n",
       "  'type': 'STOP_LOSS_ORDER',\n",
       "  'tradeID': '532',\n",
       "  'price': 1.01393,\n",
       "  'distance': '0.1',\n",
       "  'timeInForce': 'GTC',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'ON_FILL'},\n",
       " {'id': '534',\n",
       "  'time': '2024-09-18T13:33:15.543790295Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '534',\n",
       "  'requestID': '115328554825894873',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '535',\n",
       "  'time': '2024-09-18T13:33:15.543790295Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '534',\n",
       "  'requestID': '115328554825894873',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '534',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893265945407',\n",
       "  'lossQuoteHomeConversionFactor': '0.902243492597',\n",
       "  'price': 1.11385,\n",
       "  'fullVWAP': 1.11385,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11385, 'liquidity': '500000'},\n",
       "    {'price': 1.11384, 'liquidity': '2500000'},\n",
       "    {'price': 1.11383, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '5000000'},\n",
       "    {'price': 1.11379, 'liquidity': '10000000'},\n",
       "    {'price': 1.11376, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11393, 'liquidity': '400000'},\n",
       "    {'price': 1.11394, 'liquidity': '500000'},\n",
       "    {'price': 1.11395, 'liquidity': '2000000'},\n",
       "    {'price': 1.11396, 'liquidity': '2000000'},\n",
       "    {'price': 1.11397, 'liquidity': '5000000'},\n",
       "    {'price': 1.11399, 'liquidity': '10000000'},\n",
       "    {'price': 1.11402, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.11376,\n",
       "   'closeoutAsk': 1.11402},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '2014.5827',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '100035.0216',\n",
       "  'tradesClosed': [{'tradeID': '216',\n",
       "    'units': '-70000.0',\n",
       "    'price': 1.11385,\n",
       "    'realizedPL': '1396.8893',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '2.5137'},\n",
       "   {'tradeID': '222',\n",
       "    'units': '-10000.0',\n",
       "    'price': 1.11385,\n",
       "    'realizedPL': '206.4338',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '0.3591'},\n",
       "   {'tradeID': '226',\n",
       "    'units': '-20000.0',\n",
       "    'price': 1.11385,\n",
       "    'realizedPL': '411.2596',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '0.7182'}],\n",
       "  'halfSpreadCost': '3.591'},\n",
       " {'id': '536',\n",
       "  'time': '2024-09-18T13:33:16.047734797Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '536',\n",
       "  'requestID': '97314156321347471',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '537',\n",
       "  'time': '2024-09-18T13:33:16.047734797Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '536',\n",
       "  'requestID': '97314156321347471',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '536',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893265945407',\n",
       "  'lossQuoteHomeConversionFactor': '0.902243492597',\n",
       "  'price': 1.11393,\n",
       "  'fullVWAP': 1.11393,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11385, 'liquidity': '400000'},\n",
       "    {'price': 1.11384, 'liquidity': '2500000'},\n",
       "    {'price': 1.11383, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '5000000'},\n",
       "    {'price': 1.11379, 'liquidity': '10000000'},\n",
       "    {'price': 1.11376, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11393, 'liquidity': '400000'},\n",
       "    {'price': 1.11394, 'liquidity': '500000'},\n",
       "    {'price': 1.11395, 'liquidity': '2000000'},\n",
       "    {'price': 1.11396, 'liquidity': '2000000'},\n",
       "    {'price': 1.11397, 'liquidity': '5000000'},\n",
       "    {'price': 1.11399, 'liquidity': '10000000'},\n",
       "    {'price': 1.11402, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.11376,\n",
       "   'closeoutAsk': 1.11402},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '100035.0216',\n",
       "  'tradeOpened': {'tradeID': '537',\n",
       "   'units': '100000.0',\n",
       "   'price': 1.11393,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '3.591',\n",
       "   'initialMarginRequired': '3333.3333'},\n",
       "  'halfSpreadCost': '3.591'},\n",
       " {'id': '538',\n",
       "  'time': '2024-09-18T13:33:16.278250857Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '538',\n",
       "  'requestID': '97314156321347721',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '539',\n",
       "  'time': '2024-09-18T13:33:16.278250857Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '538',\n",
       "  'requestID': '97314156321347721',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '538',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.893265945407',\n",
       "  'lossQuoteHomeConversionFactor': '0.902243492597',\n",
       "  'price': 1.11385,\n",
       "  'fullVWAP': 1.11385,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.11385, 'liquidity': '400000'},\n",
       "    {'price': 1.11384, 'liquidity': '2500000'},\n",
       "    {'price': 1.11383, 'liquidity': '2000000'},\n",
       "    {'price': 1.11382, 'liquidity': '5000000'},\n",
       "    {'price': 1.11379, 'liquidity': '10000000'},\n",
       "    {'price': 1.11376, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.11393, 'liquidity': '300000'},\n",
       "    {'price': 1.11394, 'liquidity': '500000'},\n",
       "    {'price': 1.11395, 'liquidity': '2000000'},\n",
       "    {'price': 1.11396, 'liquidity': '2000000'},\n",
       "    {'price': 1.11397, 'liquidity': '5000000'},\n",
       "    {'price': 1.11399, 'liquidity': '10000000'},\n",
       "    {'price': 1.11402, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.11376,\n",
       "   'closeoutAsk': 1.11402},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '-7.2179',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '100027.8037',\n",
       "  'tradesClosed': [{'tradeID': '532',\n",
       "    'units': '-100000.0',\n",
       "    'price': 1.11385,\n",
       "    'realizedPL': '-7.2179',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '3.591'}],\n",
       "  'halfSpreadCost': '3.591'},\n",
       " {'id': '540',\n",
       "  'time': '2024-09-18T13:33:16.278250857Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '538',\n",
       "  'requestID': '97314156321347721',\n",
       "  'type': 'ORDER_CANCEL',\n",
       "  'orderID': '533',\n",
       "  'reason': 'LINKED_TRADE_CLOSED'},\n",
       " {'id': '541',\n",
       "  'time': '2024-09-18T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '541',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-7.1233',\n",
       "  'accountBalance': '100020.6804',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-7.1233',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-7.1233'}]}]},\n",
       " {'id': '542',\n",
       "  'time': '2024-09-19T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '542',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7945',\n",
       "  'accountBalance': '100013.8859',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7945',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7945'}]}]},\n",
       " {'id': '543',\n",
       "  'time': '2024-09-20T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '543',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7123',\n",
       "  'accountBalance': '100007.1736',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7123',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7123'}]}]},\n",
       " {'id': '544',\n",
       "  'time': '2024-09-21T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '544',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '100007.1736',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '0.0'}]}]},\n",
       " {'id': '545',\n",
       "  'time': '2024-09-22T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '545',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '100007.1736',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '0.0'}]}]},\n",
       " {'id': '546',\n",
       "  'time': '2024-09-23T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '546',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7123',\n",
       "  'accountBalance': '100000.4613',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7123',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7123'}]}]},\n",
       " {'id': '547',\n",
       "  'time': '2024-09-24T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '547',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6849',\n",
       "  'accountBalance': '99993.7764',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6849'}]}]},\n",
       " {'id': '548',\n",
       "  'time': '2024-09-25T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '548',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6849',\n",
       "  'accountBalance': '99987.0915',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6849'}]}]},\n",
       " {'id': '549',\n",
       "  'time': '2024-09-26T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '549',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.9041',\n",
       "  'accountBalance': '99980.1874',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.9041',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.9041'}]}]},\n",
       " {'id': '550',\n",
       "  'time': '2024-09-27T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '550',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6575',\n",
       "  'accountBalance': '99973.5299',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6575',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6575'}]}]},\n",
       " {'id': '551',\n",
       "  'time': '2024-09-28T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '551',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '99973.5299',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '0.0'}]}]},\n",
       " {'id': '552',\n",
       "  'time': '2024-09-29T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '552',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '0.0',\n",
       "  'accountBalance': '99973.5299',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '0.0',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '0.0'}]}]},\n",
       " {'id': '553',\n",
       "  'time': '2024-09-30T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '553',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6849',\n",
       "  'accountBalance': '99966.845',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6849'}]}]},\n",
       " {'id': '554',\n",
       "  'time': '2024-10-01T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '554',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.6849',\n",
       "  'accountBalance': '99960.1601',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.6849',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.6849'}]}]},\n",
       " {'id': '555',\n",
       "  'time': '2024-10-02T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '555',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7671',\n",
       "  'accountBalance': '99953.393',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7671',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7671'}]}]},\n",
       " {'id': '556',\n",
       "  'time': '2024-10-03T21:00:00.000000000Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '556',\n",
       "  'type': 'DAILY_FINANCING',\n",
       "  'financing': '-6.7671',\n",
       "  'accountBalance': '99946.6259',\n",
       "  'positionFinancings': [{'instrument': 'EUR_USD',\n",
       "    'financing': '-6.7671',\n",
       "    'openTradeFinancings': [{'tradeID': '537', 'financing': '-6.7671'}]}]},\n",
       " {'id': '557',\n",
       "  'time': '2024-10-04T07:17:56.076672210Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '557',\n",
       "  'requestID': '97319860071988230',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '1000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '558',\n",
       "  'time': '2024-10-04T07:17:56.076672210Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '557',\n",
       "  'requestID': '97319860071988230',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '557',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '1000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.902052514173',\n",
       "  'lossQuoteHomeConversionFactor': '0.911118368587',\n",
       "  'price': 1.10309,\n",
       "  'fullVWAP': 1.10309,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.10299, 'liquidity': '500000'},\n",
       "    {'price': 1.10298, 'liquidity': '2500000'},\n",
       "    {'price': 1.10297, 'liquidity': '2000000'},\n",
       "    {'price': 1.10296, 'liquidity': '5000000'},\n",
       "    {'price': 1.10293, 'liquidity': '10000000'},\n",
       "    {'price': 1.1029, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.10309, 'liquidity': '500000'},\n",
       "    {'price': 1.1031, 'liquidity': '500000'},\n",
       "    {'price': 1.10311, 'liquidity': '2000000'},\n",
       "    {'price': 1.10312, 'liquidity': '2000000'},\n",
       "    {'price': 1.10313, 'liquidity': '5000000'},\n",
       "    {'price': 1.10315, 'liquidity': '10000000'},\n",
       "    {'price': 1.10318, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.1029,\n",
       "   'closeoutAsk': 1.10318},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '99946.6259',\n",
       "  'tradeOpened': {'tradeID': '558',\n",
       "   'units': '1000.0',\n",
       "   'price': 1.10309,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '0.0453',\n",
       "   'initialMarginRequired': '33.3333'},\n",
       "  'halfSpreadCost': '0.0453'},\n",
       " {'id': '559',\n",
       "  'time': '2024-10-04T07:23:17.752248211Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '559',\n",
       "  'requestID': '97319861418583296',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-101000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'REDUCE_ONLY',\n",
       "  'longPositionCloseout': {'instrument': 'EUR_USD', 'units': 'ALL'},\n",
       "  'reason': 'POSITION_CLOSEOUT'},\n",
       " {'id': '560',\n",
       "  'time': '2024-10-04T07:23:17.752248211Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '559',\n",
       "  'requestID': '97319861418583296',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '559',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-101000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.902032070556',\n",
       "  'lossQuoteHomeConversionFactor': '0.911097719507',\n",
       "  'price': 1.10301,\n",
       "  'fullVWAP': 1.10301,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.10301, 'liquidity': '500000'},\n",
       "    {'price': 1.103, 'liquidity': '2500000'},\n",
       "    {'price': 1.10299, 'liquidity': '2000000'},\n",
       "    {'price': 1.10298, 'liquidity': '5000000'},\n",
       "    {'price': 1.10295, 'liquidity': '10000000'},\n",
       "    {'price': 1.10292, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.10312, 'liquidity': '500000'},\n",
       "    {'price': 1.10313, 'liquidity': '500000'},\n",
       "    {'price': 1.10314, 'liquidity': '2000000'},\n",
       "    {'price': 1.10315, 'liquidity': '2000000'},\n",
       "    {'price': 1.10316, 'liquidity': '5000000'},\n",
       "    {'price': 1.10318, 'liquidity': '10000000'},\n",
       "    {'price': 1.10321, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.10292,\n",
       "   'closeoutAsk': 1.10321},\n",
       "  'reason': 'MARKET_ORDER_POSITION_CLOSEOUT',\n",
       "  'pl': '-994.9916',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98951.6343',\n",
       "  'tradesClosed': [{'tradeID': '537',\n",
       "    'units': '-100000.0',\n",
       "    'price': 1.10301,\n",
       "    'realizedPL': '-994.9187',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '4.9861'},\n",
       "   {'tradeID': '558',\n",
       "    'units': '-1000.0',\n",
       "    'price': 1.10301,\n",
       "    'realizedPL': '-0.0729',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '0.0499'}],\n",
       "  'halfSpreadCost': '5.036'},\n",
       " {'id': '561',\n",
       "  'time': '2024-10-04T07:26:32.556639316Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '561',\n",
       "  'requestID': '97319862236606914',\n",
       "  'type': 'LIMIT_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-50000.0',\n",
       "  'price': 1.1034,\n",
       "  'timeInForce': 'GTD',\n",
       "  'gtdTime': '2024-10-11T07:25:39.000000000Z',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER'},\n",
       " {'id': '562',\n",
       "  'time': '2024-10-04T07:26:42.465007999Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '562',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '561',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-50000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.901717344695',\n",
       "  'lossQuoteHomeConversionFactor': '0.910779830572',\n",
       "  'price': 1.10341,\n",
       "  'fullVWAP': 1.10341,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.10341, 'liquidity': '500000'},\n",
       "    {'price': 1.1034, 'liquidity': '2500000'},\n",
       "    {'price': 1.10339, 'liquidity': '2000000'},\n",
       "    {'price': 1.10338, 'liquidity': '5000000'},\n",
       "    {'price': 1.10335, 'liquidity': '10000000'},\n",
       "    {'price': 1.10332, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.10349, 'liquidity': '500000'},\n",
       "    {'price': 1.1035, 'liquidity': '500000'},\n",
       "    {'price': 1.10351, 'liquidity': '2000000'},\n",
       "    {'price': 1.10352, 'liquidity': '2000000'},\n",
       "    {'price': 1.10353, 'liquidity': '5000000'},\n",
       "    {'price': 1.10355, 'liquidity': '10000000'},\n",
       "    {'price': 1.10358, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.10332,\n",
       "   'closeoutAsk': 1.10358},\n",
       "  'reason': 'LIMIT_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98951.6343',\n",
       "  'tradeOpened': {'tradeID': '562',\n",
       "   'units': '-50000.0',\n",
       "   'price': 1.10341,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '1.8125',\n",
       "   'initialMarginRequired': '1666.6667'},\n",
       "  'halfSpreadCost': '1.8125'},\n",
       " {'id': '563',\n",
       "  'time': '2024-10-04T07:31:47.613577312Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '563',\n",
       "  'requestID': '61291066539621114',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'BTC_USD',\n",
       "  'units': '0.1',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'takeProfitOnFill': {'price': 61400.0, 'timeInForce': 'GTC'},\n",
       "  'stopLossOnFill': {'price': 61200.0, 'timeInForce': 'GTC'}},\n",
       " {'id': '564',\n",
       "  'time': '2024-10-04T07:31:47.613577312Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '563',\n",
       "  'requestID': '61291066539621114',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '563',\n",
       "  'instrument': 'BTC_USD',\n",
       "  'units': '0.1',\n",
       "  'gainQuoteHomeConversionFactor': '0.9018195055',\n",
       "  'lossQuoteHomeConversionFactor': '0.910883018118',\n",
       "  'price': 61298.8,\n",
       "  'fullVWAP': 61298.8,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 61255.8, 'liquidity': '20'}],\n",
       "   'asks': [{'price': 61298.8, 'liquidity': '20'}],\n",
       "   'closeoutBid': 61255.8,\n",
       "   'closeoutAsk': 61298.8},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98951.6343',\n",
       "  'tradeOpened': {'tradeID': '564',\n",
       "   'units': '0.1',\n",
       "   'price': 61298.8,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '1.9487',\n",
       "   'initialMarginRequired': '2776.94'},\n",
       "  'halfSpreadCost': '1.9487'},\n",
       " {'id': '565',\n",
       "  'time': '2024-10-04T07:31:47.613577312Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '563',\n",
       "  'requestID': '61291066539621114',\n",
       "  'type': 'TAKE_PROFIT_ORDER',\n",
       "  'tradeID': '564',\n",
       "  'price': 61400.0,\n",
       "  'timeInForce': 'GTC',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'ON_FILL'},\n",
       " {'id': '566',\n",
       "  'time': '2024-10-04T07:31:47.613577312Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '563',\n",
       "  'requestID': '61291066539621114',\n",
       "  'type': 'STOP_LOSS_ORDER',\n",
       "  'tradeID': '564',\n",
       "  'price': 61200.0,\n",
       "  'timeInForce': 'GTC',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'ON_FILL'},\n",
       " {'id': '567',\n",
       "  'time': '2024-10-04T07:45:54.872225381Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '567',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '565',\n",
       "  'instrument': 'BTC_USD',\n",
       "  'units': '-0.1',\n",
       "  'gainQuoteHomeConversionFactor': '0.901958479005',\n",
       "  'lossQuoteHomeConversionFactor': '0.911023388342',\n",
       "  'price': 61412.0,\n",
       "  'fullVWAP': 61412.0,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 61412.0, 'liquidity': '20'}],\n",
       "   'asks': [{'price': 61455.0, 'liquidity': '20'}],\n",
       "   'closeoutBid': 61412.0,\n",
       "   'closeoutAsk': 61455.0},\n",
       "  'reason': 'TAKE_PROFIT_ORDER',\n",
       "  'pl': '10.2102',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98961.8445',\n",
       "  'tradesClosed': [{'tradeID': '564',\n",
       "    'units': '-0.1',\n",
       "    'price': 61412.0,\n",
       "    'realizedPL': '10.2102',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '1.949'}],\n",
       "  'halfSpreadCost': '1.949'},\n",
       " {'id': '568',\n",
       "  'time': '2024-10-04T07:45:54.872225381Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '567',\n",
       "  'type': 'ORDER_CANCEL',\n",
       "  'orderID': '566',\n",
       "  'reason': 'LINKED_TRADE_CLOSED'},\n",
       " {'id': '569',\n",
       "  'time': '2024-10-04T07:49:23.535866641Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '569',\n",
       "  'requestID': '61291070965264994',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '50000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'REDUCE_ONLY',\n",
       "  'shortPositionCloseout': {'instrument': 'EUR_USD', 'units': 'ALL'},\n",
       "  'reason': 'POSITION_CLOSEOUT'},\n",
       " {'id': '570',\n",
       "  'time': '2024-10-04T07:49:23.535866641Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '569',\n",
       "  'requestID': '61291070965264994',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '569',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '50000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.902248824818',\n",
       "  'lossQuoteHomeConversionFactor': '0.911316652203',\n",
       "  'price': 1.10284,\n",
       "  'fullVWAP': 1.10284,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.10276, 'liquidity': '500000'},\n",
       "    {'price': 1.10275, 'liquidity': '2500000'},\n",
       "    {'price': 1.10274, 'liquidity': '2000000'},\n",
       "    {'price': 1.10273, 'liquidity': '5000000'},\n",
       "    {'price': 1.1027, 'liquidity': '10000000'},\n",
       "    {'price': 1.10267, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.10284, 'liquidity': '500000'},\n",
       "    {'price': 1.10285, 'liquidity': '500000'},\n",
       "    {'price': 1.10286, 'liquidity': '2000000'},\n",
       "    {'price': 1.10287, 'liquidity': '2000000'},\n",
       "    {'price': 1.10288, 'liquidity': '5000000'},\n",
       "    {'price': 1.1029, 'liquidity': '10000000'},\n",
       "    {'price': 1.10293, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.10267,\n",
       "   'closeoutAsk': 1.10293},\n",
       "  'reason': 'MARKET_ORDER_POSITION_CLOSEOUT',\n",
       "  'pl': '25.7141',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98987.5586',\n",
       "  'tradesClosed': [{'tradeID': '562',\n",
       "    'units': '50000.0',\n",
       "    'price': 1.10284,\n",
       "    'realizedPL': '25.7141',\n",
       "    'financing': '0.0',\n",
       "    'guaranteedExecutionFee': '0.0',\n",
       "    'halfSpreadCost': '1.8136'}],\n",
       "  'halfSpreadCost': '1.8136'},\n",
       " {'id': '571',\n",
       "  'time': '2024-10-08T13:58:36.026877844Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '571',\n",
       "  'requestID': '61292613435041729',\n",
       "  'type': 'LIMIT_ORDER_REJECT',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '100000.0',\n",
       "  'price': 1.12999999999999,\n",
       "  'timeInForce': 'GTC',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'takeProfitOnFill': {'price': 1.17999999999999, 'timeInForce': 'GTC'},\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'},\n",
       "  'rejectReason': 'PRICE_PRECISION_EXCEEDED'},\n",
       " {'id': '572',\n",
       "  'time': '2024-10-08T13:58:36.684029330Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '572',\n",
       "  'requestID': '97321410454328518',\n",
       "  'type': 'MARKET_ORDER',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'timeInForce': 'FOK',\n",
       "  'positionFill': 'DEFAULT',\n",
       "  'reason': 'CLIENT_ORDER',\n",
       "  'stopLossOnFill': {'distance': '0.1', 'timeInForce': 'GTC'}},\n",
       " {'id': '573',\n",
       "  'time': '2024-10-08T13:58:36.684029330Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '572',\n",
       "  'requestID': '97321410454328518',\n",
       "  'type': 'ORDER_FILL',\n",
       "  'orderID': '572',\n",
       "  'instrument': 'EUR_USD',\n",
       "  'units': '-100000.0',\n",
       "  'gainQuoteHomeConversionFactor': '0.906374688266',\n",
       "  'lossQuoteHomeConversionFactor': '0.915483981615',\n",
       "  'price': 1.09773,\n",
       "  'fullVWAP': 1.09773,\n",
       "  'fullPrice': {'type': 'PRICE',\n",
       "   'bids': [{'price': 1.09773, 'liquidity': '500000'},\n",
       "    {'price': 1.09772, 'liquidity': '2500000'},\n",
       "    {'price': 1.09771, 'liquidity': '2000000'},\n",
       "    {'price': 1.0977, 'liquidity': '5000000'},\n",
       "    {'price': 1.09767, 'liquidity': '10000000'},\n",
       "    {'price': 1.09764, 'liquidity': '10000000'}],\n",
       "   'asks': [{'price': 1.09783, 'liquidity': '500000'},\n",
       "    {'price': 1.09784, 'liquidity': '500000'},\n",
       "    {'price': 1.09785, 'liquidity': '2000000'},\n",
       "    {'price': 1.09786, 'liquidity': '2000000'},\n",
       "    {'price': 1.09787, 'liquidity': '5000000'},\n",
       "    {'price': 1.09789, 'liquidity': '10000000'},\n",
       "    {'price': 1.09792, 'liquidity': '10000000'}],\n",
       "   'closeoutBid': 1.09764,\n",
       "   'closeoutAsk': 1.09792},\n",
       "  'reason': 'MARKET_ORDER',\n",
       "  'pl': '0.0',\n",
       "  'financing': '0.0',\n",
       "  'commission': '0.0',\n",
       "  'guaranteedExecutionFee': '0.0',\n",
       "  'accountBalance': '98987.5586',\n",
       "  'tradeOpened': {'tradeID': '573',\n",
       "   'units': '-100000.0',\n",
       "   'price': 1.09773,\n",
       "   'guaranteedExecutionFee': '0.0',\n",
       "   'halfSpreadCost': '4.5546',\n",
       "   'initialMarginRequired': '3333.3333'},\n",
       "  'halfSpreadCost': '4.5546'},\n",
       " {'id': '574',\n",
       "  'time': '2024-10-08T13:58:36.684029330Z',\n",
       "  'userID': 27030320,\n",
       "  'accountID': '101-011-27030320-002',\n",
       "  'batchID': '572',\n",
       "  'requestID': '97321410454328518',\n",
       "  'type': 'STOP_LOSS_ORDER',\n",
       "  'tradeID': '573',\n",
       "  'price': 1.19773,\n",
       "  'distance': '0.1',\n",
       "  'timeInForce': 'GTC',\n",
       "  'triggerCondition': 'DEFAULT',\n",
       "  'reason': 'ON_FILL'}]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_transactions(tid = 486-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 530 | 2024-09-18T13:31:47.87 | EUR_USD | -100000.0 | 1981.5307\n",
      " 532 | 2024-09-18T13:33:14.09 | EUR_USD | 100000.0 |      0.0\n",
      " 535 | 2024-09-18T13:33:15.54 | EUR_USD | -100000.0 | 2014.5827\n",
      " 537 | 2024-09-18T13:33:16.04 | EUR_USD | 100000.0 |      0.0\n",
      " 539 | 2024-09-18T13:33:16.27 | EUR_USD | -100000.0 |  -7.2179\n",
      " 558 | 2024-10-04T07:17:56.07 | EUR_USD |   1000.0 |      0.0\n",
      " 560 | 2024-10-04T07:23:17.75 | EUR_USD | -101000.0 | -994.9916\n",
      " 562 | 2024-10-04T07:26:42.46 | EUR_USD | -50000.0 |      0.0\n",
      " 564 | 2024-10-04T07:31:47.61 | BTC_USD |      0.1 |      0.0\n",
      " 567 | 2024-10-04T07:45:54.87 | BTC_USD |     -0.1 |  10.2102\n",
      " 570 | 2024-10-04T07:49:23.53 | EUR_USD |  50000.0 |  25.7141\n",
      " 573 | 2024-10-08T13:58:36.68 | EUR_USD | -100000.0 |      0.0\n"
     ]
    }
   ],
   "source": [
    "api.print_transactions(tid = 486-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': '101-011-27030320-002',\n",
       " 'alias': 'Paolo',\n",
       " 'currency': 'EUR',\n",
       " 'balance': '98987.5586',\n",
       " 'createdByUserID': 27030320,\n",
       " 'createdTime': '2023-10-03T15:26:25.580818880Z',\n",
       " 'guaranteedStopLossOrderMode': 'ALLOWED',\n",
       " 'pl': '1926.9272',\n",
       " 'resettablePL': '1926.9272',\n",
       " 'resettablePLTime': '0',\n",
       " 'financing': '-2939.3686',\n",
       " 'commission': '0.0',\n",
       " 'guaranteedExecutionFees': '0.0',\n",
       " 'marginRate': '0.03333333333333',\n",
       " 'openTradeCount': 1,\n",
       " 'openPositionCount': 1,\n",
       " 'pendingOrderCount': 1,\n",
       " 'hedgingEnabled': False,\n",
       " 'unrealizedPL': '-9.1548',\n",
       " 'NAV': '98978.4038',\n",
       " 'marginUsed': '3333.3333',\n",
       " 'marginAvailable': '95649.6707',\n",
       " 'positionValue': '100000.0',\n",
       " 'marginCloseoutUnrealizedPL': '-4.5546',\n",
       " 'marginCloseoutNAV': '98983.004',\n",
       " 'marginCloseoutMarginUsed': '3333.3333',\n",
       " 'marginCloseoutPercent': '0.01684',\n",
       " 'marginCloseoutPositionValue': '100000.0',\n",
       " 'withdrawalLimit': '95649.6707',\n",
       " 'marginCallMarginUsed': '3333.3333',\n",
       " 'marginCallPercent': '0.03368',\n",
       " 'lastTransactionID': '574'}"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "api.get_account_summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
