diff --git a/examples/notebooks/nautilus gym_wrapper.ipynb b/examples/notebooks/nautilus gym_wrapper.ipynb
new file mode 100644
index 0000000..1df64a2
--- /dev/null
+++ b/examples/notebooks/nautilus gym_wrapper.ipynb
@@ -0,0 +1,7511 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Import Libraries"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import gymnasium as gym\n",
+ "from typing import Tuple\n",
+ "from pathlib import Path\n",
+ "# \n",
+ "from stable_baselines3 import PPO\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "import shutil\n",
+ "import pandas as pd\n",
+ "from decimal import Decimal\n",
+ "\n",
+ "from nautilus_trader.config import (\n",
+ " LoggingConfig,\n",
+ " CacheConfig,\n",
+ " BacktestDataConfig,\n",
+ " BacktestEngineConfig,\n",
+ " BacktestRunConfig,\n",
+ " BacktestVenueConfig,\n",
+ " ImportableActorConfig,\n",
+ " ImportableStrategyConfig,\n",
+ " RiskEngineConfig,\n",
+ " StreamingConfig,\n",
+ ")\n",
+ "# from nautilus_trader.backtest.node import BacktestDataConfig\n",
+ "# from nautilus_trader.backtest.node import BacktestEngineConfig\n",
+ "from nautilus_trader.backtest.node import BacktestNode\n",
+ "# from nautilus_trader.backtest.node import BacktestRunConfig\n",
+ "# from nautilus_trader.backtest.node import BacktestVenueConfig\n",
+ "from nautilus_trader.backtest.engine import BacktestEngine\n",
+ "from nautilus_trader.backtest.engine import BacktestEngineConfig\n",
+ "from nautilus_trader.backtest.models import FillModel\n",
+ "\n",
+ "from nautilus_trader.model.data import QuoteTick\n",
+ "from nautilus_trader.model.objects import Quantity\n",
+ "from nautilus_trader.model.data import Bar\n",
+ "from nautilus_trader.model.data import BarType\n",
+ "from nautilus_trader.model.identifiers import TraderId\n",
+ "\n",
+ "from nautilus_trader.core.datetime import dt_to_unix_nanos\n",
+ "from nautilus_trader.persistence.catalog import ParquetDataCatalog # as DataCatalog\n",
+ "\n",
+ "from nautilus_trader.persistence.wranglers import QuoteTickDataWrangler\n",
+ "from nautilus_trader.test_kit.providers import CSVTickDataLoader\n",
+ "from nautilus_trader.test_kit.providers import TestInstrumentProvider\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Historical Data to Catalog\n",
+ "\n",
+ "Some historical tick data was gotten from https://www.dukascopy.com/trading-tools/widgets/quotes/historical_data_feed "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# !apt-get update && apt-get install curl -y\n",
+ "# !curl https://raw.githubusercontent.com/nautechsystems/nautilus_data/main/nautilus_data/hist_data_to_catalog.py | python -"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# from os import PathLike\n",
+ "# from pathlib import Path\n",
+ "\n",
+ "# import requests\n",
+ "# from nautilus_trader.persistence.catalog import ParquetDataCatalog\n",
+ "# from nautilus_trader.persistence.wranglers import QuoteTickDataWrangler\n",
+ "# from nautilus_trader.test_kit.providers import CSVTickDataLoader\n",
+ "# from nautilus_trader.test_kit.providers import TestInstrumentProvider\n",
+ "\n",
+ "\n",
+ "# ROOT = Path(__file__).parent.parent\n",
+ "# CATALOG_DIR = ROOT / \"catalog\"\n",
+ "# CATALOG_DIR.mkdir(exist_ok=True)\n",
+ "\n",
+ "\n",
+ "# def load_fx_hist_data(\n",
+ "# filename: str,\n",
+ "# currency: str,\n",
+ "# catalog_path: PathLike[str] | str,\n",
+ "# ) -> None:\n",
+ "# instrument = TestInstrumentProvider.default_fx_ccy(currency)\n",
+ "# wrangler = QuoteTickDataWrangler(instrument)\n",
+ "\n",
+ "# df = CSVTickDataLoader.load(\n",
+ "# filename,\n",
+ "# index_col=0,\n",
+ "# datetime_format=\"%Y%m%d %H%M%S%f\",\n",
+ "# )\n",
+ "# df.columns = [\"bid_price\", \"ask_price\", \"size\"]\n",
+ "# print(df)\n",
+ "\n",
+ "# print(\"Preparing ticks...\")\n",
+ "# ticks = wrangler.process(df)\n",
+ "\n",
+ "# print(\"Writing data to catalog...\")\n",
+ "# catalog = ParquetDataCatalog(catalog_path)\n",
+ "# catalog.write_data([instrument])\n",
+ "# catalog.write_data(ticks)\n",
+ "\n",
+ "# print(\"Done\")\n",
+ "\n",
+ "\n",
+ "# def download(url: str) -> None:\n",
+ "# filename = url.rsplit(\"/\", maxsplit=1)[1]\n",
+ "# with open(filename, \"wb\") as f:\n",
+ "# f.write(requests.get(url).content)\n",
+ "\n",
+ "\n",
+ "# def main():\n",
+ "# # Download raw data\n",
+ "# download(\n",
+ "# \"https://raw.githubusercontent.com/nautechsystems/nautilus_data/main/raw_data/fx_hist_data/DAT_ASCII_EURUSD_T_202001.csv.gz\",\n",
+ "# )\n",
+ "# load_fx_hist_data(\n",
+ "# filename=\"DAT_ASCII_EURUSD_T_202001.csv.gz\",\n",
+ "# currency=\"EUR/USD\",\n",
+ "# catalog_path=CATALOG_DIR,\n",
+ "# )\n",
+ "\n",
+ "\n",
+ "# https://github.com/zcbmlijygrdwa/fx_EUR_USD_tick\n",
+ "# https://github.com/zeta-zetra/forexpy\n",
+ "# https://github.com/drui9/tickterial"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Load Data From Catalog"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[PosixPath('../data/Coinbase_BTCUSD_1h.csv'),\n",
+ " PosixPath('../data/Coinbase_BTCUSD_d.csv'),\n",
+ " PosixPath('../data/configuration.json'),\n",
+ " PosixPath('../data/configuration.yaml'),\n",
+ " PosixPath('../data/EURUSD_2020-01-01.csv'),\n",
+ " PosixPath('../data/EURUSD_Ticks_02.09.2024-02.09.2024.csv'),\n",
+ " PosixPath('../data/EURUSD_Ticks_01.08.2024-01.08.2024.csv')]"
+ ]
+ },
+ "execution_count": 5,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "DATA_DIR = \"../data\"\n",
+ "\n",
+ "path = Path(DATA_DIR).expanduser() / \"\"\n",
+ "raw_files = list(path.iterdir())\n",
+ "assert raw_files, f\"Unable to find any histdata files in directory {path}\"\n",
+ "raw_files"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "PosixPath('../data/EURUSD_Ticks_01.08.2024-01.08.2024.csv')"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "raw_files[-1]\n",
+ "\n",
+ "# df = pd.DataFrame(data=raw_files[-1].__str__(), columns=[])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Ask | \n",
+ " Bid | \n",
+ " AskVolume | \n",
+ " BidVolume | \n",
+ "
\n",
+ " \n",
+ " Local time | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2024-01-08 00:00:00.114000+01:00 | \n",
+ " 1.08249 | \n",
+ " 1.08246 | \n",
+ " 6.30 | \n",
+ " 3.6 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.219000+01:00 | \n",
+ " 1.08248 | \n",
+ " 1.08246 | \n",
+ " 0.90 | \n",
+ " 3.6 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.323000+01:00 | \n",
+ " 1.08249 | \n",
+ " 1.08247 | \n",
+ " 0.90 | \n",
+ " 3.6 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.427000+01:00 | \n",
+ " 1.08250 | \n",
+ " 1.08246 | \n",
+ " 1.80 | \n",
+ " 5.4 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.530000+01:00 | \n",
+ " 1.08250 | \n",
+ " 1.08247 | \n",
+ " 1.80 | \n",
+ " 3.6 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:52.203000+01:00 | \n",
+ " 1.07890 | \n",
+ " 1.07886 | \n",
+ " 5.49 | \n",
+ " 3.6 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:53.971000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07885 | \n",
+ " 5.49 | \n",
+ " 4.5 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:54.075000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07884 | \n",
+ " 5.49 | \n",
+ " 5.4 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:54.178000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07885 | \n",
+ " 5.49 | \n",
+ " 4.5 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:55.392000+01:00 | \n",
+ " 1.07888 | \n",
+ " 1.07884 | \n",
+ " 3.60 | \n",
+ " 4.5 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
94126 rows × 4 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Ask Bid AskVolume BidVolume\n",
+ "Local time \n",
+ "2024-01-08 00:00:00.114000+01:00 1.08249 1.08246 6.30 3.6\n",
+ "2024-01-08 00:00:00.219000+01:00 1.08248 1.08246 0.90 3.6\n",
+ "2024-01-08 00:00:00.323000+01:00 1.08249 1.08247 0.90 3.6\n",
+ "2024-01-08 00:00:00.427000+01:00 1.08250 1.08246 1.80 5.4\n",
+ "2024-01-08 00:00:00.530000+01:00 1.08250 1.08247 1.80 3.6\n",
+ "... ... ... ... ...\n",
+ "2024-01-08 23:59:52.203000+01:00 1.07890 1.07886 5.49 3.6\n",
+ "2024-01-08 23:59:53.971000+01:00 1.07889 1.07885 5.49 4.5\n",
+ "2024-01-08 23:59:54.075000+01:00 1.07889 1.07884 5.49 5.4\n",
+ "2024-01-08 23:59:54.178000+01:00 1.07889 1.07885 5.49 4.5\n",
+ "2024-01-08 23:59:55.392000+01:00 1.07888 1.07884 3.60 4.5\n",
+ "\n",
+ "[94126 rows x 4 columns]"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Here we just take the first data file found and load into a pandas DataFrame\n",
+ "df = CSVTickDataLoader.load(raw_files[-1], index_col='Local time', datetime_format=\"%Y-%m-%d %H:%M:%S.%f\")\n",
+ "df"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "Ask 1.07888\n",
+ "Bid 1.07884\n",
+ "AskVolume 3.60000\n",
+ "BidVolume 4.50000\n",
+ "Name: 2024-01-08 23:59:55.392000+01:00, dtype: float64"
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.iloc[-1]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Ask | \n",
+ " Bid | \n",
+ "
\n",
+ " \n",
+ " Local time | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2024-01-08 00:00:00.114000+01:00 | \n",
+ " 1.08249 | \n",
+ " 1.08246 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.219000+01:00 | \n",
+ " 1.08248 | \n",
+ " 1.08246 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.323000+01:00 | \n",
+ " 1.08249 | \n",
+ " 1.08247 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.427000+01:00 | \n",
+ " 1.08250 | \n",
+ " 1.08246 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.530000+01:00 | \n",
+ " 1.08250 | \n",
+ " 1.08247 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:52.203000+01:00 | \n",
+ " 1.07890 | \n",
+ " 1.07886 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:53.971000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07885 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:54.075000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07884 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:54.178000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07885 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:55.392000+01:00 | \n",
+ " 1.07888 | \n",
+ " 1.07884 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
94126 rows × 2 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Ask Bid\n",
+ "Local time \n",
+ "2024-01-08 00:00:00.114000+01:00 1.08249 1.08246\n",
+ "2024-01-08 00:00:00.219000+01:00 1.08248 1.08246\n",
+ "2024-01-08 00:00:00.323000+01:00 1.08249 1.08247\n",
+ "2024-01-08 00:00:00.427000+01:00 1.08250 1.08246\n",
+ "2024-01-08 00:00:00.530000+01:00 1.08250 1.08247\n",
+ "... ... ...\n",
+ "2024-01-08 23:59:52.203000+01:00 1.07890 1.07886\n",
+ "2024-01-08 23:59:53.971000+01:00 1.07889 1.07885\n",
+ "2024-01-08 23:59:54.075000+01:00 1.07889 1.07884\n",
+ "2024-01-08 23:59:54.178000+01:00 1.07889 1.07885\n",
+ "2024-01-08 23:59:55.392000+01:00 1.07888 1.07884\n",
+ "\n",
+ "[94126 rows x 2 columns]"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# df.drop(columns=['Unnamed: 0', 'Ask_Volume', 'Bid_Volume'], axis=1, inplace=True)\n",
+ "df.drop(columns=['AskVolume', 'BidVolume'], axis=1, inplace=True)\n",
+ "df"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ask_price | \n",
+ " bid_price | \n",
+ "
\n",
+ " \n",
+ " timestamp | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2024-01-08 00:00:00.114000+01:00 | \n",
+ " 1.08249 | \n",
+ " 1.08246 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.219000+01:00 | \n",
+ " 1.08248 | \n",
+ " 1.08246 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.323000+01:00 | \n",
+ " 1.08249 | \n",
+ " 1.08247 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.427000+01:00 | \n",
+ " 1.08250 | \n",
+ " 1.08246 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 00:00:00.530000+01:00 | \n",
+ " 1.08250 | \n",
+ " 1.08247 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:52.203000+01:00 | \n",
+ " 1.07890 | \n",
+ " 1.07886 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:53.971000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07885 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:54.075000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07884 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:54.178000+01:00 | \n",
+ " 1.07889 | \n",
+ " 1.07885 | \n",
+ "
\n",
+ " \n",
+ " 2024-01-08 23:59:55.392000+01:00 | \n",
+ " 1.07888 | \n",
+ " 1.07884 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
94126 rows × 2 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " ask_price bid_price\n",
+ "timestamp \n",
+ "2024-01-08 00:00:00.114000+01:00 1.08249 1.08246\n",
+ "2024-01-08 00:00:00.219000+01:00 1.08248 1.08246\n",
+ "2024-01-08 00:00:00.323000+01:00 1.08249 1.08247\n",
+ "2024-01-08 00:00:00.427000+01:00 1.08250 1.08246\n",
+ "2024-01-08 00:00:00.530000+01:00 1.08250 1.08247\n",
+ "... ... ...\n",
+ "2024-01-08 23:59:52.203000+01:00 1.07890 1.07886\n",
+ "2024-01-08 23:59:53.971000+01:00 1.07889 1.07885\n",
+ "2024-01-08 23:59:54.075000+01:00 1.07889 1.07884\n",
+ "2024-01-08 23:59:54.178000+01:00 1.07889 1.07885\n",
+ "2024-01-08 23:59:55.392000+01:00 1.07888 1.07884\n",
+ "\n",
+ "[94126 rows x 2 columns]"
+ ]
+ },
+ "execution_count": 10,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.index.set_names(\"timestamp\", inplace=True)\n",
+ "# df.columns = [\"bid_price\", \"ask_price\"]\n",
+ "df.columns = [\"ask_price\", \"bid_price\"]\n",
+ "df"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# df = df.reset_index()\n",
+ "# df"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704668400114000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704668400219000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704668400323000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08250,1000000,1000000,1704668400427000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704668400530000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08250,1000000,1000000,1704668400633000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704668400838000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08250,1000000,1000000,1704668401041000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704668401349000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08249,1000000,1000000,1704668401802000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704668401905000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08250,1000000,1000000,1704668402209000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704668402515000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704668402924000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704668402977000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08250,1000000,1000000,1704668403081000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704668405105000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704668406068000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08248,1000000,1000000,1704668406173000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08248,1000000,1000000,1704668406276000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08248,1000000,1000000,1704668407087000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704668407240000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704668407594000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704668407748000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704668412089000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704668412244000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704668412347000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704668413008000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08247,1000000,1000000,1704668421288000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668425676000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668460120000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08246,1000000,1000000,1704668465169000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704668465273000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704668465376000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704668475096000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704668475199000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704668475302000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08248,1000000,1000000,1704668482260000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704668482514000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08248,1000000,1000000,1704668485185000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704668485438000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704668497632000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668501310000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668501414000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668501718000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668502072000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704668510088000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668513816000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668514423000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668515029000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704668518553000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668522677000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704668524636000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08245,1000000,1000000,1704668524739000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704668527612000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08245,1000000,1000000,1704668527715000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704668529127000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668532046000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668532251000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704668533770000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668534628000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668534731000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668534987000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668535090000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668535343000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668536604000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668536907000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668541379000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668541532000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668544903000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668564691000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704668573050000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668578243000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704668581015000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668581371000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704668583702000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08245,1000000,1000000,1704668601515000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668602726000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704668602828000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704668615707000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704668620843000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08245,1000000,1000000,1704668621450000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704668626663000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08244,1000000,1000000,1704668636004000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08242,1000000,1000000,1704668639944000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668639996000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704668640101000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668641317000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704668641470000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668641572000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704668642277000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668642633000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704668647067000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668652662000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704668652764000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668658100000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704668662430000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668662933000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704668663086000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668663189000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704668669648000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704668681960000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704668684527000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668684580000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668684684000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08237,1000000,1000000,1704668689897000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668690050000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08238,1000000,1000000,1704668695039000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704668695092000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08239,1000000,1000000,1704668695196000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668695299000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704668697706000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668697909000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704668703005000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668703157000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704668705325000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668705832000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704668709008000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668709110000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08237,1000000,1000000,1704668729304000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668745036000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08239,1000000,1000000,1704668745140000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704668745243000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668747719000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08238,1000000,1000000,1704668751507000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704668751812000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668757162000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08237,1000000,1000000,1704668757264000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668812218000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704668817414000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668828195000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704668842750000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668863003000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704668865390000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668900313000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704668911178000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704668924410000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08235,1000000,1000000,1704668924513000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704668924616000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08235,1000000,1000000,1704668924720000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704668925637000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08235,1000000,1000000,1704668927777000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704668928385000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704668934614000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704668958270000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08238,1000000,1000000,1704668973273000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704668973678000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08238,1000000,1000000,1704668973984000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704668974390000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704668984496000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704668989428000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668989632000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704668993611000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704668993714000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704669010682000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704669010785000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704669015769000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704669016377000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704669019653000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704669021064000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704669021571000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704669023533000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704669023636000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704669026311000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08238,1000000,1000000,1704669032361000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704669032466000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704669032569000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08240,1000000,1000000,1704669032723000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704669032876000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08240,1000000,1000000,1704669033029000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704669037869000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669063555000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669063659000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669069814000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669069917000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669071029000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669071132000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669071234000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669072245000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669076741000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669079717000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669114613000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669119039000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669121157000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669139646000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704669140352000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669140456000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669141672000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704669146961000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669147468000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704669149184000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669153164000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704669154277000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669155791000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704669155994000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669156299000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669170336000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669170640000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669171497000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704669175625000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669175829000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669176533000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669184525000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669187345000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669187956000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669204457000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669205567000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669218008000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669218316000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669220538000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669221146000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669223268000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669224175000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669229713000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669229918000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669231533000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669244509000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669245419000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669271647000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669275279000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669275382000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669284642000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669288324000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669288528000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669299412000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669300019000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08241,1000000,1000000,1704669307170000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669308580000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669331075000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669336933000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669337239000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669337442000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669337746000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669346301000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669348117000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669349229000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669353313000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669356789000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669358152000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704669359212000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669359315000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669390136000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669392957000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669393110000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669396085000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08243,1000000,1000000,1704669396138000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08245,1000000,1000000,1704669396192000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704669396295000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704669396399000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704669398738000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704669399902000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704669408215000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704669409481000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08247,1000000,1000000,1704669410038000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669410143000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704669410246000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669411268000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08249,1000000,1000000,1704669411372000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704669411425000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669411528000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08253,1000000,1000000,1704669415119000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669415325000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08253,1000000,1000000,1704669429425000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08254,1000000,1000000,1704669436735000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08253,1000000,1000000,1704669452179000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704669452283000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669455576000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704669456585000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669456739000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08252,1000000,1000000,1704669461031000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669461134000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704669476665000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704669484173000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08250,1000000,1000000,1704669492147000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704669492250000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08250,1000000,1000000,1704669493262000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704669493719000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08250,1000000,1000000,1704669494023000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704669495738000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704669496245000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669496348000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704669515987000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08251,1000000,1000000,1704669516090000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704669518213000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08253,1000000,1000000,1704669552784000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08253,1000000,1000000,1704669552887000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669553293000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704669553396000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704669570389000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08251,1000000,1000000,1704669572252000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704669575657000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704669575761000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704669578285000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704669579091000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669583880000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08253,1000000,1000000,1704669598882000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08253,1000000,1000000,1704669600298000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08255,1000000,1000000,1704669600402000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08254,1000000,1000000,1704669603129000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08254,1000000,1000000,1704669603233000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08253,1.08255,1000000,1000000,1704669603286000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08255,1000000,1000000,1704669603438000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08254,1000000,1000000,1704669617437000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08255,1000000,1000000,1704669617640000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08253,1000000,1000000,1704669619715000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669619819000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08253,1000000,1000000,1704669625165000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08254,1000000,1000000,1704669625269000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08254,1000000,1000000,1704669626692000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08253,1.08254,1000000,1000000,1704669629671000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08254,1000000,1000000,1704669630329000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08255,1000000,1000000,1704669633660000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08253,1.08256,1000000,1000000,1704669641517000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08256,1000000,1000000,1704669647375000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08253,1.08256,1000000,1000000,1704669649044000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08256,1000000,1000000,1704669649249000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08253,1.08256,1000000,1000000,1704669650061000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08256,1000000,1000000,1704669650163000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08253,1.08256,1000000,1000000,1704669651074000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08256,1000000,1000000,1704669652034000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08253,1.08255,1000000,1000000,1704669687504000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08255,1000000,1000000,1704669695275000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08255,1.08257,1000000,1000000,1704669699750000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08255,1.08256,1000000,1000000,1704669715939000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08255,1.08257,1000000,1000000,1704669716445000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08255,1000000,1000000,1704669717957000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08253,1.08255,1000000,1000000,1704669718364000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08256,1000000,1000000,1704669733539000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08257,1000000,1000000,1704669740711000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08256,1000000,1000000,1704669773395000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08257,1000000,1000000,1704669773853000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08254,1.08256,1000000,1000000,1704669776570000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08252,1000000,1000000,1704669788729000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669788782000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704669789999000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669790509000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704669793086000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669793291000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704669793697000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669793900000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704669794308000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669796127000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704669799959000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704669805353000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704669810201000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704669853068000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08251,1000000,1000000,1704669854740000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669859375000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669859480000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669860039000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669871074000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669872286000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669873096000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669874410000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669876171000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669876876000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669883025000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669883329000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669883836000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669886257000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669886963000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669887065000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669895943000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669896650000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669897155000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704669897763000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704669898270000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669898629000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08249,1000000,1000000,1704669904634000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704669904840000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704669914559000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704669917897000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08242,1000000,1000000,1704669918001000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704669918054000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669918158000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704669918261000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669919021000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704669919227000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669919330000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704669920447000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669922668000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669923482000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669923586000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704669923939000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704669931282000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704669931334000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704669932557000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08239,1000000,1000000,1704669933523000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08237,1000000,1000000,1704669933576000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704669933680000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08235,1000000,1000000,1704669938586000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08235,1000000,1000000,1704669938689000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08235,1000000,1000000,1704669941680000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08235,1000000,1000000,1704669943547000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08235,1000000,1000000,1704669943651000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704669947172000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704669947727000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704669948033000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704669948841000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704669948995000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704669954574000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704669960349000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704669960452000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704669962169000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704669962272000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08231,1.08232,1000000,1000000,1704669962679000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08233,1000000,1000000,1704669983344000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08235,1000000,1000000,1704669983398000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08235,1000000,1000000,1704670038362000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704670038767000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704670040635000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704670058102000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704670060976000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08236,1000000,1000000,1704670062895000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704670082334000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704670082439000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704670095107000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704670104386000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704670105502000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704670105607000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08240,1000000,1000000,1704670105710000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704670114859000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704670114963000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704670124901000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704670126362000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704670134418000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704670146230000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704670146333000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704670149163000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704670151236000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704670155228000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670175080000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704670175186000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08244,1000000,1000000,1704670175643000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704670176307000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08244,1000000,1000000,1704670176410000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704670176514000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704670176668000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704670176771000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08248,1000000,1000000,1704670188534000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704670194688000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704670204749000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670210290000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670210394000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670210497000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670210600000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670211107000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670211714000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670213029000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670213335000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670213941000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670214144000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670214954000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670215156000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670216117000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670216220000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670217130000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670217232000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670218138000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670218240000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670219149000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670219352000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670224448000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670224653000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670224756000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670227074000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670227378000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670227580000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670228539000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670228692000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670229550000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670229653000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670230563000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670230665000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670231572000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670231775000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670232580000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670232783000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670233739000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670233841000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670234753000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670234854000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670235762000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670235864000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08244,1000000,1000000,1704670269551000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704670269604000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704670269707000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08245,1000000,1000000,1704670289843000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670289946000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670320532000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670324566000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670330013000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670342148000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670342453000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670346012000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670346218000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670371670000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08244,1000000,1000000,1704670371774000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704670372081000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08245,1000000,1000000,1704670372185000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08244,1000000,1000000,1704670373451000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670373554000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704670378609000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670391153000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670391257000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670441129000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670441283000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08244,1000000,1000000,1704670449145000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08245,1000000,1000000,1704670449198000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704670449303000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704670449407000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704670449510000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704670451440000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704670461812000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704670466987000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704670477115000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704670477219000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704670477424000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704670478032000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704670484126000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704670500622000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670500725000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08244,1000000,1000000,1704670550915000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670551121000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670590790000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670621626000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670641695000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08243,1000000,1000000,1704670719399000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670723081000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08243,1000000,1000000,1704670727003000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670754742000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08243,1000000,1000000,1704670810231000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670810383000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670848240000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08247,1000000,1000000,1704670848346000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704670848500000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08248,1000000,1000000,1704670849164000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704670850279000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704670853403000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704670854365000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08251,1000000,1000000,1704670854518000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08249,1000000,1000000,1704670856385000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704670856438000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08248,1000000,1000000,1704670856542000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704670856645000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704670857103000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08244,1000000,1000000,1704670860081000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704670860745000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08244,1000000,1000000,1704670861607000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704670866286000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704670867092000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704670884928000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704670918225000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08248,1000000,1000000,1704670918329000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08248,1000000,1000000,1704670932359000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704670932463000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704670949929000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08248,1000000,1000000,1704670950034000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704670952907000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704670953214000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704670953878000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704670953982000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704670958016000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08245,1000000,1000000,1704670958420000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08242,1.08244,1000000,1000000,1704670963248000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704670963380000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704670996825000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704670998694000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704670999400000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704671001143000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671004057000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704671026724000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671026827000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704671041273000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704671044746000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704671045560000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671093078000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704671094142000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08240,1000000,1000000,1704671101611000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08238,1000000,1000000,1704671101664000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704671101768000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704671101871000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704671102125000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704671102228000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704671109177000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704671109791000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704671110348000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704671117655000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704671158533000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704671167324000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08238,1000000,1000000,1704671168596000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704671168700000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704671176221000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704671176276000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08233,1000000,1000000,1704671176485000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08231,1000000,1000000,1704671176538000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08231,1000000,1000000,1704671176641000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671177253000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671178366000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671201683000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671206774000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671208234000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671209545000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671211106000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08230,1000000,1000000,1704671223498000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08228,1.08230,1000000,1000000,1704671223602000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08230,1000000,1000000,1704671223706000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08231,1000000,1000000,1704671224211000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671224363000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671224467000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671232728000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671241186000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671241289000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671241748000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671241851000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671242866000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671242969000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671243072000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671243934000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671244087000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671244541000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671244644000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671246660000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671248024000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671248783000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671248886000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671249242000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671249445000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671249548000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671249651000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671251214000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671251317000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671251875000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671251977000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671252080000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671253796000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671254911000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08230,1000000,1000000,1704671255017000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671255070000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671255173000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671262103000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671262205000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671264218000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671264524000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671265346000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671267162000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671268169000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671268271000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671269078000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08231,1000000,1000000,1704671269482000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671269636000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671269994000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671270199000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671271719000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671271823000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671278138000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671278240000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671278394000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671278700000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671278954000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671279460000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671280368000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671280471000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671280675000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671280829000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671280932000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671281137000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671281291000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671281394000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671282257000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671282863000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671282965000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671283272000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671283375000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671283985000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671284443000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671284799000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671285103000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671285606000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671285811000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671286519000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671286975000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671291216000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671291621000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671291724000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671292130000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671292232000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671292334000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671292640000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671292742000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671294608000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671294914000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671295119000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671295423000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671304357000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671304561000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671304765000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671305070000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671305324000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671305933000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671309813000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671309916000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671310019000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671315767000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671316626000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671340171000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671341085000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671341187000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671341442000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671341545000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671343319000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671343422000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671343525000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671344035000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08227,1.08228,1000000,1000000,1704671348679000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08222,1000000,1000000,1704671348732000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671348836000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08222,1000000,1000000,1704671349041000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08222,1000000,1000000,1704671349553000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08222,1000000,1000000,1704671349656000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671351844000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08222,1000000,1000000,1704671351947000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08222,1000000,1000000,1704671352307000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08222,1000000,1000000,1704671353876000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08222,1000000,1000000,1704671354082000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08222,1000000,1000000,1704671354236000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671354339000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671354797000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671355000000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671355205000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671355512000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671355615000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671356784000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671357594000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671357898000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671358051000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671358256000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671359376000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671359938000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671360040000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671360295000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671362467000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671363375000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671363478000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671364386000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671364539000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671365399000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671365553000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671366113000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671366418000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671366572000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671366675000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671367184000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671367287000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671367543000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671367647000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671368820000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671368924000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671369739000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671369842000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671370047000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671370151000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671370407000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671370561000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671370765000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671371121000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671373102000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671373205000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671373460000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671373918000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671374020000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671374223000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671375298000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08222,1000000,1000000,1704671375402000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08222,1000000,1000000,1704671376367000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08222,1000000,1000000,1704671377377000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671377581000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671377685000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671377992000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671380821000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671391019000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671391122000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671391934000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671392137000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08217,1.08221,1000000,1000000,1704671392341000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671392897000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08221,1000000,1000000,1704671397149000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08223,1000000,1000000,1704671400306000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08224,1000000,1000000,1704671400409000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08221,1.08224,1000000,1000000,1704671400614000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08224,1000000,1000000,1704671400769000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08221,1.08224,1000000,1000000,1704671400929000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08224,1000000,1000000,1704671401183000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08221,1.08224,1000000,1000000,1704671402545000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08224,1000000,1000000,1704671403152000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08222,1000000,1000000,1704671403307000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08222,1000000,1000000,1704671403462000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08220,1000000,1000000,1704671403718000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08221,1000000,1000000,1704671403924000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08219,1.08222,1000000,1000000,1704671405442000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08218,1.08222,1000000,1000000,1704671406304000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08222,1000000,1000000,1704671406812000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08221,1.08223,1000000,1000000,1704671415051000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08221,1.08224,1000000,1000000,1704671415156000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08220,1.08224,1000000,1000000,1704671421321000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08221,1.08224,1000000,1000000,1704671421877000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08222,1.08224,1000000,1000000,1704671421982000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08223,1.08224,1000000,1000000,1704671428389000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08223,1.08226,1000000,1000000,1704671430109000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08224,1.08226,1000000,1000000,1704671433946000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08223,1.08226,1000000,1000000,1704671434302000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08224,1.08226,1000000,1000000,1704671436012000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08223,1.08226,1000000,1000000,1704671436315000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08224,1.08226,1000000,1000000,1704671443568000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08225,1.08226,1000000,1000000,1704671443924000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08226,1.08229,1000000,1000000,1704671443977000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08226,1.08228,1000000,1000000,1704671449982000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08225,1.08228,1000000,1000000,1704671450086000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08225,1.08227,1000000,1000000,1704671450189000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08225,1.08228,1000000,1000000,1704671450292000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08227,1.08228,1000000,1000000,1704671465805000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08227,1.08229,1000000,1000000,1704671465910000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08227,1.08230,1000000,1000000,1704671468418000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08228,1.08230,1000000,1000000,1704671468572000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08227,1.08230,1000000,1000000,1704671469286000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08228,1.08230,1000000,1000000,1704671477587000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08228,1.08231,1000000,1000000,1704671477742000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08231,1000000,1000000,1704671477845000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08228,1.08231,1000000,1000000,1704671480221000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08231,1000000,1000000,1704671480324000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671480428000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08231,1.08234,1000000,1000000,1704671480481000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08234,1000000,1000000,1704671480686000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671480789000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08231,1.08234,1000000,1000000,1704671482512000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08231,1.08233,1000000,1000000,1704671483877000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08233,1000000,1000000,1704671490445000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08231,1.08233,1000000,1000000,1704671490651000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08233,1000000,1000000,1704671490754000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08231,1.08233,1000000,1000000,1704671491008000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671492328000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671492483000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671492586000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671492942000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671493045000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671493251000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08233,1000000,1000000,1704671494117000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671494219000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671494576000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671495132000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671495691000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671496298000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671497307000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08231,1.08233,1000000,1000000,1704671497514000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08233,1000000,1000000,1704671497669000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671497772000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08229,1.08232,1000000,1000000,1704671499144000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08230,1.08232,1000000,1000000,1704671501072000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08231,1.08234,1000000,1000000,1704671502297000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08235,1000000,1000000,1704671503114000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08235,1000000,1000000,1704671503675000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08235,1000000,1000000,1704671503777000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08236,1000000,1000000,1704671504036000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704671504189000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704671504650000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704671504803000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08237,1000000,1000000,1704671504906000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08239,1000000,1000000,1704671507244000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704671508112000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08239,1000000,1000000,1704671509431000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704671512220000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08239,1000000,1000000,1704671513853000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704671514562000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08239,1000000,1000000,1704671517941000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704671518244000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08239,1000000,1000000,1704671518598000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704671518852000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08236,1.08239,1000000,1000000,1704671519105000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08239,1000000,1000000,1704671519209000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704671519313000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08241,1.08243,1000000,1000000,1704671519417000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704671528918000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704671529022000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671529125000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704671539380000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704671539636000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08241,1000000,1000000,1704671542736000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08240,1000000,1000000,1704671542838000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08241,1000000,1000000,1704671543997000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08240,1000000,1000000,1704671544505000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08241,1000000,1000000,1704671545111000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08237,1.08240,1000000,1000000,1704671545621000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704671546079000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704671546283000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704671550374000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704671550832000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704671552506000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671552763000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704671552867000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671553430000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704671555248000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671555401000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704671556207000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671556712000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08243,1000000,1000000,1704671557072000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671557176000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704671557382000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704671557487000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671557844000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704671557947000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704671559413000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08240,1000000,1000000,1704671560431000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704671560535000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704671563214000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671563317000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704671564038000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08241,1000000,1000000,1704671564191000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08241,1000000,1000000,1704671572495000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671572599000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08238,1.08242,1000000,1000000,1704671573566000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08239,1.08242,1000000,1000000,1704671573973000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08240,1.08242,1000000,1000000,1704671579584000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08244,1000000,1000000,1704671579639000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08245,1000000,1000000,1704671579694000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704671579798000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08248,1000000,1000000,1704671579903000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704671580008000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671580112000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704671580216000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704671580523000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704671580627000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08250,1000000,1000000,1704671581442000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704671581597000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704671585460000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704671585563000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704671594988000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704671596308000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704671597981000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704671598440000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704671607241000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704671608759000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704671609115000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08253,1000000,1000000,1704671611961000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704671612568000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704671615351000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704671623542000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08251,1000000,1000000,1704671626585000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704671626787000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08251,1000000,1000000,1704671628549000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704671629004000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08251,1000000,1000000,1704671629611000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704671630525000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08251,1000000,1000000,1704671630981000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704671631085000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08250,1000000,1000000,1704671632659000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704671632712000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08248,1000000,1000000,1704671632818000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704671632921000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704671633840000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704671636785000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704671640435000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704671640539000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704671641250000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08243,1.08246,1000000,1000000,1704671641859000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08246,1000000,1000000,1704671643021000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08244,1.08247,1000000,1000000,1704671649098000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08245,1.08247,1000000,1000000,1704671654260000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08248,1000000,1000000,1704671654315000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671654367000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08249,1000000,1000000,1704671656749000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704671656852000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08249,1000000,1000000,1704671662616000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704671662669000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704671662774000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704671666696000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08252,1000000,1000000,1704671671237000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08253,1000000,1000000,1704671680495000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08252,1.08254,1000000,1000000,1704671680549000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08251,1.08253,1000000,1000000,1704671681363000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08250,1.08252,1000000,1000000,1704671681824000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08251,1000000,1000000,1704671683551000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704671687860000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671687963000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704671688529000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671689139000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08248,1000000,1000000,1704671690004000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704671690159000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671690924000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08246,1.08249,1000000,1000000,1704671691736000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704671691891000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671692400000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704671692908000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671693926000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704671694331000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671694839000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08248,1000000,1000000,1704671697068000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08249,1000000,1000000,1704671699645000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08247,1.08250,1000000,1000000,1704671700665000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08248,1.08250,1000000,1000000,1704671705717000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08249,1.08251,1000000,1000000,1704671716127000000),\n",
+ " ...]"
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Process quote ticks using a wrangler\n",
+ "EURUSD = TestInstrumentProvider.default_fx_ccy(\"EUR/USD\")\n",
+ "wrangler = QuoteTickDataWrangler(EURUSD)\n",
+ "\n",
+ "ticks = wrangler.process(df)\n",
+ "ticks"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "CATALOG_PATH = Path.cwd() / \"catalog\"\n",
+ "\n",
+ "# Clear if it already exists, then create fresh\n",
+ "if CATALOG_PATH.exists():\n",
+ " shutil.rmtree(CATALOG_PATH)\n",
+ "CATALOG_PATH.mkdir(parents=True)\n",
+ "\n",
+ "# Create a catalog instance\n",
+ "catalog = ParquetDataCatalog(CATALOG_PATH)\n",
+ "\n",
+ "# Write instrument to the catalog\n",
+ "catalog.write_data([EURUSD])\n",
+ "\n",
+ "# Write ticks to catalog\n",
+ "catalog.write_data(ticks)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[CurrencyPair(id=EUR/USD.SIM, raw_symbol=EUR/USD, asset_class=FX, instrument_class=SPOT, quote_currency=USD, is_inverse=False, price_precision=5, price_increment=0.00001, size_precision=0, size_increment=1, multiplier=1, lot_size=1000, margin_init=0.03, margin_maint=0.03, maker_fee=0.00002, taker_fee=0.00002, info=None)]"
+ ]
+ },
+ "execution_count": 14,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# You can also use a relative path such as `ParquetDataCatalog(\"./catalog\")`,\n",
+ "# for example if you're running this notebook after the data setup from the docs.\n",
+ "\n",
+ "# catalog = DataCatalog(\"./catalog\")\n",
+ "# catalog = DataCatalog.from_env()\n",
+ "# catalog = ParquetDataCatalog(\"./catalog\")\n",
+ "catalog.instruments()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[QuoteTick(EUR/USD.SIM,1.08235,1.08239,1000000,1000000,1704672000487000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08235,1.08238,1000000,1000000,1704672000590000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704672000694000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08238,1000000,1000000,1704672000798000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08237,1000000,1000000,1704672000900000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08234,1.08236,1000000,1000000,1704672001106000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08236,1000000,1000000,1704672001618000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08232,1.08235,1000000,1000000,1704672001721000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08234,1000000,1000000,1704672002230000000),\n",
+ " QuoteTick(EUR/USD.SIM,1.08233,1.08236,1000000,1000000,1704672002333000000)]"
+ ]
+ },
+ "execution_count": 15,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "start = dt_to_unix_nanos(pd.Timestamp(\"2024-01-08\", tz=\"UTC\"))\n",
+ "end = dt_to_unix_nanos(pd.Timestamp(\"2024-01-08T23\", tz=\"UTC\"))\n",
+ "\n",
+ "# start = dt_to_unix_nanos(pd.Timestamp(\"2024-02-09\", tz=\"UTC\"))\n",
+ "# end = dt_to_unix_nanos(pd.Timestamp(\"2024-10-09T23\", tz=\"UTC\"))\n",
+ "\n",
+ "# start = dt_to_unix_nanos(pd.Timestamp(\"2020-01-03\", tz=\"UTC\"))\n",
+ "# end = dt_to_unix_nanos(pd.Timestamp(\"2020-01-04\", tz=\"UTC\"))\n",
+ "\n",
+ "catalog.quote_ticks(instrument_ids=[EURUSD.id.value], start=start, end=end)[:10]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'/home/fortesenselabs/Tech/labs/Financial_Eng/Financial_Markets/lab/trade_flow/examples/notebooks/catalog'"
+ ]
+ },
+ "execution_count": 16,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "catalog.path"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "CurrencyPair(id=EUR/USD.SIM, raw_symbol=EUR/USD, asset_class=FX, instrument_class=SPOT, quote_currency=USD, is_inverse=False, price_precision=5, price_increment=0.00001, size_precision=0, size_increment=1, multiplier=1, lot_size=1000, margin_init=0.03, margin_maint=0.03, maker_fee=0.00002, taker_fee=0.00002, info=None)"
+ ]
+ },
+ "execution_count": 17,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "\n",
+ "instrument = catalog.instruments()[0]\n",
+ "instrument"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Set up Training Node"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "\n",
+ "## Using High Level Backtest Node"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'/home/fortesenselabs/Tech/labs/Financial_Eng/Financial_Markets/lab/trade_flow/examples/notebooks'"
+ ]
+ },
+ "execution_count": 18,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# extend backtest node to TrainingNode\n",
+ "from nautilus_trader.backtest.config import BacktestRunConfig\n",
+ "from nautilus_trader.backtest.node import BacktestVenueConfig\n",
+ "from nautilus_trader.model.enums import AccountType\n",
+ "from nautilus_trader.model.enums import OmsType\n",
+ "from nautilus_trader.model.identifiers import Venue\n",
+ "from nautilus_trader.model.objects import Money\n",
+ "\n",
+ "\n",
+ "os.environ['NAUTILUS_PATH'] = Path.cwd().__str__()\n",
+ "os.environ['NAUTILUS_PATH']"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Add Venues"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "venue_configs = [\n",
+ " BacktestVenueConfig(\n",
+ " name=\"SIM\",\n",
+ " oms_type=\"HEDGING\",\n",
+ " account_type=\"MARGIN\", # Spot CASH account (not for perpetuals or futures)\n",
+ " base_currency=\"USD\",\n",
+ " starting_balances=[\"1_000 USD\"],\n",
+ " ),\n",
+ "]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Add Data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data_configs = [\n",
+ " BacktestDataConfig(\n",
+ " catalog_path=str(catalog.path), # str(ParquetDataCatalog.from_env().path)\n",
+ " data_cls=QuoteTick,\n",
+ " instrument_id=instrument.id,\n",
+ " start_time=start,\n",
+ " end_time=end,\n",
+ " ),\n",
+ "]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Add Strategies "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "strategies = [\n",
+ " ImportableStrategyConfig(\n",
+ " strategy_path=\"nautilus_trader.examples.strategies.ema_cross:EMACross\",\n",
+ " config_path=\"nautilus_trader.examples.strategies.ema_cross:EMACrossConfig\",\n",
+ " config={\n",
+ " \"instrument_id\": instrument.id,\n",
+ " \"bar_type\": \"EUR/USD.SIM-15-MINUTE-BID-INTERNAL\", # EUR/USD.SIM-15-MINUTE-BID-INTERNAL\n",
+ " \"fast_ema_period\": 10,\n",
+ " \"slow_ema_period\": 20,\n",
+ " \"trade_size\": Decimal(1_000),\n",
+ " },\n",
+ " ),\n",
+ "]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "class TrainingNode(BacktestNode):\n",
+ " pass"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Instantiate Node"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "config = BacktestRunConfig(\n",
+ " engine=BacktestEngineConfig(strategies=strategies),\n",
+ " data=data_configs,\n",
+ " venues=venue_configs,\n",
+ ")\n",
+ "\n",
+ "# TODO: check the backtest_high_level.ipynb notebook for reference on how to get this running\n",
+ "\n",
+ "node = TrainingNode(configs=[config])"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Run Node"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:27.182947206Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182969083Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: NAUTILUS TRADER - Automated Algorithmic Trading Platform\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182972560Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: by Nautech Systems Pty Ltd.\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182975563Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: Copyright (C) 2015-2024. All rights reserved.\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182978862Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182982740Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182985428Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⣶⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182989406Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣾⣿⣿⣿⠀⢸⣿⣿⣿⣿⣶⣶⣤⣀⠀⠀⠀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182991894Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠀⠀⠀⢀⣴⡇⢀⣾⣿⣿⣿⣿⣿⠀⣾⣿⣿⣿⣿⣿⣿⣿⠿⠓⠀⠀⠀���\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182994897Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠀⠀⣰⣿⣿⡀⢸⣿⣿⣿⣿⣿⣿⠀⣿⣿⣿⣿⣿⣿⠟⠁⣠⣄⠀⠀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.182997892Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠀⢠⣿⣿⣿⣇⠀⢿⣿⣿⣿⣿⣿⠀⢻⣿⣿⣿⡿⢃⣠⣾⣿⣿⣧⡀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183000504Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠠⣾⣿⣿⣿⣿⣿⣧⠈⠋⢀⣴⣧⠀⣿⡏⢠⡀⢸⣿⣿⣿⣿⣿⣿⣿⡇⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183003708Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⣀⠙⢿⣿⣿⣿⣿⣿⠇⢠⣿⣿⣿⡄⠹⠃⠼⠃⠈⠉⠛⠛⠛⠛⠛⠻⠇⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183006308Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⢸⡟⢠⣤⠉⠛⠿⢿⣿⠀⢸⣿⡿⠋⣠⣤⣄⠀⣾⣿⣿⣶⣶⣶⣦⡄⠀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183008846Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠸⠀⣾⠏⣸⣷⠂⣠⣤⠀⠘��⣴⣾⣿⣿⣿⡆⠘⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183011358Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠀⠛⠀⣿⡟⠀⢻⣿⡄⠸⣿⣿⣿⣿⣿⣿⣿⡀⠘⣿⣿⣿⣿⠟⠀⠀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183013737Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠀⠀⠀⣿⠇⠀⠀⢻⡿⠀⠈⠻⣿⣿⣿⣿⣿⡇⠀⢹⣿⠿⠋⠀⠀⠀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183016633Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: ⠀⠀⠀⠀⠀⠀⠋⠀⠀⠀⡘⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183019411Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183021726Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183024433Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: SYSTEM SPECIFICATION\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183026781Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183029153Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: CPU architecture: Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183031726Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: CPU(s): 4 @ 3292 Mhz\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.183033986Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: OS: kernel-6.5.0-13parrot1-amd64 Linux 6.2 Parrot Security\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314051526Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314068923Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: MEMORY USAGE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314072786Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314075454Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Total: 15.57 GiB\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314078159Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Used: 9.58 GiB (61.50%)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314081362Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Avail: 6.00 GiB (38.50%)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314089444Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Total: 17.08 GiB\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314092878Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Used: 0.00 GiB (0.00%)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.314095485Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Avail: 17.08 GiB (100.00%)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320479876Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320494551Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: IDENTIFIERS\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320497917Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320500572Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: trader_id: BACKTESTER-001\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320503506Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: machine_id: fortesense-hppro3500series\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320506018Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: instance_id: 0dbc987b-4c3e-4c9d-aea2-362b182ed4f8\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320516832Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PID: 36580\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320519575Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320545074Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: VERSIONING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320573828Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320652366Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: nautilus_trader: latest\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320683045Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: python: 3.11.9\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320717118Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: numpy: 2.0.2\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320723190Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: pandas: 2.2.2\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320726367Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: msgspec: 0.18.6\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320729162Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: pyarrow: 17.0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320731643Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: pytz: 2024.1\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320745099Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: uvloop: 0.20.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.320748683Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326350038Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Building system kernel\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326414349Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.database=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326420900Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.encoding='msgpack'\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326423807Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.timestamps_as_iso8601=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326463283Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.buffer_interval_ms=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326495502Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.autotrim_mins=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326499178Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.use_trader_prefix=True\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326502312Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.use_trader_id=True\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326505934Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.use_instance_id=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326508893Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.streams_prefix='stream'\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326511637Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.types_filter=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.326514349Z\u001b[0m [INFO] BACKTESTER-001.Cache: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.327330882Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.327566730Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.327626880Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.RiskEngine: TradingState is ACTIVE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.327727686Z\u001b[0m [INFO] BACKTESTER-001.Throttler-ORDER_SUBMIT_THROTTLER: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.327759434Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.RiskEngine: Set MAX_ORDER_SUBMIT_RATE: 100/00:00:01\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.327802981Z\u001b[0m [INFO] BACKTESTER-001.Throttler-ORDER_MODIFY_THROTTLER: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.327818121Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.RiskEngine: Set MAX_ORDER_MODIFY_RATE: 100/00:00:01\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.327926963Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328003266Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.ExecEngine: config.snapshot_orders=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328007330Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.ExecEngine: config.snapshot_positions=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328010220Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.ExecEngine: config.snapshot_positions_interval_secs=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328038721Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 general objects from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328042710Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 currencies from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328045523Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 instruments from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328048212Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 accounts from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328051005Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 orders from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328053623Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 order lists from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328056552Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 positions from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328067889Z\u001b[0m [INFO] BACKTESTER-001.Cache: Checking data integrity\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328080676Z\u001b[0m \u001b[92m[INFO] BACKTESTER-001.Cache: Integrity check passed in 9μs\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328093179Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: Loaded cache in 0ms\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328139319Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.328283498Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.381300427Z\u001b[0m [INFO] BACKTESTER-001.EMACross: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.381739110Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: Registered OMS.UNSPECIFIED for Strategy EMACross-000\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.381747781Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Registered Strategy EMACross-000\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.381750343Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Initialized in 359ms\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.381923609Z\u001b[0m [INFO] BACKTESTER-001.SimulatedExchange(SIM): OmsType=HEDGING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.381980942Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-SIM: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.382104759Z\u001b[0m [INFO] BACKTESTER-001.SimulatedExchange(SIM): Registered ExecutionClient-SIM\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.382110858Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: Registered ExecutionClient-SIM\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.382122880Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Added SimulatedExchange(id=SIM, oms_type=HEDGING, account_type=MARGIN)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.386568281Z\u001b[0m [INFO] BACKTESTER-001.DataClient-SIM: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.386599521Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: Registered SIM\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.386828638Z\u001b[0m [INFO] BACKTESTER-001.SimulatedExchange(SIM): Added instrument EUR/USD.SIM and created matching engine\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.386835169Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Added EUR/USD.SIM Instrument\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.386888297Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Reading data for instrument=EUR/USD.SIM.\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.464150413Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Read 92,956 events from parquet in 0 days 00:00:00.077171s.\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.482774281Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Added 92,956 EUR/USD.SIM QuoteTick elements\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483072774Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Engine load took 0 days 00:00:00.018951s\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483303054Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=True, balances=[AccountBalance(total=1_000.00 USD, locked=0.00 USD, free=1_000.00 USD)], margins=[], event_id=e056aac5-cd3c-4fcb-b173-4b7b6192c7cc)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483330596Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: STARTING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483357700Z\u001b[0m [INFO] BACKTESTER-001.DataClient-SIM: Connecting...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483362079Z\u001b[0m [INFO] BACKTESTER-001.DataClient-SIM: Connected\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483385185Z\u001b[0m [INFO] BACKTESTER-001.DataClient-SIM: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483413375Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483439449Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483462358Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-SIM: Connecting...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483466719Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-SIM: Connected\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483478071Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-SIM: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483499282Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483512393Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: Connecting all clients...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483515993Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: Connecting all clients...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483528419Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: No emulated orders to reactivate\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483550130Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483570967Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Initialized 0 open orders\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483581619Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Initialized 0 open positions\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483604733Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: self.config.oms_type=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483609455Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: self.config.external_order_claims=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483612225Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: self.config.manage_gtd_expiry=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483624116Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Set ClientOrderIdGenerator client_order_id count to 0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483627767Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Set ClientOrderIdGenerator order_list_id count to 0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483679316Z\u001b[0m [INFO] BACKTESTER-001.EMACross: Registered Indicator ExponentialMovingAverage(10) for EUR/USD.SIM-15-MINUTE-BID-INTERNAL bars\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483693134Z\u001b[0m [INFO] BACKTESTER-001.EMACross: Registered Indicator ExponentialMovingAverage(20) for EUR/USD.SIM-15-MINUTE-BID-INTERNAL bars\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.483901765Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [REQ]--> DataRequest(client_id=None, venue=SIM, data_type=Bar{'bar_type': BarType(EUR/USD.SIM-15-MINUTE-BID-INTERNAL), 'start': Timestamp('2024-01-07 00:00:00.487000+0000', tz='UTC'), 'end': None})\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.484199883Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> Subscribe(client_id=None, venue=SIM, data_type=Bar{'bar_type': BarType(EUR/USD.SIM-15-MINUTE-BID-INTERNAL), 'await_partial': False})\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.484738247Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> Subscribe(client_id=None, venue=SIM, data_type=TradeTick{'instrument_id': InstrumentId('EUR/USD.SIM')})\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.484935748Z\u001b[0m [INFO] BACKTESTER-001.EMACross: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:27.484962773Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: MEMORY USAGE\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Total: 15.57 GiB\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Used: 9.60 GiB (61.67%)\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Avail: 5.97 GiB (38.33%)\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Total: 17.08 GiB\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Used: 0.00 GiB (0.00%)\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Avail: 17.08 GiB (100.00%)\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m SimulatedVenue SIM\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: MarginAccount(id=SIM-001, type=MARGIN, base=USD)\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Balances starting:\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 1_000.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m BACKTEST RUN\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run config ID: da3957891ff381bbc63c9017fb2d9b19b5858dae430abca156c747384a2f6c5f\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run ID: 27df3a75-97ec-42fa-9da1-13340c6f51ca\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run started: 2024-09-17 15:22:27.483133+00:00\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Backtest start: 2024-01-08 00:00:00.487000+00:00\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Batch start: 2024-01-08 00:00:00.487000+00:00\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Batch end: 2024-01-08 22:59:55.392000+00:00\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:00:00.487000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08235,1.08275,1.08232,1.08266,670000000,1704672900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:15:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [1]\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08266,1.08300,1.08260,1.08291,450000000,1704673800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:30:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [2]\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08291,1.08291,1.08248,1.08264,442000000,1704674700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T00:45:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [3]\u001b[0m\n",
+ "\u001b[1m2024-01-08T01:00:00.173000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08264,1.08289,1.08249,1.08276,858000000,1704675600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T01:00:00.173000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [4]\u001b[0m\n",
+ "\u001b[1m2024-01-08T01:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08275,1.08309,1.08269,1.08284,932000000,1704676500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T01:15:03.221000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [5]\u001b[0m\n",
+ "\u001b[1m2024-01-08T01:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08284,1.08316,1.08274,1.08311,508000000,1704677400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T01:30:00.021000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [6]\u001b[0m\n",
+ "\u001b[1m2024-01-08T01:45:01.131000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08311,1.08336,1.08311,1.08321,1238000000,1704678300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T01:45:01.234000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [7]\u001b[0m\n",
+ "\u001b[1m2024-01-08T02:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08321,1.08329,1.08273,1.08276,821000000,1704679200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T02:00:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [8]\u001b[0m\n",
+ "\u001b[1m2024-01-08T02:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08275,1.08279,1.08242,1.08249,581000000,1704680100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T02:15:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [9]\u001b[0m\n",
+ "\u001b[1m2024-01-08T02:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08250,1.08307,1.08249,1.08285,730000000,1704681000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T02:30:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [10]\u001b[0m\n",
+ "\u001b[1m2024-01-08T02:45:01.249000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08286,1.08296,1.08268,1.08294,633000000,1704681900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T02:45:02.166000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [11]\u001b[0m\n",
+ "\u001b[1m2024-01-08T03:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08292,1.08306,1.08253,1.08261,884000000,1704682800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T03:00:00.518000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [12]\u001b[0m\n",
+ "\u001b[1m2024-01-08T03:15:00.777000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08261,1.08305,1.08255,1.08299,431000000,1704683700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T03:15:05.567000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [13]\u001b[0m\n",
+ "\u001b[1m2024-01-08T03:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08299,1.08322,1.08294,1.08320,287000000,1704684600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T03:30:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [14]\u001b[0m\n",
+ "\u001b[1m2024-01-08T03:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08320,1.08345,1.08308,1.08315,458000000,1704685500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T03:45:01.359000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [15]\u001b[0m\n",
+ "\u001b[1m2024-01-08T04:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08316,1.08334,1.08309,1.08328,507000000,1704686400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T04:00:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [16]\u001b[0m\n",
+ "\u001b[1m2024-01-08T04:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08328,1.08352,1.08315,1.08345,397000000,1704687300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T04:15:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [17]\u001b[0m\n",
+ "\u001b[1m2024-01-08T04:30:05.857000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08347,1.08354,1.08321,1.08326,579000000,1704688200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T04:30:06.012000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [18]\u001b[0m\n",
+ "\u001b[1m2024-01-08T04:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08328,1.08334,1.08309,1.08312,387000000,1704689100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T04:45:00.000000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACross: Waiting for indicators to warm up [19]\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08310,1.08323,1.08263,1.08267,406000000,1704690000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-050000-001-000-1, side=BUY, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(BUY 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-050000-001-000-1, venue_order_id=None, position_id=None, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-050000-001-000-1, account_id=SIM-001, ts_event=1704690000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=999.98 USD, locked=0.00 USD, free=999.98 USD)], margins=[], event_id=520dae8d-638b-4b21-97b8-17915aea3996)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-050000-001-000-1, venue_order_id=SIM-1-001, account_id=SIM-001, trade_id=SIM-1-001, position_id=SIM-1-001, order_side=BUY, order_type=MARKET, last_qty=1_000, last_px=1.08269 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704690000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=1000\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=32.50 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionOpened(instrument_id=EUR/USD.SIM, position_id=SIM-1-001, account_id=SIM-001, opening_order_id=O-20240108-050000-001-000-1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=1000.0, quantity=1_000, peak_qty=1_000, currency=USD, avg_px_open=1.08269, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.02 USD, unrealized_pnl=0.00 USD, ts_opened=1704690000000000000, ts_last=1704690000000000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08267,1.08276,1.08253,1.08266,370000000,1704690900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08267,1.08290,1.08264,1.08277,571000000,1704691800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T05:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08277,1.08296,1.08269,1.08284,375000000,1704692700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08285,1.08288,1.08259,1.08272,545000000,1704693600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-060000-001-000-2, side=SELL, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(SELL 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-060000-001-000-2, venue_order_id=None, position_id=None, tags=None), position_id=SIM-1-001)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-060000-001-000-2, account_id=SIM-001, ts_event=1704693600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-060000-001-000-3, side=SELL, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(SELL 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-060000-001-000-3, venue_order_id=None, position_id=None, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-060000-001-000-3, account_id=SIM-001, ts_event=1704693600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=999.99 USD, locked=32.50 USD, free=967.49 USD)], margins=[MarginBalance(initial=0.00 USD, maintenance=32.50 USD, instrument_id=EUR/USD.SIM)], event_id=3b11088b-584a-4262-809a-40c4922b9118)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-060000-001-000-2, venue_order_id=SIM-1-002, account_id=SIM-001, trade_id=SIM-1-002, position_id=SIM-1-001, order_side=SELL, order_type=MARKET, last_qty=1_000, last_px=1.08272 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704693600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=0\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionClosed(instrument_id=EUR/USD.SIM, position_id=SIM-1-001, account_id=SIM-001, opening_order_id=O-20240108-050000-001-000-1, closing_order_id=O-20240108-060000-001-000-2, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0, peak_qty=1_000, currency=USD, avg_px_open=1.08269, avg_px_close=1.08272, realized_return=0.00003, realized_pnl=-0.01 USD, unrealized_pnl=0.00 USD, ts_opened=1704690000000000000, ts_last=1704693600000000000, ts_closed=1704693600000000000, duration_ns=3600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=999.97 USD, locked=0.00 USD, free=999.97 USD)], margins=[], event_id=0eaa5e6d-a5c1-4b42-97bb-3bb39109ecc3)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-060000-001-000-3, venue_order_id=SIM-1-003, account_id=SIM-001, trade_id=SIM-1-003, position_id=SIM-1-002, order_side=SELL, order_type=MARKET, last_qty=1_000, last_px=1.08272 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704693600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=-1000\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=32.50 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionOpened(instrument_id=EUR/USD.SIM, position_id=SIM-1-002, account_id=SIM-001, opening_order_id=O-20240108-060000-001-000-3, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-1000.0, quantity=1_000, peak_qty=1_000, currency=USD, avg_px_open=1.08272, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.02 USD, unrealized_pnl=0.00 USD, ts_opened=1704693600000000000, ts_last=1704693600000000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08270,1.08277,1.08219,1.08225,935000000,1704694500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:30:00.185000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08227,1.08241,1.08173,1.08176,821000000,1704695400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T06:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08175,1.08177,1.08114,1.08140,1449000000,1704696300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T07:00:00.116000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08141,1.08162,1.08110,1.08160,1114000000,1704697200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T07:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08161,1.08199,1.08100,1.08100,1695000000,1704698100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T07:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08101,1.08117,1.08071,1.08087,1091000000,1704699000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T07:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08088,1.08093,1.08031,1.08058,1072000000,1704699900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T08:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08059,1.08080,1.07991,1.08009,1212000000,1704700800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T08:15:07.471000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08009,1.08021,1.07835,1.07843,1764000000,1704701700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T08:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07840,1.07868,1.07813,1.07841,1661000000,1704702600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T08:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07841,1.07896,1.07838,1.07885,1403000000,1704703500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T09:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07886,1.07908,1.07843,1.07843,1205000000,1704704400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T09:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07842,1.07842,1.07785,1.07833,1005000000,1704705300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T09:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07832,1.07858,1.07800,1.07821,873000000,1704706200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T09:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07819,1.07861,1.07815,1.07832,630000000,1704707100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T10:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07831,1.07836,1.07774,1.07778,888000000,1704708000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T10:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07781,1.07853,1.07779,1.07848,678000000,1704708900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T10:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07848,1.07890,1.07844,1.07871,488000000,1704709800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T10:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07872,1.07896,1.07871,1.07877,318000000,1704710700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T11:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07876,1.07879,1.07805,1.07842,680000000,1704711600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T11:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07844,1.07950,1.07805,1.07949,1543000000,1704712500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T11:30:56.750000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07949,1.07958,1.07893,1.07911,984000000,1704713400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T11:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07910,1.07933,1.07859,1.07921,1356000000,1704714300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T12:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07922,1.07949,1.07900,1.07918,1255000000,1704715200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T12:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07919,1.07921,1.07869,1.07887,1707000000,1704716100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T12:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07887,1.07955,1.07885,1.07909,1221000000,1704717000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T12:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07909,1.08084,1.07905,1.07954,3272000000,1704717900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T13:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07954,1.07996,1.07950,1.07964,1759000000,1704718800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T13:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07963,1.07964,1.07877,1.07888,1765000000,1704719700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T13:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07889,1.07941,1.07872,1.07919,1685000000,1704720600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T13:45:01.019000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07919,1.08031,1.07916,1.08003,1658000000,1704721500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08004,1.08060,1.08003,1.08027,1565000000,1704722400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-140000-001-000-4, side=BUY, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(BUY 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-140000-001-000-4, venue_order_id=None, position_id=None, tags=None), position_id=SIM-1-002)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-140000-001-000-4, account_id=SIM-001, ts_event=1704722400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-140000-001-000-5, side=BUY, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(BUY 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-140000-001-000-5, venue_order_id=None, position_id=None, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-140000-001-000-5, account_id=SIM-001, ts_event=1704722400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=1_002.28 USD, locked=32.50 USD, free=969.78 USD)], margins=[MarginBalance(initial=0.00 USD, maintenance=32.50 USD, instrument_id=EUR/USD.SIM)], event_id=e7f19617-e0ff-46c4-80a1-67b6c795fc11)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-140000-001-000-4, venue_order_id=SIM-1-004, account_id=SIM-001, trade_id=SIM-1-004, position_id=SIM-1-002, order_side=BUY, order_type=MARKET, last_qty=1_000, last_px=1.08039 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704722400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=0\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionClosed(instrument_id=EUR/USD.SIM, position_id=SIM-1-002, account_id=SIM-001, opening_order_id=O-20240108-060000-001-000-3, closing_order_id=O-20240108-140000-001-000-4, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0, peak_qty=1_000, currency=USD, avg_px_open=1.08272, avg_px_close=1.08039, realized_return=0.00215, realized_pnl=2.29 USD, unrealized_pnl=0.00 USD, ts_opened=1704693600000000000, ts_last=1704722400000000000, ts_closed=1704722400000000000, duration_ns=28800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=1_002.26 USD, locked=0.00 USD, free=1_002.26 USD)], margins=[], event_id=ff7b1dfb-3aaf-42a8-b370-d172ee9d03a8)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-140000-001-000-5, venue_order_id=SIM-1-005, account_id=SIM-001, trade_id=SIM-1-005, position_id=SIM-1-003, order_side=BUY, order_type=MARKET, last_qty=1_000, last_px=1.08039 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704722400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=1000\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=32.43 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:00:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionOpened(instrument_id=EUR/USD.SIM, position_id=SIM-1-003, account_id=SIM-001, opening_order_id=O-20240108-140000-001-000-5, closing_order_id=None, entry=BUY, side=LONG, signed_qty=1000.0, quantity=1_000, peak_qty=1_000, currency=USD, avg_px_open=1.08039, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.02 USD, unrealized_pnl=0.00 USD, ts_opened=1704722400000000000, ts_last=1704722400000000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:15:00.084000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08034,1.08182,1.08027,1.08103,3339000000,1704723300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08103,1.08103,1.07958,1.08005,2297000000,1704724200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T14:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.08007,1.08043,1.07951,1.07969,2096000000,1704725100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:00:01.061000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07970,1.07972,1.07872,1.07921,2452000000,1704726000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07922,1.07945,1.07860,1.07862,1952000000,1704726900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-151500-001-000-6, side=SELL, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(SELL 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-151500-001-000-6, venue_order_id=None, position_id=None, tags=None), position_id=SIM-1-003)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-151500-001-000-6, account_id=SIM-001, ts_event=1704726900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-151500-001-000-7, side=SELL, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(SELL 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-151500-001-000-7, venue_order_id=None, position_id=None, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-151500-001-000-7, account_id=SIM-001, ts_event=1704726900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=1_000.47 USD, locked=32.43 USD, free=968.04 USD)], margins=[MarginBalance(initial=0.00 USD, maintenance=32.43 USD, instrument_id=EUR/USD.SIM)], event_id=338aba46-81c3-454c-b7c0-b2af47e179ef)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-151500-001-000-6, venue_order_id=SIM-1-006, account_id=SIM-001, trade_id=SIM-1-006, position_id=SIM-1-003, order_side=SELL, order_type=MARKET, last_qty=1_000, last_px=1.07862 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704726900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=0\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionClosed(instrument_id=EUR/USD.SIM, position_id=SIM-1-003, account_id=SIM-001, opening_order_id=O-20240108-140000-001-000-5, closing_order_id=O-20240108-151500-001-000-6, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0, peak_qty=1_000, currency=USD, avg_px_open=1.08039, avg_px_close=1.07862, realized_return=-0.00164, realized_pnl=-1.81 USD, unrealized_pnl=0.00 USD, ts_opened=1704722400000000000, ts_last=1704726900000000000, ts_closed=1704726900000000000, duration_ns=4500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=1_000.45 USD, locked=0.00 USD, free=1_000.45 USD)], margins=[], event_id=1e72fdb6-a437-45c2-933d-636e1b2f35f1)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-151500-001-000-7, venue_order_id=SIM-1-007, account_id=SIM-001, trade_id=SIM-1-007, position_id=SIM-1-004, order_side=SELL, order_type=MARKET, last_qty=1_000, last_px=1.07862 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704726900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=-1000\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=32.38 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:15:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionOpened(instrument_id=EUR/USD.SIM, position_id=SIM-1-004, account_id=SIM-001, opening_order_id=O-20240108-151500-001-000-7, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-1000.0, quantity=1_000, peak_qty=1_000, currency=USD, avg_px_open=1.07862, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.02 USD, unrealized_pnl=0.00 USD, ts_opened=1704726900000000000, ts_last=1704726900000000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07861,1.07892,1.07836,1.07849,1570000000,1704727800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T15:45:00.031000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07849,1.07887,1.07842,1.07863,1579000000,1704728700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T16:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07863,1.07926,1.07851,1.07886,1292000000,1704729600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T16:15:00.102000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07887,1.07947,1.07879,1.07927,1154000000,1704730500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T16:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07927,1.07967,1.07887,1.07909,1348000000,1704731400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T16:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07908,1.07910,1.07841,1.07845,1661000000,1704732300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T17:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07845,1.07863,1.07802,1.07862,1289000000,1704733200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T17:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07863,1.07887,1.07849,1.07880,1137000000,1704734100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T17:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07880,1.07905,1.07875,1.07891,703000000,1704735000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T17:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07892,1.07902,1.07871,1.07882,800000000,1704735900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T18:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07883,1.07920,1.07881,1.07915,798000000,1704736800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T18:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07917,1.07919,1.07873,1.07883,935000000,1704737700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T18:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07887,1.07891,1.07835,1.07852,927000000,1704738600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T18:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07851,1.07884,1.07843,1.07856,847000000,1704739500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T19:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07857,1.07864,1.07828,1.07837,1048000000,1704740400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T19:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07838,1.07891,1.07825,1.07878,1242000000,1704741300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T19:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07878,1.07915,1.07863,1.07914,908000000,1704742200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T19:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07914,1.07945,1.07912,1.07917,652000000,1704743100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T20:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07919,1.07954,1.07892,1.07897,1062000000,1704744000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T20:15:01.585000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07897,1.07897,1.07869,1.07875,528000000,1704744900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T20:30:00.135000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07876,1.07894,1.07864,1.07866,159000000,1704745800000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T20:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07865,1.07883,1.07865,1.07883,577000000,1704746700000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07882,1.07917,1.07875,1.07911,784000000,1704747600000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07911,1.07911,1.07887,1.07907,227000000,1704748500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07907,1.07925,1.07906,1.07906,464000000,1704749400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-213000-001-000-8, side=BUY, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(BUY 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-213000-001-000-8, venue_order_id=None, position_id=None, tags=None), position_id=SIM-1-004)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-213000-001-000-8, account_id=SIM-001, ts_event=1704749400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-213000-001-000-9, side=BUY, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(BUY 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-213000-001-000-9, venue_order_id=None, position_id=None, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-213000-001-000-9, account_id=SIM-001, ts_event=1704749400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=999.85 USD, locked=32.38 USD, free=967.47 USD)], margins=[MarginBalance(initial=0.00 USD, maintenance=32.38 USD, instrument_id=EUR/USD.SIM)], event_id=74fc623e-408e-4ce8-ba05-20623a44f11f)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-213000-001-000-8, venue_order_id=SIM-1-008, account_id=SIM-001, trade_id=SIM-1-008, position_id=SIM-1-004, order_side=BUY, order_type=MARKET, last_qty=1_000, last_px=1.07920 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704749400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=0\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionClosed(instrument_id=EUR/USD.SIM, position_id=SIM-1-004, account_id=SIM-001, opening_order_id=O-20240108-151500-001-000-7, closing_order_id=O-20240108-213000-001-000-8, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0, peak_qty=1_000, currency=USD, avg_px_open=1.07862, avg_px_close=1.0792, realized_return=-0.00054, realized_pnl=-0.62 USD, unrealized_pnl=0.00 USD, ts_opened=1704726900000000000, ts_last=1704749400000000000, ts_closed=1704749400000000000, duration_ns=22500000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=999.83 USD, locked=0.00 USD, free=999.83 USD)], margins=[], event_id=8fb7c4db-6797-451d-9be6-e06d131381d1)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-213000-001-000-9, venue_order_id=SIM-1-009, account_id=SIM-001, trade_id=SIM-1-009, position_id=SIM-1-005, order_side=BUY, order_type=MARKET, last_qty=1_000, last_px=1.07920 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704749400000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=1000\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=32.40 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:30:00.000000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionOpened(instrument_id=EUR/USD.SIM, position_id=SIM-1-005, account_id=SIM-001, opening_order_id=O-20240108-213000-001-000-9, closing_order_id=None, entry=BUY, side=LONG, signed_qty=1000.0, quantity=1_000, peak_qty=1_000, currency=USD, avg_px_open=1.0792, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.02 USD, unrealized_pnl=0.00 USD, ts_opened=1704749400000000000, ts_last=1704749400000000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-01-08T21:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07907,1.07920,1.07906,1.07911,324000000,1704750300000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:00:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07913,1.07918,1.07910,1.07913,238000000,1704751200000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:15:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07911,1.07932,1.07908,1.07911,378000000,1704752100000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:30:01.803000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07911,1.07916,1.07891,1.07909,386000000,1704753000000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:45:00.000000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACross: Bar(EUR/USD.SIM-15-MINUTE-BID-INTERNAL,1.07908,1.07915,1.07874,1.07879,552000000,1704753900000000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: No EUR/USD.SIM open or emulated orders to cancel\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderInitialized(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-225955-001-000-10, side=SELL, type=MARKET, quantity=1_000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> SubmitOrder(order=MarketOrder(SELL 1_000 EUR/USD.SIM MARKET GTC, status=INITIALIZED, client_order_id=O-20240108-225955-001-000-10, venue_order_id=None, position_id=None, tags=None), position_id=SIM-1-005)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderSubmitted(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-225955-001-000-10, account_id=SIM-001, ts_event=1704754795392000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> Unsubscribe(client_id=None, venue=SIM, data_type=Bar{'bar_type': BarType(EUR/USD.SIM-15-MINUTE-BID-INTERNAL)})\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: Unsubscribed from EUR/USD.SIM-15-MINUTE-BID-INTERNAL bar data\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: [CMD]--> Unsubscribe(client_id=None, venue=SIM, data_type=TradeTick{'instrument_id': InstrumentId('EUR/USD.SIM')})\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.DataClient-SIM: Disconnecting...\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.DataClient-SIM: Disconnected\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.DataClient-SIM: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-SIM: Disconnecting...\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-SIM: Disconnected\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-SIM: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_init=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=SIM-001, account_type=MARGIN, base_currency=USD, is_reported=False, balances=[AccountBalance(total=999.45 USD, locked=32.40 USD, free=967.05 USD)], margins=[MarginBalance(initial=0.00 USD, maintenance=32.40 USD, instrument_id=EUR/USD.SIM)], event_id=e26c8858-cea7-425c-8db9-49c2aaa19771)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] OrderFilled(instrument_id=EUR/USD.SIM, client_order_id=O-20240108-225955-001-000-10, venue_order_id=SIM-1-010, account_id=SIM-001, trade_id=SIM-1-010, position_id=SIM-1-005, order_side=SELL, order_type=MARKET, last_qty=1_000, last_px=1.07884 USD, commission=0.02 USD, liquidity_side=TAKER, ts_event=1704754795392000000)\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM net_position=0\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: EUR/USD.SIM margin_maint=0.00 USD\u001b[0m\n",
+ "\u001b[1m2024-01-08T22:59:55.392000000Z\u001b[0m [INFO] BACKTESTER-001.EMACross: <--[EVT] PositionClosed(instrument_id=EUR/USD.SIM, position_id=SIM-1-005, account_id=SIM-001, opening_order_id=O-20240108-213000-001-000-9, closing_order_id=O-20240108-225955-001-000-10, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0, peak_qty=1_000, currency=USD, avg_px_open=1.0792, avg_px_close=1.07884, realized_return=-0.00033, realized_pnl=-0.40 USD, unrealized_pnl=0.00 USD, ts_opened=1704749400000000000, ts_last=1704754795392000000, ts_closed=1704754795392000000, duration_ns=5395392000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469084403Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469087309Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m BACKTEST POST-RUN\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469088944Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469090427Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run config ID: da3957891ff381bbc63c9017fb2d9b19b5858dae430abca156c747384a2f6c5f\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469092598Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run ID: 27df3a75-97ec-42fa-9da1-13340c6f51ca\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469112951Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run started: 2024-09-17 15:22:27.483133+00:00\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469123555Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run finished: 2024-09-17 15:22:29.469016+00:00\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469149642Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Elapsed time: 0 days 00:00:01.985883\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469164521Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Backtest start: 2024-01-08 00:00:00.487000+00:00\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469175714Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Backtest end: 2024-01-08 22:59:55.392000+00:00\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469188003Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Backtest range: 0 days 22:59:54.905000\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469190413Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Iterations: 92,956\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469192046Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Total events: 20\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469210288Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Total orders: 10\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469223323Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Total positions: 5\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469229649Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469231724Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m SimulatedVenue SIM\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469233299Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469235413Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: MarginAccount(id=SIM-001, type=MARGIN, base=USD)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469236876Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469238310Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Balances starting:\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469249676Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 1_000.00 USD\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469252012Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469253622Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Balances ending:\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469255042Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 999.45 USD\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469256468Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469257867Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Commissions:\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469266800Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: -0.20 USD\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469269154Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469270764Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Unrealized PnLs (included in totals):\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469281309Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469283685Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469285304Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m PORTFOLIO PERFORMANCE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.469286742Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478261693Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL Statistics (EUR)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478276459Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478328294Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL (total): 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478332345Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL% (total): 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478334459Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Max Winner: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478336161Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Avg Winner: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478337749Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Min Winner: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478339289Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Min Loser: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478340848Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Avg Loser: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478347088Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Max Loser: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478349158Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Expectancy: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478350748Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Win Rate: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478352272Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478353855Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL Statistics (USD)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478355376Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478642291Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL (total): -0.55\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478646339Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL% (total): -0.05499999999999545\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478648319Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Max Winner: 2.29\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478650365Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Avg Winner: 2.29\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478652065Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Min Winner: 2.29\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478653614Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Min Loser: -0.01\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478655100Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Avg Loser: -0.71\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478656601Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Max Loser: -1.81\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478658055Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Expectancy: -0.10999999999999993\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478659578Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Win Rate: 0.2\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478661101Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478662623Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Returns Statistics\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.478664042Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487822608Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Returns Volatility (252 days): nan\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487837820Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Average (Return): -6.598109824246617e-05\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487841297Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Average Loss (Return): -0.0008365339468216485\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487844215Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Average Win (Return): 0.0010898481746263074\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487846848Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Sharpe Ratio (252 days): nan\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487849717Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Sortino Ratio (252 days): -15.874507866387544\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487852351Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Profit Factor: 0.8685426963381528\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487854654Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Risk Return Ratio: -0.04757289282724813\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487857664Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487860469Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: General Statistics\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487863211Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487865514Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Long Ratio: 0.60\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.487867960Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492226908Z\u001b[0m [INFO] BACKTESTER-001.DataClient-SIM: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492244612Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492247434Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492295764Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-SIM: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492299634Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492329705Z\u001b[0m [INFO] BACKTESTER-001.MessageBus: Closed message bus\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492333653Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Cleared all actors\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492374348Z\u001b[0m [INFO] BACKTESTER-001.EMACross: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492379079Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Cleared all trading strategies\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492381075Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Cleared all execution algorithms\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:29.492413563Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: DISPOSED\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "results = node.run()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[BacktestResult(trader_id='BACKTESTER-001', machine_id='fortesense-hppro3500series', run_config_id='da3957891ff381bbc63c9017fb2d9b19b5858dae430abca156c747384a2f6c5f', instance_id='0dbc987b-4c3e-4c9d-aea2-362b182ed4f8', run_id='27df3a75-97ec-42fa-9da1-13340c6f51ca', run_started=1726586547483133000, run_finished=1726586549469016000, backtest_start=1704672000487000000, backtest_end=1704754795392000000, elapsed_time=82794.905, iterations=0, total_events=20, total_orders=10, total_positions=5, stats_pnls={'USD': {'PnL (total)': -0.55, 'PnL% (total)': -0.05499999999999545, 'Max Winner': 2.29, 'Avg Winner': np.float64(2.29), 'Min Winner': np.float64(2.29), 'Min Loser': np.float64(-0.01), 'Avg Loser': np.float64(-0.71), 'Max Loser': np.float64(-1.81), 'Expectancy': np.float64(-0.10999999999999993), 'Win Rate': 0.2}}, stats_returns={'Returns Volatility (252 days)': np.float64(nan), 'Average (Return)': np.float64(-6.598109824246617e-05), 'Average Loss (Return)': np.float64(-0.0008365339468216485), 'Average Win (Return)': np.float64(0.0010898481746263074), 'Sharpe Ratio (252 days)': np.float64(nan), 'Sortino Ratio (252 days)': np.float64(-15.874507866387544), 'Profit Factor': np.float64(0.8685426963381528), 'Risk Return Ratio': np.float64(-0.04757289282724813)})]"
+ ]
+ },
+ "execution_count": 25,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "results"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# results[0].generate_positions_report()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Using Low Level Backtest Engine (low-level API)\n",
+ "\n",
+ "Tutorial for [NautilusTrader](https://nautilustrader.io/docs/) a high-performance algorithmic trading platform and event driven backtester.\n",
+ "\n",
+ "[View source on GitHub](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/getting_started/backtest_low_level.ipynb).\n",
+ "\n",
+ "## Overview\n",
+ "\n",
+ "This tutorial walks through how to use a `BacktestEngine` to backtest a simple EMA cross strategy\n",
+ "with a TWAP execution algorithm on a simulated Binance Spot exchange using historical trade tick data.\n",
+ "\n",
+ "The following points will be covered:\n",
+ "- How to load raw data (external to Nautilus) using data loaders and wranglers\n",
+ "- How to add this data to a `BacktestEngine`\n",
+ "- How to add venues, strategies and execution algorithms to a `BacktestEngine`\n",
+ "- How to run backtests with a `BacktestEngine`\n",
+ "- Post-run analysis and options for repeated runs\n",
+ "\n",
+ "## Prerequisites\n",
+ "- Python 3.10+ installed\n",
+ "- [JupyterLab](https://jupyter.org/) or similar installed (`pip install -U jupyterlab`)\n",
+ "- [NautilusTrader](https://pypi.org/project/nautilus_trader/) latest release installed (`pip install -U nautilus_trader`)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Imports\n",
+ "\n",
+ "We'll start with all of our imports for the remainder of this tutorial."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from decimal import Decimal\n",
+ "\n",
+ "from nautilus_trader.backtest.engine import BacktestEngine\n",
+ "from nautilus_trader.backtest.engine import BacktestEngineConfig\n",
+ "from nautilus_trader.examples.algorithms.twap import TWAPExecAlgorithm\n",
+ "from nautilus_trader.examples.strategies.ema_cross_twap import EMACrossTWAP\n",
+ "from nautilus_trader.examples.strategies.ema_cross_twap import EMACrossTWAPConfig\n",
+ "from nautilus_trader.model.currencies import ETH\n",
+ "from nautilus_trader.model.currencies import USDT\n",
+ "from nautilus_trader.model.data import BarType\n",
+ "from nautilus_trader.model.enums import AccountType\n",
+ "from nautilus_trader.model.enums import OmsType\n",
+ "from nautilus_trader.model.identifiers import TraderId\n",
+ "from nautilus_trader.model.identifiers import Venue\n",
+ "from nautilus_trader.model.objects import Money\n",
+ "from nautilus_trader.persistence.wranglers import TradeTickDataWrangler\n",
+ "from nautilus_trader.test_kit.providers import TestDataProvider\n",
+ "from nautilus_trader.test_kit.providers import TestInstrumentProvider"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Loading data\n",
+ "\n",
+ "For this tutorial we'll use some stub test data which exists in the NautilusTrader repository\n",
+ "(this data is also used by the automated test suite to test the correctness of the platform).\n",
+ "\n",
+ "Firstly, instantiate a data provider which we can use to read raw CSV trade tick data into memory as a `pd.DataFrame`.\n",
+ "We then need to initialize the instrument which matches the data, in this case the `ETHUSDT` spot cryptocurrency pair for Binance.\n",
+ "We'll use this instrument for the remainder of this backtest run.\n",
+ "\n",
+ "Next, we need to wrangle this data into a list of Nautilus `TradeTick` objects, which can we later add to the `BacktestEngine`."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Couldn't find test data directory, test data will be pulled from GitHub\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "[TradeTick(ETHUSDT.BINANCE,423.76,2.67900,SELLER,148568980,1597399200223000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.74,2.31976,SELLER,148568981,1597399200976000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.73,2.16924,SELLER,148568982,1597399200976000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.68,0.19096,SELLER,148568983,1597399201185000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.70,0.82490,BUYER,148568984,1597399201913000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.70,0.10117,BUYER,148568985,1597399202258000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.70,0.63290,BUYER,148568986,1597399202531000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.70,2.50000,BUYER,148568987,1597399203451000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.69,14.75000,SELLER,148568988,1597399204206000000),\n",
+ " TradeTick(ETHUSDT.BINANCE,423.66,0.16914,BUYER,148568989,1597399204344000000)]"
+ ]
+ },
+ "execution_count": 28,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Load stub test data\n",
+ "provider = TestDataProvider()\n",
+ "trades_df = provider.read_csv_ticks(\"binance/ethusdt-trades.csv\")\n",
+ "\n",
+ "# Initialize the instrument which matches the data\n",
+ "ETHUSDT_BINANCE = TestInstrumentProvider.ethusdt_binance()\n",
+ "\n",
+ "# Process into Nautilus objects\n",
+ "wrangler = TradeTickDataWrangler(instrument=ETHUSDT_BINANCE)\n",
+ "ticks = wrangler.process(trades_df)\n",
+ "ticks[:10]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Initialize a backtest engine\n",
+ "\n",
+ "Now we'll need a backtest engine, minimally you could just call `BacktestEngine()` which will instantiate\n",
+ "an engine with a default configuration. \n",
+ "\n",
+ "Here we also show initializing a `BacktestEngineConfig` (will only a custom `trader_id` specified)\n",
+ "to show the general configuration pattern.\n",
+ "\n",
+ "See the [Configuration](https://nautilustrader.io/docs/api_reference/config) API reference for details of all configuration options available."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:35.198285671Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Building system kernel\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198360271Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.database=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198386584Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.encoding='msgpack'\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198407417Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.timestamps_as_iso8601=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198427038Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.buffer_interval_ms=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198447915Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.autotrim_mins=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198469548Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.use_trader_prefix=True\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198488799Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.use_trader_id=True\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198509463Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.use_instance_id=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198531399Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.streams_prefix='stream'\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198552457Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.MessageBus: config.types_filter=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.198604248Z\u001b[0m [INFO] BACKTESTER-001.Cache: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.199220553Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.199450298Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.199568103Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.RiskEngine: TradingState is ACTIVE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.199691556Z\u001b[0m [INFO] BACKTESTER-001.Throttler-ORDER_SUBMIT_THROTTLER: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.199751443Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.RiskEngine: Set MAX_ORDER_SUBMIT_RATE: 100/00:00:01\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.199826919Z\u001b[0m [INFO] BACKTESTER-001.Throttler-ORDER_MODIFY_THROTTLER: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200010895Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.RiskEngine: Set MAX_ORDER_MODIFY_RATE: 100/00:00:01\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200211708Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200374250Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.ExecEngine: config.snapshot_orders=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200398338Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.ExecEngine: config.snapshot_positions=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200419386Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.ExecEngine: config.snapshot_positions_interval_secs=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200468000Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 general objects from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200494045Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 currencies from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200517421Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 instruments from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200539414Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 accounts from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200562223Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 orders from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200593640Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 order lists from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200617875Z\u001b[0m [INFO] BACKTESTER-001.Cache: Cached 0 positions from database\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200657901Z\u001b[0m [INFO] BACKTESTER-001.Cache: Checking data integrity\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200692814Z\u001b[0m \u001b[92m[INFO] BACKTESTER-001.Cache: Integrity check passed in 30μs\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200740200Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: Loaded cache in 0ms\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.200836600Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.201086324Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.201709105Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Initialized in 3ms\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Configure backtest engine\n",
+ "config = BacktestEngineConfig(trader_id=TraderId(\"BACKTESTER-001\"))\n",
+ "\n",
+ "# Build the backtest engine\n",
+ "engine = BacktestEngine(config=config)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Add venues\n",
+ "\n",
+ "We'll need a venue to trade on, which should match the *market* data being added to the engine.\n",
+ "\n",
+ "In this case we'll set up a *simulated* Binance Spot exchange."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:35.435786175Z\u001b[0m [INFO] BACKTESTER-001.SimulatedExchange(BINANCE): OmsType=NETTING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.435860920Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.436037400Z\u001b[0m [INFO] BACKTESTER-001.SimulatedExchange(BINANCE): Registered ExecutionClient-BINANCE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.436058090Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: Registered ExecutionClient-BINANCE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.436076531Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Added SimulatedExchange(id=BINANCE, oms_type=NETTING, account_type=CASH)\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Add a trading venue (multiple venues possible)\n",
+ "BINANCE = Venue(\"BINANCE\")\n",
+ "engine.add_venue(\n",
+ " venue=BINANCE,\n",
+ " oms_type=OmsType.NETTING,\n",
+ " account_type=AccountType.CASH, # Spot CASH account (not for perpetuals or futures)\n",
+ " base_currency=None, # Multi-currency account\n",
+ " starting_balances=[Money(1_000_000.0, USDT), Money(10.0, ETH)],\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Add data\n",
+ "\n",
+ "Now we can add data to the backtest engine. First add the `Instrument` object we previously initialized, which matches our data.\n",
+ "\n",
+ "Then we can add the trade ticks we wrangled earlier."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:35.918057306Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.918079198Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: Registered BINANCE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.918250091Z\u001b[0m [INFO] BACKTESTER-001.SimulatedExchange(BINANCE): Added instrument ETHUSDT.BINANCE and created matching engine\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.918254463Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Added ETHUSDT.BINANCE Instrument\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:35.927452700Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Added 69,806 ETHUSDT.BINANCE TradeTick elements\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Add instrument(s)\n",
+ "engine.add_instrument(ETHUSDT_BINANCE)\n",
+ "\n",
+ "# Add data\n",
+ "engine.add_data(ticks)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ ":::note\n",
+ "The amount of and variety of data types is only limited by machine resources and your imagination (custom types are possible).\n",
+ "Also, multiple venues can be used for backtesting, again only limited by machine resources.\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Add strategies\n",
+ "\n",
+ "Now we can add the trading strategies we’d like to run as part of our system.\n",
+ "\n",
+ ":::note\n",
+ "Multiple strategies and instruments can be used for backtesting, only limited by machine resources.\n",
+ ":::\n",
+ "\n",
+ "Firstly, initialize a strategy configuration, then use this to initialize a strategy which we can add to the engine:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:36.110237026Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.110616457Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: Registered OMS.UNSPECIFIED for Strategy EMACrossTWAP-000\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.110622134Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Registered Strategy EMACrossTWAP-000\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Configure your strategy\n",
+ "strategy_config = EMACrossTWAPConfig(\n",
+ " instrument_id=ETHUSDT_BINANCE.id,\n",
+ " bar_type=BarType.from_str(\"ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL\"),\n",
+ " trade_size=Decimal(\"0.10\"),\n",
+ " fast_ema_period=10,\n",
+ " slow_ema_period=20,\n",
+ " twap_horizon_secs=10.0,\n",
+ " twap_interval_secs=2.5,\n",
+ ")\n",
+ "\n",
+ "# Instantiate and add your strategy\n",
+ "strategy = EMACrossTWAP(config=strategy_config)\n",
+ "engine.add_strategy(strategy=strategy)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "You may notice that this strategy config includes parameters related to a TWAP execution algorithm.\n",
+ "This is because we can flexibly use different parameters per order submit, we still need to initialize\n",
+ "and add the actual `ExecAlgorithm` component which will execute the algorithm - which we'll do now.\n",
+ "\n",
+ "## Add execution algorithms\n",
+ "\n",
+ "NautilusTrader enables us to build up very complex systems of custom components. Here we show just one of the custom components\n",
+ "available, in this case a built-in TWAP execution algorithm. It is configured and added to the engine in generally the same pattern as for strategies:\n",
+ "\n",
+ ":::note\n",
+ "Multiple execution algorithms can be used for backtesting, only limited by machine resources.\n",
+ ":::"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:36.439335860Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.439356695Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Registered ExecAlgorithm TWAP\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Instantiate and add your execution algorithm\n",
+ "exec_algorithm = TWAPExecAlgorithm() # Using defaults\n",
+ "engine.add_exec_algorithm(exec_algorithm)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Run backtest\n",
+ "\n",
+ "Now that we have our data, venues and trading system configured - we can run a backtest\n",
+ "Simply call the `.run(...)` method which will run a backtest over all available data by default.\n",
+ "\n",
+ "See the [BacktestEngineConfig](https://nautilustrader.io/docs/latest/api_reference/config) API reference for a complete description of all available methods and options."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:36.868126665Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=True, balances=[AccountBalance(total=1_000_000.00000000 USDT, locked=0.00000000 USDT, free=1_000_000.00000000 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=e2844c50-fc13-40b6-a6eb-3cbdfab9dd51)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868147714Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: STARTING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868154868Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: Connecting...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868159853Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: Connected\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868163450Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868166819Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868188428Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868200563Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: Connecting...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868204425Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: Connected\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868206566Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868217926Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868226450Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: Connecting all clients...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868229243Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: Connecting all clients...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868236012Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: No emulated orders to reactivate\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868246047Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868257474Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Initialized 0 open orders\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868260652Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Initialized 0 open positions\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868277537Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: self.config.oms_type=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868280208Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: self.config.external_order_claims=None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868281868Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: self.config.manage_gtd_expiry=False\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868288962Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Set ClientOrderIdGenerator client_order_id count to 0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868291017Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Set ClientOrderIdGenerator order_list_id count to 0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868329183Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Registered Indicator ExponentialMovingAverage(10) for ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL bars\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868337033Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Registered Indicator ExponentialMovingAverage(20) for ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL bars\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868376802Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [REQ]--> DataRequest(client_id=None, venue=BINANCE, data_type=Bar{'bar_type': BarType(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL), 'start': None, 'end': None})\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.868698457Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> Subscribe(client_id=None, venue=BINANCE, data_type=Bar{'bar_type': BarType(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL), 'await_partial': False})\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.869065119Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> Subscribe(client_id=None, venue=BINANCE, data_type=QuoteTick{'instrument_id': InstrumentId('ETHUSDT.BINANCE')})\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.869263258Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.869287531Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: RUNNING\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:36.869299636Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: RUNNING\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: MEMORY USAGE\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.BacktestEngine: =================================================================\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Total: 15.57 GiB\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Used: 9.63 GiB (61.85%)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: RAM-Avail: 5.94 GiB (38.15%)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Total: 17.08 GiB\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Used: 0.00 GiB (0.00%)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Swap-Avail: 17.08 GiB (100.00%)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m SimulatedVenue BINANCE\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: CashAccount(id=BINANCE-001, type=CASH, base=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Balances starting:\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 1_000_000.00000000 USDT\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 10.00000000 ETH\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m BACKTEST RUN\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run config ID: None\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run ID: 636ee571-94de-4f20-a96b-def8bf56514b\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run started: 2024-09-17 15:22:36.867968+00:00\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Backtest start: 2020-08-14 10:00:00.223000+00:00\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Batch start: 2020-08-14 10:00:00.223000+00:00\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Batch end: 2020-08-14 14:59:58.693000+00:00\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:00.223000000Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:50.453000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.76,423.76,423.22,423.31,729.43474,1597399250453000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:00:50.453000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [1]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:02:05.601000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.38,423.83,423.38,423.58,593.73361,1597399325595000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:02:05.601000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [2]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:03:47.112000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.58,423.59,423.10,423.44,535.63812,1597399427112000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:03:47.112000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [3]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:04:53.620000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.44,423.66,423.16,423.28,795.24379,1597399493504000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:04:54.036000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [4]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:05:31.546000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.28,423.28,422.71,423.10,739.72512,1597399531546000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:05:31.546000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [5]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:06:46.381000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.10,423.10,422.84,422.99,1273.74855,1597399606381000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:06:46.381000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [6]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:08:12.023000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.99,423.41,422.99,423.08,608.45721,1597399692013000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:08:12.152000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [7]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:09:39.200000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.08,423.84,422.88,423.83,566.74799,1597399779200000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:09:39.200000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [8]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:10:26.290000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.83,424.54,423.83,424.54,688.90174,1597399826290000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:10:26.290000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [9]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:10:54.983000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.55,424.95,424.52,424.91,942.58843,1597399854983000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:10:54.983000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [10]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:11:29.236000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.91,425.25,424.86,425.04,1080.78059,1597399889236000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:11:29.236000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [11]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:12:08.129000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.05,425.11,424.42,425.06,549.70103,1597399928129000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:12:08.857000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [12]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:12:40.714000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.06,425.15,424.53,424.55,466.65307,1597399960499000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:12:40.714000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [13]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:13:36.966000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.55,424.84,424.31,424.79,631.23874,1597400016966000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:13:37.081000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [14]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:14:41.540000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.79,425.04,424.76,425.04,767.85714,1597400081540000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:14:41.700000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [15]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:16:05.555000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.04,425.06,424.85,424.89,763.02818,1597400165555000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:16:05.648000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [16]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:17:31.806000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.85,424.88,424.60,424.60,655.01993,1597400251806000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:17:31.806000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [17]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:18:48.428000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.69,424.84,424.35,424.36,442.68255,1597400328428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:18:48.531000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [18]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:20:59.582000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.36,424.70,424.30,424.40,416.43982,1597400459582000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:20:59.582000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.EMACrossTWAP: Waiting for indicators to warm up [19]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.40,424.60,424.39,424.57,405.23699,1597400554574000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1, side=BUY, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-102234-001-000-1, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-102234-001-000-1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-102234-001-000-1, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-102234-001-000-1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-102234-001-000-1, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E1, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-102234-001-000-1, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-102234-001-000-1-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-102234-001-000-1, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E1, account_id=BINANCE-001, ts_event=1597400554574000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-102234-001-000-1: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Subscribing to EMACrossTWAP-000 order events\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_989.38468857 USDT, locked=0.00000000 USDT, free=999_989.38468857 USDT), AccountBalance(total=10.02500000 ETH, locked=0.00000000 ETH, free=10.02500000 ETH)], margins=[], event_id=bbac9db8-7a6f-41bb-9069-24dfe1cf9755)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E1, venue_order_id=BINANCE-1-001, account_id=BINANCE-001, trade_id=BINANCE-1-001, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.57 USDT, commission=0.00106143 USDT, liquidity_side=TAKER, ts_event=1597400554574000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:34.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-102234-001-000-1-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=424.57, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106143 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597400554574000000, ts_last=1597400554574000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:37.074000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-102234-001-000-1, event_id=fa54182c-647e-4692-928e-dcc8ff388064, ts_event=1597400557074000000, ts_init=1597400557074000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:37.074000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E2, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-102234-001-000-1, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:37.074000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-102234-001-000-1-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-102234-001-000-1, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:37.074000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E2, account_id=BINANCE-001, ts_event=1597400557074000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:37.074000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_978.76937714 USDT, locked=0.00000000 USDT, free=999_978.76937714 USDT), AccountBalance(total=10.05000000 ETH, locked=0.00000000 ETH, free=10.05000000 ETH)], margins=[], event_id=d33f4855-6de2-4179-a2b9-228f3ab876c7)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:37.074000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E2, venue_order_id=BINANCE-1-002, account_id=BINANCE-001, trade_id=BINANCE-1-002, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.57 USDT, commission=0.00106143 USDT, liquidity_side=TAKER, ts_event=1597400557074000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:37.074000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:37.074000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-102234-001-000-1-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=424.57, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00212286 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597400554574000000, ts_last=1597400557074000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:39.574000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-102234-001-000-1, event_id=8816838d-1a70-45e9-bae9-2946ad664daa, ts_event=1597400559574000000, ts_init=1597400559574000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:39.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E3, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-102234-001-000-1, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:39.574000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-102234-001-000-1-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-102234-001-000-1, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:39.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E3, account_id=BINANCE-001, ts_event=1597400559574000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:39.574000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_968.15431574 USDT, locked=0.00000000 USDT, free=999_968.15431574 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=f32b4810-232e-423f-899b-ef43dc4adf27)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:39.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1-E3, venue_order_id=BINANCE-1-003, account_id=BINANCE-001, trade_id=BINANCE-1-003, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.56 USDT, commission=0.00106140 USDT, liquidity_side=TAKER, ts_event=1597400559574000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:39.574000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:39.574000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-102234-001-000-1-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=424.5666666666666, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00318426 USDT, unrealized_pnl=-0.00050000 USDT, ts_opened=1597400554574000000, ts_last=1597400559574000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:42.074000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-102234-001-000-1, event_id=d1eaaa45-149b-46b0-ae55-0f81b0329281, ts_event=1597400562074000000, ts_init=1597400562074000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:42.074000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-102234-001-000-1, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-102234-001-000-1, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:42.074000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1, account_id=BINANCE-001, ts_event=1597400562074000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:42.074000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-102234-001-000-1\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:42.074000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_957.53950436 USDT, locked=0.00000000 USDT, free=999_957.53950436 USDT), AccountBalance(total=10.10000000 ETH, locked=0.00000000 ETH, free=10.10000000 ETH)], margins=[], event_id=ae66ea3a-234f-44d1-991f-a5d2e01887ab)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:42.074000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-102234-001-000-1, venue_order_id=BINANCE-1-004, account_id=BINANCE-001, trade_id=BINANCE-1-004, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.55 USDT, commission=0.00106138 USDT, liquidity_side=TAKER, ts_event=1597400562074000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:42.074000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:22:42.074000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-102234-001-000-1-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=424.56249999999994, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00424564 USDT, unrealized_pnl=-0.00125000 USDT, ts_opened=1597400554574000000, ts_last=1597400562074000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:23:57.555000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.57,424.88,424.48,424.68,480.11038,1597400637555000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:25:32.668000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.65,424.88,424.57,424.68,649.69383,1597400732668000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:26:47.508000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.69,424.70,424.50,424.68,503.16228,1597400807508000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:27:35.464000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.68,424.70,424.31,424.31,388.69678,1597400855464000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:29:18.892000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.29,424.62,424.00,424.03,360.48286,1597400958892000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:30:44.119000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.00,424.22,423.92,424.10,1003.78327,1597401044119000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:31:12.244000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.10,424.10,423.84,423.85,1172.58831,1597401072244000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.86,423.86,423.32,423.49,659.09009,1597401157428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-2, side=SELL, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-103237-001-000-2, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-2, account_id=BINANCE-001, ts_event=1597401157428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3, side=SELL, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-103237-001-000-3, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-103237-001-000-3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-103237-001-000-3, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-103237-001-000-3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-103237-001-000-3, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E1, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-103237-001-000-3, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-103237-001-000-3-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-103237-001-000-3, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E1, account_id=BINANCE-001, ts_event=1597401157428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-103237-001-000-3: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.88426946 USDT, locked=0.00000000 USDT, free=999_999.88426946 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=b7efbe6b-4c15-4951-842d-e8479b31f054)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-2, venue_order_id=BINANCE-1-005, account_id=BINANCE-001, trade_id=BINANCE-1-005, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.10000, last_px=423.49 USDT, commission=0.00423490 USDT, liquidity_side=TAKER, ts_event=1597401157428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-102234-001-000-1-E1, closing_order_id=O-20200814-103237-001-000-2, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=424.56249999999994, avg_px_close=423.49, realized_return=-0.00253, realized_pnl=-0.11573054 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597400554574000000, ts_last=1597401157428000000, ts_closed=1597401157428000000, duration_ns=602854000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_010.47046073 USDT, locked=0.00000000 USDT, free=1_000_010.47046073 USDT), AccountBalance(total=9.97500000 ETH, locked=0.00000000 ETH, free=9.97500000 ETH)], margins=[], event_id=d800eb69-c724-4a1e-96a2-08a1b02e36f1)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E1, venue_order_id=BINANCE-1-006, account_id=BINANCE-001, trade_id=BINANCE-1-006, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.49 USDT, commission=0.00105873 USDT, liquidity_side=TAKER, ts_event=1597401157428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:37.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-103237-001-000-3-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=423.49, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00105873 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597401157428000000, ts_last=1597401157428000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:39.928000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-103237-001-000-3, event_id=5be75fbf-5d31-45f4-8e25-dbc6d834cb8c, ts_event=1597401159928000000, ts_init=1597401159928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:39.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E2, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-103237-001-000-3, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:39.928000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-103237-001-000-3-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-103237-001-000-3, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:39.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E2, account_id=BINANCE-001, ts_event=1597401159928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:39.928000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_021.05640203 USDT, locked=0.00000000 USDT, free=1_000_021.05640203 USDT), AccountBalance(total=9.95000000 ETH, locked=0.00000000 ETH, free=9.95000000 ETH)], margins=[], event_id=12de5663-f5c5-47d9-87bf-e2f203296eab)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:39.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E2, venue_order_id=BINANCE-1-007, account_id=BINANCE-001, trade_id=BINANCE-1-007, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.48 USDT, commission=0.00105870 USDT, liquidity_side=TAKER, ts_event=1597401159928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:39.928000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:39.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-103237-001-000-3-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=423.485, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00211743 USDT, unrealized_pnl=0.00025000 USDT, ts_opened=1597401157428000000, ts_last=1597401159928000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:42.428000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-103237-001-000-3, event_id=3cf24012-76d4-4931-adf4-9bf179f31e96, ts_event=1597401162428000000, ts_init=1597401162428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:42.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E3, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-103237-001-000-3, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:42.428000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-103237-001-000-3-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-103237-001-000-3, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:42.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E3, account_id=BINANCE-001, ts_event=1597401162428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:42.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_031.64259330 USDT, locked=0.00000000 USDT, free=1_000_031.64259330 USDT), AccountBalance(total=9.92500000 ETH, locked=0.00000000 ETH, free=9.92500000 ETH)], margins=[], event_id=588918d3-dd18-4dad-9014-2dc1b81f57f5)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:42.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3-E3, venue_order_id=BINANCE-1-008, account_id=BINANCE-001, trade_id=BINANCE-1-008, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.49 USDT, commission=0.00105873 USDT, liquidity_side=TAKER, ts_event=1597401162428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:42.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:42.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-103237-001-000-3-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=423.4866666666666, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00317616 USDT, unrealized_pnl=-0.00025000 USDT, ts_opened=1597401157428000000, ts_last=1597401162428000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:44.928000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-103237-001-000-3, event_id=48dbbe70-d0dd-4e68-b58c-fdbc38b00e99, ts_event=1597401164928000000, ts_init=1597401164928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:44.928000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-103237-001-000-3, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-103237-001-000-3, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:44.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3, account_id=BINANCE-001, ts_event=1597401164928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:44.928000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-103237-001-000-3\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:44.928000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_042.22878457 USDT, locked=0.00000000 USDT, free=1_000_042.22878457 USDT), AccountBalance(total=9.90000000 ETH, locked=0.00000000 ETH, free=9.90000000 ETH)], margins=[], event_id=7665039e-e000-459f-9eab-103d9673322c)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:44.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-103237-001-000-3, venue_order_id=BINANCE-1-009, account_id=BINANCE-001, trade_id=BINANCE-1-009, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.49 USDT, commission=0.00105873 USDT, liquidity_side=TAKER, ts_event=1597401164928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:44.928000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:32:44.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-103237-001-000-3-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=423.48749999999995, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00423489 USDT, unrealized_pnl=-0.00025000 USDT, ts_opened=1597401157428000000, ts_last=1597401164928000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:34:19.933000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.49,423.49,423.32,423.42,674.19478,1597401259933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:36:29.820000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.42,424.00,423.30,423.98,1073.24904,1597401389820000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:37:47.351000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.97,424.00,423.59,423.59,819.10251,1597401467351000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:38:45.278000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.59,424.04,423.57,424.04,506.51318,1597401525278000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:40:46.704000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.05,424.33,423.89,423.90,699.89842,1597401646704000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:42:37.657000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.90,424.42,423.83,424.42,358.12997,1597401757657000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:44:31.002000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.41,424.83,424.41,424.53,515.40307,1597401871002000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.53,424.89,424.53,424.70,544.38626,1597401971428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-4, side=BUY, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-104611-001-000-4, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-4, account_id=BINANCE-001, ts_event=1597401971428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5, side=BUY, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-104611-001-000-5, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-104611-001-000-5, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-104611-001-000-5, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-104611-001-000-5, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-104611-001-000-5, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E1, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-104611-001-000-5, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-104611-001-000-5-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-104611-001-000-5, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E1, account_id=BINANCE-001, ts_event=1597401971428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-104611-001-000-5: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.75453757 USDT, locked=0.00000000 USDT, free=999_999.75453757 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=251cc0cf-87dc-442c-a560-d39f81e82d02)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-4, venue_order_id=BINANCE-1-010, account_id=BINANCE-001, trade_id=BINANCE-1-010, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.10000, last_px=424.70 USDT, commission=0.00424700 USDT, liquidity_side=TAKER, ts_event=1597401971428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-103237-001-000-3-E1, closing_order_id=O-20200814-104611-001-000-4, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=423.48749999999995, avg_px_close=424.7, realized_return=-0.00286, realized_pnl=-0.12973189 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597401157428000000, ts_last=1597401971428000000, ts_closed=1597401971428000000, duration_ns=814000000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_989.13597582 USDT, locked=0.00000000 USDT, free=999_989.13597582 USDT), AccountBalance(total=10.02500000 ETH, locked=0.00000000 ETH, free=10.02500000 ETH)], margins=[], event_id=641623b3-a98e-48ac-a33f-1b4e7b73f6da)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E1, venue_order_id=BINANCE-1-011, account_id=BINANCE-001, trade_id=BINANCE-1-011, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.70 USDT, commission=0.00106175 USDT, liquidity_side=TAKER, ts_event=1597401971428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:11.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-104611-001-000-5-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=424.7, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106175 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597401971428000000, ts_last=1597401971428000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:13.928000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-104611-001-000-5, event_id=7eccfeb1-1289-4c73-823f-e21e2a252920, ts_event=1597401973928000000, ts_init=1597401973928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:13.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E2, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-104611-001-000-5, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:13.928000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-104611-001-000-5-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-104611-001-000-5, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:13.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E2, account_id=BINANCE-001, ts_event=1597401973928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:13.928000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_978.51991432 USDT, locked=0.00000000 USDT, free=999_978.51991432 USDT), AccountBalance(total=10.05000000 ETH, locked=0.00000000 ETH, free=10.05000000 ETH)], margins=[], event_id=a974a2d3-d8c4-4b08-8031-33209a36d129)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:13.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E2, venue_order_id=BINANCE-1-012, account_id=BINANCE-001, trade_id=BINANCE-1-012, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.60 USDT, commission=0.00106150 USDT, liquidity_side=TAKER, ts_event=1597401973928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:14.447000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:14.447000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-104611-001-000-5-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=424.65000000000003, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00212325 USDT, unrealized_pnl=-0.00250000 USDT, ts_opened=1597401971428000000, ts_last=1597401973928000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:16.428000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-104611-001-000-5, event_id=c7b42d08-b23f-48bc-834a-ea23bab451ee, ts_event=1597401976428000000, ts_init=1597401976428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:16.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E3, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-104611-001-000-5, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:16.428000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-104611-001-000-5-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-104611-001-000-5, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:16.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E3, account_id=BINANCE-001, ts_event=1597401976428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:16.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_967.90510294 USDT, locked=0.00000000 USDT, free=999_967.90510294 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=e7f7fe8a-4427-4d5c-ac6d-a12c00250705)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:16.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5-E3, venue_order_id=BINANCE-1-013, account_id=BINANCE-001, trade_id=BINANCE-1-013, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.55 USDT, commission=0.00106138 USDT, liquidity_side=TAKER, ts_event=1597401976428000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:16.428000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:16.428000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-104611-001-000-5-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=424.6166666666667, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00318463 USDT, unrealized_pnl=-0.00500000 USDT, ts_opened=1597401971428000000, ts_last=1597401976428000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:18.928000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-104611-001-000-5, event_id=55ba1fd7-19d7-493e-a85d-18f2d1346ff9, ts_event=1597401978928000000, ts_init=1597401978928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:18.928000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-104611-001-000-5, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-104611-001-000-5, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:18.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5, account_id=BINANCE-001, ts_event=1597401978928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:18.928000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-104611-001-000-5\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:18.928000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_957.28979151 USDT, locked=0.00000000 USDT, free=999_957.28979151 USDT), AccountBalance(total=10.10000000 ETH, locked=0.00000000 ETH, free=10.10000000 ETH)], margins=[], event_id=71ceff3b-e52a-4a93-8617-c5ac1fc2a7cc)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:18.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-104611-001-000-5, venue_order_id=BINANCE-1-014, account_id=BINANCE-001, trade_id=BINANCE-1-014, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.57 USDT, commission=0.00106143 USDT, liquidity_side=TAKER, ts_event=1597401978928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:18.928000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:46:18.928000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-104611-001-000-5-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=424.60499999999996, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00424606 USDT, unrealized_pnl=-0.00350000 USDT, ts_opened=1597401971428000000, ts_last=1597401978928000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:48:03.401000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.69,424.69,424.51,424.59,689.13733,1597402083401000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:50:05.865000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.60,425.22,424.58,425.22,636.49443,1597402205865000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:51:05.206000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.23,425.25,424.69,425.02,1136.94765,1597402265206000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:52:27.985000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.02,425.21,424.99,425.15,679.33176,1597402347939000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:53:19.115000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.15,425.76,425.15,425.76,959.95349,1597402399115000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:53:39.297000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.70,425.90,425.32,425.67,726.39685,1597402419297000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:54:04.221000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.66,426.15,425.66,426.02,559.43652,1597402444221000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:54:29.117000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.07,426.28,426.03,426.23,291.30855,1597402469117000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:54:49.268000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.23,426.67,426.20,426.67,1250.65654,1597402489268000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:55:04.466000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.68,426.94,426.68,426.88,528.69115,1597402504466000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:55:23.817000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.88,427.00,426.66,426.88,1402.43210,1597402523805000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:55:57.600000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.88,427.00,426.63,426.95,989.78830,1597402557600000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:56:25.932000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.96,426.96,426.40,426.65,827.58550,1597402585932000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:57:15.329000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.64,427.00,426.43,426.45,785.51916,1597402633788000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:57:37.947000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.46,426.46,425.57,425.70,519.71354,1597402657947000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:58:25.574000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.73,425.89,425.26,425.27,657.42310,1597402705574000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:59:02.972000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.27,425.48,424.85,424.85,659.50130,1597402742807000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T10:59:40.214000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.85,425.02,424.55,424.55,885.45704,1597402780214000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.54,424.74,424.04,424.15,739.78219,1597402802097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-6, side=SELL, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-110002-001-000-6, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-6, account_id=BINANCE-001, ts_event=1597402802097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7, side=SELL, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-110002-001-000-7, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-110002-001-000-7, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-110002-001-000-7, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-110002-001-000-7, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-110002-001-000-7, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E1, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-110002-001-000-7, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-110002-001-000-7-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-110002-001-000-7, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E1, account_id=BINANCE-001, ts_event=1597402802097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-110002-001-000-7: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_974.17775554 USDT, locked=0.00000000 USDT, free=999_974.17775554 USDT), AccountBalance(total=10.06018000 ETH, locked=0.00000000 ETH, free=10.06018000 ETH)], margins=[], event_id=37d68fd3-1100-4c7c-87af-2120b98247d1)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-6, venue_order_id=BINANCE-1-015, account_id=BINANCE-001, trade_id=BINANCE-1-015, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.03982, last_px=424.15 USDT, commission=0.00168897 USDT, liquidity_side=TAKER, ts_event=1597402802097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.06018\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-104611-001-000-5-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.06018, quantity=0.06018, peak_qty=0.10000, currency=USDT, avg_px_open=424.60499999999996, avg_px_close=424.15, realized_return=-0.00107, realized_pnl=-0.02405313 USDT, unrealized_pnl=-0.02738190 USDT, ts_opened=1597401971428000000, ts_last=1597402802097000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.69994827 USDT, locked=0.00000000 USDT, free=999_999.69994827 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=9fac5131-081f-4ee1-94b3-cbba5eefb0d4)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-6, venue_order_id=BINANCE-1-015, account_id=BINANCE-001, trade_id=BINANCE-1-016, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.06018, last_px=424.14 USDT, commission=0.00255247 USDT, liquidity_side=TAKER, ts_event=1597402802097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-104611-001-000-5-E1, closing_order_id=O-20200814-110002-001-000-6, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=424.60499999999996, avg_px_close=424.14398199999994, realized_return=-0.00109, realized_pnl=-0.05458930 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597401971428000000, ts_last=1597402802097000000, ts_closed=1597402802097000000, duration_ns=830669000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_010.30263789 USDT, locked=0.00000000 USDT, free=1_000_010.30263789 USDT), AccountBalance(total=9.97500000 ETH, locked=0.00000000 ETH, free=9.97500000 ETH)], margins=[], event_id=fe7bf5f4-f8a7-4968-84d0-5c8dd49886cc)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E1, venue_order_id=BINANCE-1-016, account_id=BINANCE-001, trade_id=BINANCE-1-017, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=424.15 USDT, commission=0.00106038 USDT, liquidity_side=TAKER, ts_event=1597402802097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:02.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-110002-001-000-7-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=424.15, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106038 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597402802097000000, ts_last=1597402802097000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:04.597000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-110002-001-000-7, event_id=1ea34dc9-d347-4063-a7b7-8db48be5d1bb, ts_event=1597402804597000000, ts_init=1597402804597000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:04.597000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E2, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-110002-001-000-7, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:04.597000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-110002-001-000-7-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-110002-001-000-7, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:04.597000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E2, account_id=BINANCE-001, ts_event=1597402804597000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:04.637000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_020.90232781 USDT, locked=0.00000000 USDT, free=1_000_020.90232781 USDT), AccountBalance(total=9.95000000 ETH, locked=0.00000000 ETH, free=9.95000000 ETH)], margins=[], event_id=ccf97a7f-058f-4246-89ad-9da377c44660)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:04.637000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E2, venue_order_id=BINANCE-1-017, account_id=BINANCE-001, trade_id=BINANCE-1-018, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=424.03 USDT, commission=0.00106008 USDT, liquidity_side=TAKER, ts_event=1597402804597000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:04.637000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:04.637000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-110002-001-000-7-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=424.09, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00212046 USDT, unrealized_pnl=0.00300000 USDT, ts_opened=1597402802097000000, ts_last=1597402804597000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:07.097000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-110002-001-000-7, event_id=fa562895-b8a7-45f2-b07b-dcf1f9772a79, ts_event=1597402807097000000, ts_init=1597402807097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:07.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E3, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-110002-001-000-7, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:07.097000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-110002-001-000-7-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-110002-001-000-7, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:07.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E3, account_id=BINANCE-001, ts_event=1597402807097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:07.097000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_031.49901803 USDT, locked=0.00000000 USDT, free=1_000_031.49901803 USDT), AccountBalance(total=9.92500000 ETH, locked=0.00000000 ETH, free=9.92500000 ETH)], margins=[], event_id=ca15f805-c88f-4aaa-ad75-b12abd3190c5)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:07.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7-E3, venue_order_id=BINANCE-1-018, account_id=BINANCE-001, trade_id=BINANCE-1-019, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.91 USDT, commission=0.00105978 USDT, liquidity_side=TAKER, ts_event=1597402807097000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:07.097000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:07.097000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-110002-001-000-7-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=424.03, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00318024 USDT, unrealized_pnl=0.00900000 USDT, ts_opened=1597402802097000000, ts_last=1597402807097000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:09.597000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-110002-001-000-7, event_id=c4c22243-dfa6-4520-84ba-375ce318be33, ts_event=1597402809597000000, ts_init=1597402809597000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:09.597000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-110002-001-000-7, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-110002-001-000-7, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:09.597000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7, account_id=BINANCE-001, ts_event=1597402809597000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:09.597000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-110002-001-000-7\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:09.597000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_042.09620820 USDT, locked=0.00000000 USDT, free=1_000_042.09620820 USDT), AccountBalance(total=9.90000000 ETH, locked=0.00000000 ETH, free=9.90000000 ETH)], margins=[], event_id=10e6740d-3dff-4b14-8eb4-f50cbb732f59)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:09.597000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-110002-001-000-7, venue_order_id=BINANCE-1-019, account_id=BINANCE-001, trade_id=BINANCE-1-020, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.93 USDT, commission=0.00105983 USDT, liquidity_side=TAKER, ts_event=1597402809597000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:09.597000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:09.640000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-110002-001-000-7-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=424.00499999999994, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00424007 USDT, unrealized_pnl=0.00750000 USDT, ts_opened=1597402802097000000, ts_last=1597402809597000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:28.887000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.18,424.35,423.91,424.20,639.44333,1597402828887000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:00:53.918000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.20,424.32,423.38,423.42,733.84994,1597402853918000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:01:28.393000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.41,423.88,423.30,423.58,504.41754,1597402888393000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:01:43.899000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.59,423.65,422.57,422.57,995.08317,1597402903881000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:02:04.481000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.56,423.03,422.46,422.97,759.63339,1597402922434000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:02:30.724000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.97,423.81,422.87,423.68,876.32697,1597402950724000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:03:29.314000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.65,423.80,423.11,423.80,465.49893,1597403009314000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:04:16.415000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.80,424.09,423.57,423.57,850.20974,1597403056415000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:05:44.105000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.57,423.95,423.31,423.63,481.57058,1597403144105000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:07:00.222000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.64,424.04,423.43,423.91,550.49870,1597403220045000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:08:28.654000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.94,424.25,423.87,423.99,400.23511,1597403308654000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:09:19.601000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.99,424.93,423.89,424.90,1210.20085,1597403358944000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:10:51.984000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.91,424.97,424.15,424.15,488.27038,1597403451984000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:12:45.606000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.16,425.40,424.16,425.32,511.85809,1597403565606000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.31,425.57,424.98,425.57,414.51581,1597403642429000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-8, side=BUY, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-111402-001-000-8, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-8, account_id=BINANCE-001, ts_event=1597403642429000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9, side=BUY, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-111402-001-000-9, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-111402-001-000-9, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-111402-001-000-9, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-111402-001-000-9, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-111402-001-000-9, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E1, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-111402-001-000-9, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-111402-001-000-9-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-111402-001-000-9, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E1, account_id=BINANCE-001, ts_event=1597403642429000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-111402-001-000-9: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.53495250 USDT, locked=0.00000000 USDT, free=999_999.53495250 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=00ff63db-16cc-47eb-ba3a-ed6cce2c2fb3)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-8, venue_order_id=BINANCE-1-020, account_id=BINANCE-001, trade_id=BINANCE-1-021, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.10000, last_px=425.57 USDT, commission=0.00425570 USDT, liquidity_side=TAKER, ts_event=1597403642429000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-110002-001-000-7-E1, closing_order_id=O-20200814-111402-001-000-8, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=424.00499999999994, avg_px_close=425.57, realized_return=-0.00369, realized_pnl=-0.16499577 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597402802097000000, ts_last=1597403642429000000, ts_closed=1597403642429000000, duration_ns=840332000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_988.89463857 USDT, locked=0.00000000 USDT, free=999_988.89463857 USDT), AccountBalance(total=10.02500000 ETH, locked=0.00000000 ETH, free=10.02500000 ETH)], margins=[], event_id=45ebe51f-2371-4326-bdee-bba325a06339)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E1, venue_order_id=BINANCE-1-021, account_id=BINANCE-001, trade_id=BINANCE-1-022, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.57 USDT, commission=0.00106393 USDT, liquidity_side=TAKER, ts_event=1597403642429000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:02.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-111402-001-000-9-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=425.57, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106393 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597403642429000000, ts_last=1597403642429000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:04.929000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-111402-001-000-9, event_id=25a575bb-3f83-4b76-b7da-29a540841527, ts_event=1597403644929000000, ts_init=1597403644929000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:04.929000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E2, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-111402-001-000-9, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:04.929000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-111402-001-000-9-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-111402-001-000-9, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:04.929000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E2, account_id=BINANCE-001, ts_event=1597403644929000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:04.929000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_978.25232444 USDT, locked=0.00000000 USDT, free=999_978.25232444 USDT), AccountBalance(total=10.05000000 ETH, locked=0.00000000 ETH, free=10.05000000 ETH)], margins=[], event_id=7686f273-91ee-4176-af31-a363edf38610)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:04.929000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E2, venue_order_id=BINANCE-1-022, account_id=BINANCE-001, trade_id=BINANCE-1-023, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.65 USDT, commission=0.00106413 USDT, liquidity_side=TAKER, ts_event=1597403644929000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:04.929000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:04.929000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-111402-001-000-9-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=425.60999999999996, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00212806 USDT, unrealized_pnl=0.00200000 USDT, ts_opened=1597403642429000000, ts_last=1597403644929000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:07.429000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-111402-001-000-9, event_id=5cdea998-f277-4c8c-a6ef-4a56f8df813c, ts_event=1597403647429000000, ts_init=1597403647429000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:07.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E3, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-111402-001-000-9, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:07.429000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-111402-001-000-9-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-111402-001-000-9, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:07.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E3, account_id=BINANCE-001, ts_event=1597403647429000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:07.429000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_967.60976029 USDT, locked=0.00000000 USDT, free=999_967.60976029 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=63a891ca-63dd-46c7-b63d-db0c50a6d2ab)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:07.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9-E3, venue_order_id=BINANCE-1-023, account_id=BINANCE-001, trade_id=BINANCE-1-024, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.66 USDT, commission=0.00106415 USDT, liquidity_side=TAKER, ts_event=1597403647429000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:07.429000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:07.429000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-111402-001-000-9-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=425.6266666666666, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00319221 USDT, unrealized_pnl=0.00250000 USDT, ts_opened=1597403642429000000, ts_last=1597403647429000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:09.929000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-111402-001-000-9, event_id=aeffa93d-ff34-4cb0-b3c2-8a65454dd6ab, ts_event=1597403649929000000, ts_init=1597403649929000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:09.929000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-111402-001-000-9, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-111402-001-000-9, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:09.929000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9, account_id=BINANCE-001, ts_event=1597403649929000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:09.929000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-111402-001-000-9\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:09.929000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_956.96694611 USDT, locked=0.00000000 USDT, free=999_956.96694611 USDT), AccountBalance(total=10.10000000 ETH, locked=0.00000000 ETH, free=10.10000000 ETH)], margins=[], event_id=40f3b2e5-02ca-48b4-98a7-1fbe2b4ffa99)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:09.929000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-111402-001-000-9, venue_order_id=BINANCE-1-024, account_id=BINANCE-001, trade_id=BINANCE-1-025, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.67 USDT, commission=0.00106418 USDT, liquidity_side=TAKER, ts_event=1597403649929000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:09.929000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:09.929000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-111402-001-000-9-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=425.6375, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00425639 USDT, unrealized_pnl=0.00325000 USDT, ts_opened=1597403642429000000, ts_last=1597403649929000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:14:36.531000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.58,426.27,425.57,426.08,635.44777,1597403676531000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:15:23.572000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.06,426.11,425.56,425.82,813.77933,1597403723572000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:16:11.734000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.83,426.28,425.82,425.88,812.93600,1597403771734000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:16:41.314000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.83,426.64,425.83,426.15,690.23544,1597403801314000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:17:55.416000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.15,426.46,425.93,426.11,582.50988,1597403875416000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:18:52.474000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.11,426.22,425.67,425.69,619.47465,1597403932474000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:20:21.987000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.75,426.31,425.65,426.31,567.87680,1597404021544000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:20:51.992000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.31,426.70,426.20,426.37,571.59440,1597404051992000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:21:38.599000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.40,427.00,426.15,426.89,1330.56780,1597404098355000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:22:20.640000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.88,427.00,426.55,426.70,648.17792,1597404140640000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:23:20.989000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.74,426.90,426.50,426.55,619.58703,1597404200989000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:23:57.857000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.55,426.67,425.86,425.98,542.69949,1597404237857000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:25:46.971000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.03,426.46,426.02,426.28,691.22119,1597404346971000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:27:14.737000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.29,426.63,426.11,426.27,681.78191,1597404434737000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:29:01.440000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.33,426.47,426.10,426.26,859.31050,1597404541440000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:30:06.502000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.25,426.41,425.66,425.66,552.33327,1597404606502000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:30:44.580000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.65,425.67,425.42,425.47,654.91895,1597404644416000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:31:07.829000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.40,425.43,424.80,425.30,612.39437,1597404667805000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:31:54.609000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.30,425.40,425.04,425.22,531.77371,1597404714609000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.21,425.65,425.00,425.34,751.68758,1597404780084000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-10, side=SELL, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-113300-001-000-10, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-10, account_id=BINANCE-001, ts_event=1597404780084000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11, side=SELL, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-113300-001-000-11, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113300-001-000-11, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-113300-001-000-11, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113300-001-000-11, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-113300-001-000-11, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E1, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-113300-001-000-11, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113300-001-000-11-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-113300-001-000-11, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E1, account_id=BINANCE-001, ts_event=1597404780084000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-113300-001-000-11: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.49669271 USDT, locked=0.00000000 USDT, free=999_999.49669271 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=208bd9dd-5818-42cf-8c3b-71b51fa358f6)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-10, venue_order_id=BINANCE-1-025, account_id=BINANCE-001, trade_id=BINANCE-1-026, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.10000, last_px=425.34 USDT, commission=0.00425340 USDT, liquidity_side=TAKER, ts_event=1597404780084000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-111402-001-000-9-E1, closing_order_id=O-20200814-113300-001-000-10, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=425.6375, avg_px_close=425.34, realized_return=-0.00070, realized_pnl=-0.03825979 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597403642429000000, ts_last=1597404780084000000, ts_closed=1597404780084000000, duration_ns=1137655000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_010.12912936 USDT, locked=0.00000000 USDT, free=1_000_010.12912936 USDT), AccountBalance(total=9.97500000 ETH, locked=0.00000000 ETH, free=9.97500000 ETH)], margins=[], event_id=510bc188-3847-4e5e-9495-13118f206034)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E1, venue_order_id=BINANCE-1-026, account_id=BINANCE-001, trade_id=BINANCE-1-027, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=425.34 USDT, commission=0.00106335 USDT, liquidity_side=TAKER, ts_event=1597404780084000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:00.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113300-001-000-11-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=425.34, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106335 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597404780084000000, ts_last=1597404780084000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:02.584000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-113300-001-000-11, event_id=12377ce7-665b-4c3b-a60b-06d180dd2a50, ts_event=1597404782584000000, ts_init=1597404782584000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:02.584000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E2, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-113300-001-000-11, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:02.584000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113300-001-000-11-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-113300-001-000-11, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:02.584000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E2, account_id=BINANCE-001, ts_event=1597404782584000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:02.584000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_020.76156601 USDT, locked=0.00000000 USDT, free=1_000_020.76156601 USDT), AccountBalance(total=9.95000000 ETH, locked=0.00000000 ETH, free=9.95000000 ETH)], margins=[], event_id=20484c01-0aba-43bc-8912-0f541bec4f0d)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:02.584000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E2, venue_order_id=BINANCE-1-027, account_id=BINANCE-001, trade_id=BINANCE-1-028, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=425.34 USDT, commission=0.00106335 USDT, liquidity_side=TAKER, ts_event=1597404782584000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:02.584000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:02.584000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113300-001-000-11-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=425.34, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00212670 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597404780084000000, ts_last=1597404782584000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:05.084000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-113300-001-000-11, event_id=bfaec884-496e-4297-9b79-cf5a4812b1f1, ts_event=1597404785084000000, ts_init=1597404785084000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:05.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E3, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-113300-001-000-11, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:05.084000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113300-001-000-11-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-113300-001-000-11, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:05.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E3, account_id=BINANCE-001, ts_event=1597404785084000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:05.084000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_031.39450261 USDT, locked=0.00000000 USDT, free=1_000_031.39450261 USDT), AccountBalance(total=9.92500000 ETH, locked=0.00000000 ETH, free=9.92500000 ETH)], margins=[], event_id=c02ccc90-c33b-4a64-8d29-00ed11f2f06c)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:05.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11-E3, venue_order_id=BINANCE-1-028, account_id=BINANCE-001, trade_id=BINANCE-1-029, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=425.36 USDT, commission=0.00106340 USDT, liquidity_side=TAKER, ts_event=1597404785084000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:05.084000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:05.084000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113300-001-000-11-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=425.3466666666666, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00319010 USDT, unrealized_pnl=-0.00100000 USDT, ts_opened=1597404780084000000, ts_last=1597404785084000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:07.584000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-113300-001-000-11, event_id=f95ed265-0a68-41d0-a46a-5cc67ba441dd, ts_event=1597404787584000000, ts_init=1597404787584000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:07.584000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113300-001-000-11, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-113300-001-000-11, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:07.584000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11, account_id=BINANCE-001, ts_event=1597404787584000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:07.584000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-113300-001-000-11\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:07.584000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_042.03593836 USDT, locked=0.00000000 USDT, free=1_000_042.03593836 USDT), AccountBalance(total=9.90000000 ETH, locked=0.00000000 ETH, free=9.90000000 ETH)], margins=[], event_id=dc7c6dfd-68e3-44b6-a440-39a05b877b49)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:07.584000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113300-001-000-11, venue_order_id=BINANCE-1-029, account_id=BINANCE-001, trade_id=BINANCE-1-030, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=425.70 USDT, commission=0.00106425 USDT, liquidity_side=TAKER, ts_event=1597404787584000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:07.584000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:33:07.584000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113300-001-000-11-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=425.43499999999995, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00425435 USDT, unrealized_pnl=-0.02650000 USDT, ts_opened=1597404780084000000, ts_last=1597404787584000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:34:23.844000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.31,425.74,425.04,425.21,540.21252,1597404863844000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:35:43.957000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.21,425.72,425.07,425.72,439.41414,1597404943957000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.72,426.25,425.62,426.25,1131.11409,1597405025204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-12, side=BUY, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-113705-001-000-12, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-12, account_id=BINANCE-001, ts_event=1597405025204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13, side=BUY, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-113705-001-000-13, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113705-001-000-13, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-113705-001-000-13, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113705-001-000-13, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-113705-001-000-13, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E1, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-113705-001-000-13, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113705-001-000-13-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-113705-001-000-13, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E1, account_id=BINANCE-001, ts_event=1597405025204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-113705-001-000-13: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.40667586 USDT, locked=0.00000000 USDT, free=999_999.40667586 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=9d0e2a0c-c9a7-4638-b6f3-768976943167)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-12, venue_order_id=BINANCE-1-030, account_id=BINANCE-001, trade_id=BINANCE-1-031, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.10000, last_px=426.25 USDT, commission=0.00426250 USDT, liquidity_side=TAKER, ts_event=1597405025204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113300-001-000-11-E1, closing_order_id=O-20200814-113705-001-000-12, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=425.43499999999995, avg_px_close=426.25, realized_return=-0.00192, realized_pnl=-0.09001685 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597404780084000000, ts_last=1597405025204000000, ts_closed=1597405025204000000, duration_ns=245120000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_988.74936023 USDT, locked=0.00000000 USDT, free=999_988.74936023 USDT), AccountBalance(total=10.02500000 ETH, locked=0.00000000 ETH, free=10.02500000 ETH)], margins=[], event_id=0c56e054-baa1-4415-98f8-fe28fc2c67e7)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E1, venue_order_id=BINANCE-1-031, account_id=BINANCE-001, trade_id=BINANCE-1-032, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=426.25 USDT, commission=0.00106563 USDT, liquidity_side=TAKER, ts_event=1597405025204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:05.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113705-001-000-13-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=426.25, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106563 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597405025204000000, ts_last=1597405025204000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:07.704000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-113705-001-000-13, event_id=a08aff21-7b16-48b6-8667-3f40aebeb9fd, ts_event=1597405027704000000, ts_init=1597405027704000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:07.704000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E2, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-113705-001-000-13, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:07.704000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113705-001-000-13-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-113705-001-000-13, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:07.704000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E2, account_id=BINANCE-001, ts_event=1597405027704000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:07.704000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_978.08979438 USDT, locked=0.00000000 USDT, free=999_978.08979438 USDT), AccountBalance(total=10.05000000 ETH, locked=0.00000000 ETH, free=10.05000000 ETH)], margins=[], event_id=6c05f986-8c5e-4f23-a217-3b061e16bb92)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:07.704000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E2, venue_order_id=BINANCE-1-032, account_id=BINANCE-001, trade_id=BINANCE-1-033, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=426.34 USDT, commission=0.00106585 USDT, liquidity_side=TAKER, ts_event=1597405027704000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:07.704000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:07.704000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113705-001-000-13-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=426.29499999999996, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00213148 USDT, unrealized_pnl=0.00225000 USDT, ts_opened=1597405025204000000, ts_last=1597405027704000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:10.204000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-113705-001-000-13, event_id=87449ad9-b340-48c5-b855-f74064b6317c, ts_event=1597405030204000000, ts_init=1597405030204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:10.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E3, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-113705-001-000-13, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:10.204000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113705-001-000-13-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-113705-001-000-13, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:10.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E3, account_id=BINANCE-001, ts_event=1597405030204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:10.204000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_967.43022853 USDT, locked=0.00000000 USDT, free=999_967.43022853 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=c64ca590-50a6-4019-a425-dec58d67034a)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:10.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13-E3, venue_order_id=BINANCE-1-033, account_id=BINANCE-001, trade_id=BINANCE-1-034, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=426.34 USDT, commission=0.00106585 USDT, liquidity_side=TAKER, ts_event=1597405030204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:10.204000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:10.204000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113705-001-000-13-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=426.30999999999995, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00319733 USDT, unrealized_pnl=0.00225000 USDT, ts_opened=1597405025204000000, ts_last=1597405030204000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:12.704000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-113705-001-000-13, event_id=42c08789-c984-4ad4-b3f5-8b5faf65aa6f, ts_event=1597405032704000000, ts_init=1597405032704000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:12.704000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-113705-001-000-13, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-113705-001-000-13, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:12.704000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13, account_id=BINANCE-001, ts_event=1597405032704000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:12.704000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-113705-001-000-13\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:12.704000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_967.43022853 USDT, locked=0.00000000 USDT, free=999_967.43022853 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=82e54d8d-6486-4f7e-906c-282306f57f24)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:37:12.704000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderCanceled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-113705-001-000-13, venue_order_id=BINANCE-1-034, account_id=BINANCE-001, ts_event=1597405032704000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:38:44.893000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.25,426.68,426.25,426.42,676.33452,1597405124893000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:40:04.550000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.42,426.78,426.42,426.53,867.28350,1597405204550000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:41:13.898000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.51,426.61,426.22,426.31,558.03622,1597405273898000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:42:37.672000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.31,426.53,425.99,426.33,692.04005,1597405357672000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:43:41.906000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.34,426.34,425.93,425.94,326.65818,1597405421906000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:45:52.374000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.94,426.49,425.87,426.47,590.11658,1597405552374000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:47:01.304000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.46,426.94,426.44,426.91,691.54575,1597405621304000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:47:51.519000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.92,427.22,426.72,427.14,996.51372,1597405671519000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:48:32.706000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.14,427.42,427.13,427.42,1029.82913,1597405712706000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:48:58.391000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.44,427.51,426.81,426.89,664.75357,1597405738391000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:49:44.704000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.89,427.50,426.80,427.43,990.47095,1597405784648000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:50:13.044000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.43,427.80,427.32,427.72,1057.29900,1597405813044000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:50:42.702000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.74,428.05,427.53,428.05,1171.17296,1597405842702000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:51:06.538000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,428.06,428.29,427.93,428.25,677.65046,1597405866266000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:51:35.405000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,428.28,428.50,427.91,428.49,828.05216,1597405894963000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:52:00.910000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,428.50,428.68,428.21,428.21,1127.39072,1597405920910000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:52:22.383000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,428.20,428.52,427.90,428.34,1049.20344,1597405942383000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:52:54.554000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,428.35,428.61,428.27,428.37,562.76478,1597405974554000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:53:15.330000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,428.37,428.39,427.78,427.78,372.97579,1597405995032000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:53:36.722000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.77,427.78,427.38,427.62,460.43627,1597406016722000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:54:36.741000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.62,427.93,427.27,427.32,466.20334,1597406076689000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:55:16.980000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.31,427.69,427.06,427.06,496.86871,1597406116910000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:56:14.346000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.06,427.63,426.86,427.14,519.87506,1597406173807000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:57:32.816000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.15,427.56,427.14,427.36,776.85517,1597406252816000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:58:38.769000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.30,428.00,427.11,427.95,1154.66448,1597406318769000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T11:59:46.570000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.95,428.28,427.77,428.16,943.29984,1597406386570000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:00:27.855000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,428.23,428.25,427.26,427.36,1009.81423,1597406427744000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:01:03.954000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.36,427.38,427.02,427.14,408.52201,1597406463954000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:01:43.934000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.13,427.14,426.84,426.98,548.26018,1597406501905000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.98,426.98,426.40,426.43,651.87076,1597406535235000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-14, side=SELL, type=MARKET, quantity=0.07500, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.07500 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-120215-001-000-14, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-14, account_id=BINANCE-001, ts_event=1597406535235000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15, side=SELL, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-120215-001-000-15, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-120215-001-000-15, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-120215-001-000-15, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-120215-001-000-15, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-120215-001-000-15, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E1, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-120215-001-000-15, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-120215-001-000-15-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-120215-001-000-15, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E1, account_id=BINANCE-001, ts_event=1597406535235000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-120215-001-000-15: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.40928030 USDT, locked=0.00000000 USDT, free=999_999.40928030 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=561c4204-3038-4b15-ace9-4e69b6942467)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-14, venue_order_id=BINANCE-1-035, account_id=BINANCE-001, trade_id=BINANCE-1-035, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.07500, last_px=426.43 USDT, commission=0.00319823 USDT, liquidity_side=TAKER, ts_event=1597406535235000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-113705-001-000-13-E1, closing_order_id=O-20200814-120215-001-000-14, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.07500, currency=USDT, avg_px_open=426.30999999999995, avg_px_close=426.43, realized_return=0.00028, realized_pnl=0.00260444 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597405025204000000, ts_last=1597406535235000000, ts_closed=1597406535235000000, duration_ns=1510031000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_010.06896422 USDT, locked=0.00000000 USDT, free=1_000_010.06896422 USDT), AccountBalance(total=9.97500000 ETH, locked=0.00000000 ETH, free=9.97500000 ETH)], margins=[], event_id=daca7388-96f7-40c5-9569-c233e6d17999)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E1, venue_order_id=BINANCE-1-036, account_id=BINANCE-001, trade_id=BINANCE-1-036, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=426.43 USDT, commission=0.00106608 USDT, liquidity_side=TAKER, ts_event=1597406535235000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:15.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-120215-001-000-15-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=426.43, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106608 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597406535235000000, ts_last=1597406535235000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:17.735000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-120215-001-000-15, event_id=2c6aa281-7b9e-4046-92d4-74406e902a1a, ts_event=1597406537735000000, ts_init=1597406537735000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:17.735000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E2, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-120215-001-000-15, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:17.735000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-120215-001-000-15-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-120215-001-000-15, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:17.735000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E2, account_id=BINANCE-001, ts_event=1597406537735000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:17.735000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_020.72614839 USDT, locked=0.00000000 USDT, free=1_000_020.72614839 USDT), AccountBalance(total=9.95000000 ETH, locked=0.00000000 ETH, free=9.95000000 ETH)], margins=[], event_id=ac951503-05df-444b-af7c-23dfa8f92148)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:17.735000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E2, venue_order_id=BINANCE-1-037, account_id=BINANCE-001, trade_id=BINANCE-1-037, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=426.33 USDT, commission=0.00106583 USDT, liquidity_side=TAKER, ts_event=1597406537735000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:17.735000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:17.735000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-120215-001-000-15-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=426.38000000000005, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00213191 USDT, unrealized_pnl=0.00250000 USDT, ts_opened=1597406535235000000, ts_last=1597406537735000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:20.235000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-120215-001-000-15, event_id=caecb14e-697a-4a98-ab67-266295949282, ts_event=1597406540235000000, ts_init=1597406540235000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:20.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E3, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-120215-001-000-15, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:20.235000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-120215-001-000-15-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-120215-001-000-15, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:20.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E3, account_id=BINANCE-001, ts_event=1597406540235000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:20.235000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_031.38308259 USDT, locked=0.00000000 USDT, free=1_000_031.38308259 USDT), AccountBalance(total=9.92500000 ETH, locked=0.00000000 ETH, free=9.92500000 ETH)], margins=[], event_id=71811e9e-b510-49cc-acae-78c2231d2683)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:20.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15-E3, venue_order_id=BINANCE-1-038, account_id=BINANCE-001, trade_id=BINANCE-1-038, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=426.32 USDT, commission=0.00106580 USDT, liquidity_side=TAKER, ts_event=1597406540235000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:20.235000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:20.235000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-120215-001-000-15-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=426.36, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00319771 USDT, unrealized_pnl=0.00300000 USDT, ts_opened=1597406535235000000, ts_last=1597406540235000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:22.735000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-120215-001-000-15, event_id=818ca956-3c68-4ab2-a5f2-657e2f9e49e2, ts_event=1597406542735000000, ts_init=1597406542735000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:22.735000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-120215-001-000-15, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-120215-001-000-15, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:22.735000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15, account_id=BINANCE-001, ts_event=1597406542735000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:22.735000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-120215-001-000-15\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:22.735000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_042.04101669 USDT, locked=0.00000000 USDT, free=1_000_042.04101669 USDT), AccountBalance(total=9.90000000 ETH, locked=0.00000000 ETH, free=9.90000000 ETH)], margins=[], event_id=42e33d84-1388-4f52-bf68-726f32a0279d)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:22.735000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-120215-001-000-15, venue_order_id=BINANCE-1-039, account_id=BINANCE-001, trade_id=BINANCE-1-039, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=426.36 USDT, commission=0.00106590 USDT, liquidity_side=TAKER, ts_event=1597406542735000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:22.735000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:22.735000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-120215-001-000-15-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=426.36, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00426361 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597406535235000000, ts_last=1597406542735000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:02:39.726000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.40,426.98,426.16,426.83,687.57404,1597406559726000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:03:36.912000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.84,427.07,426.48,426.59,820.61375,1597406616912000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:05:10.214000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.59,426.76,426.38,426.61,507.04574,1597406710214000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:06:15.058000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.59,427.21,426.59,426.61,476.50635,1597406774225000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:07:19.247000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.62,426.63,426.15,426.15,500.95278,1597406839247000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:08:08.759000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.14,426.57,425.88,426.23,719.60627,1597406888759000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:09:24.627000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.22,426.50,425.97,426.40,434.76182,1597406964627000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:11:12.195000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.37,426.47,426.15,426.25,536.19833,1597407072195000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:12:25.906000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.26,426.76,425.98,426.33,605.91782,1597407145906000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:13:48.977000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.32,427.06,426.31,427.06,954.74975,1597407228977000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:13:59.357000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.07,427.60,426.69,426.87,1413.09738,1597407239357000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:15:11.952000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.86,427.06,426.50,426.94,568.00486,1597407311952000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:16:15.391000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.91,427.20,426.54,426.90,648.44737,1597407374970000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:17:56.897000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.87,427.05,426.69,426.83,407.32735,1597407476897000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:19:17.316000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.82,426.93,426.37,426.52,796.29914,1597407557316000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:20:29.098000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.51,426.53,426.10,426.10,471.47252,1597407629098000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:21:53.099000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.14,426.38,426.05,426.11,476.94894,1597407713099000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:22:39.889000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.14,426.45,425.97,426.45,885.64119,1597407759889000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:23:28.553000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.49,426.80,426.44,426.77,490.44525,1597407808553000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:25:03.451000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.76,426.80,426.50,426.59,472.96725,1597407903451000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:26:20.541000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.59,426.59,425.96,425.99,661.51403,1597407980359000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:27:06.148000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.03,426.11,425.51,425.62,507.79352,1597408026148000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:27:59.802000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.62,425.75,425.38,425.43,641.44528,1597408079792000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:28:41.816000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.41,425.77,425.35,425.45,550.24409,1597408121564000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:29:47.226000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.48,425.78,425.17,425.68,1095.67150,1597408187226000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:30:58.444000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.68,425.82,425.31,425.66,470.23355,1597408258444000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:33:09.555000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.66,426.14,425.54,426.13,574.88306,1597408389555000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:35:03.222000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.14,426.25,425.73,426.25,374.75193,1597408503222000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:36:26.291000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.28,426.76,426.19,426.72,596.88529,1597408585190000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:38:03.971000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.72,427.01,426.65,426.97,826.22388,1597408683971000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.97,427.37,426.87,427.33,462.07397,1597408771933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-16, side=BUY, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-123931-001-000-16, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-16, account_id=BINANCE-001, ts_event=1597408771933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17, side=BUY, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-123931-001-000-17, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-123931-001-000-17, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-123931-001-000-17, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-123931-001-000-17, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-123931-001-000-17, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E1, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-123931-001-000-17, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-123931-001-000-17-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-123931-001-000-17, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E1, account_id=BINANCE-001, ts_event=1597408771933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-123931-001-000-17: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.30374339 USDT, locked=0.00000000 USDT, free=999_999.30374339 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=0b262b0c-2680-4707-9475-62f9ed9e01d6)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-16, venue_order_id=BINANCE-1-040, account_id=BINANCE-001, trade_id=BINANCE-1-040, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.10000, last_px=427.33 USDT, commission=0.00427330 USDT, liquidity_side=TAKER, ts_event=1597408771933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-120215-001-000-15-E1, closing_order_id=O-20200814-123931-001-000-16, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=426.36, avg_px_close=427.33, realized_return=-0.00228, realized_pnl=-0.10553691 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597406535235000000, ts_last=1597408771933000000, ts_closed=1597408771933000000, duration_ns=2236698000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_988.61942506 USDT, locked=0.00000000 USDT, free=999_988.61942506 USDT), AccountBalance(total=10.02500000 ETH, locked=0.00000000 ETH, free=10.02500000 ETH)], margins=[], event_id=a6f8c67f-40e5-4d4a-a8ab-8f8e7984c5d8)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E1, venue_order_id=BINANCE-1-041, account_id=BINANCE-001, trade_id=BINANCE-1-041, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=427.33 USDT, commission=0.00106833 USDT, liquidity_side=TAKER, ts_event=1597408771933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:31.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-123931-001-000-17-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=427.33, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106833 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597408771933000000, ts_last=1597408771933000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:34.433000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-123931-001-000-17, event_id=846b372e-46d7-481d-b75a-4bd8b48094b4, ts_event=1597408774433000000, ts_init=1597408774433000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:34.433000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E2, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-123931-001-000-17, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:34.433000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-123931-001-000-17-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-123931-001-000-17, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:34.433000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E2, account_id=BINANCE-001, ts_event=1597408774433000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:34.433000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_977.93535676 USDT, locked=0.00000000 USDT, free=999_977.93535676 USDT), AccountBalance(total=10.05000000 ETH, locked=0.00000000 ETH, free=10.05000000 ETH)], margins=[], event_id=66e246d6-b8ef-424f-9cd9-aa5508eaf955)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:34.433000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E2, venue_order_id=BINANCE-1-042, account_id=BINANCE-001, trade_id=BINANCE-1-042, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=427.32 USDT, commission=0.00106830 USDT, liquidity_side=TAKER, ts_event=1597408774433000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:34.433000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:34.433000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-123931-001-000-17-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=427.325, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00213663 USDT, unrealized_pnl=-0.00025000 USDT, ts_opened=1597408771933000000, ts_last=1597408774433000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:36.933000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-123931-001-000-17, event_id=51ed40e1-1820-4f79-b986-d34275ac7219, ts_event=1597408776933000000, ts_init=1597408776933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:36.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E3, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-123931-001-000-17, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:36.933000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-123931-001-000-17-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-123931-001-000-17, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:36.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E3, account_id=BINANCE-001, ts_event=1597408776933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:36.933000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_967.25128846 USDT, locked=0.00000000 USDT, free=999_967.25128846 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=44759167-0d25-4e88-b80a-67aa8a2dfe14)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:36.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17-E3, venue_order_id=BINANCE-1-043, account_id=BINANCE-001, trade_id=BINANCE-1-043, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=427.32 USDT, commission=0.00106830 USDT, liquidity_side=TAKER, ts_event=1597408776933000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:36.933000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:36.933000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-123931-001-000-17-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=427.32333333333327, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00320493 USDT, unrealized_pnl=-0.00025000 USDT, ts_opened=1597408771933000000, ts_last=1597408776933000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:39.433000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-123931-001-000-17, event_id=cc6ee27e-6408-4037-85f1-0e2506c8481e, ts_event=1597408779433000000, ts_init=1597408779433000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:39.433000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-123931-001-000-17, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-123931-001-000-17, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:39.433000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17, account_id=BINANCE-001, ts_event=1597408779433000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:39.433000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-123931-001-000-17\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:39.433000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_956.56722016 USDT, locked=0.00000000 USDT, free=999_956.56722016 USDT), AccountBalance(total=10.10000000 ETH, locked=0.00000000 ETH, free=10.10000000 ETH)], margins=[], event_id=da2c1b72-def0-4e14-b2e0-05907192160e)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:39.433000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-123931-001-000-17, venue_order_id=BINANCE-1-044, account_id=BINANCE-001, trade_id=BINANCE-1-044, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=427.32 USDT, commission=0.00106830 USDT, liquidity_side=TAKER, ts_event=1597408779433000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:39.433000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:39:39.433000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-123931-001-000-17-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=427.32249999999993, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00427323 USDT, unrealized_pnl=-0.00025000 USDT, ts_opened=1597408771933000000, ts_last=1597408779433000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:40:46.130000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.33,427.44,427.09,427.12,498.08985,1597408846130000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:41:52.800000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.11,427.41,426.91,427.01,573.98924,1597408912800000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:43:03.747000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.01,427.66,427.00,427.63,763.93119,1597408983747000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:44:12.193000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.63,427.83,427.31,427.74,637.90598,1597409052193000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:45:06.832000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.77,427.85,427.55,427.65,661.52238,1597409106832000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:46:14.628000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.66,427.74,427.18,427.41,447.51973,1597409174628000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:47:08.484000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.41,427.41,426.62,426.87,1382.81035,1597409228484000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:48:16.002000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.85,427.20,426.63,427.10,809.70536,1597409296002000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:49:33.068000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,427.10,427.19,426.72,426.72,811.01470,1597409373068000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:50:25.218000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.73,426.77,426.30,426.36,751.41070,1597409424289000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:51:53.183000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.36,426.69,426.04,426.69,802.15492,1597409513183000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.68,426.75,426.10,426.26,520.93818,1597409626057000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-18, side=SELL, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-125346-001-000-18, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-18, account_id=BINANCE-001, ts_event=1597409626057000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19, side=SELL, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-125346-001-000-19, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-125346-001-000-19, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-125346-001-000-19, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-125346-001-000-19, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-125346-001-000-19, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E1, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-125346-001-000-19, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-125346-001-000-19-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-125346-001-000-19, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E1, account_id=BINANCE-001, ts_event=1597409626057000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-125346-001-000-19: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.18895756 USDT, locked=0.00000000 USDT, free=999_999.18895756 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=679c4dbd-27b5-4e6d-b8c0-4e1a5d88ef06)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-18, venue_order_id=BINANCE-1-045, account_id=BINANCE-001, trade_id=BINANCE-1-045, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.10000, last_px=426.26 USDT, commission=0.00426260 USDT, liquidity_side=TAKER, ts_event=1597409626057000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-123931-001-000-17-E1, closing_order_id=O-20200814-125346-001-000-18, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=427.32249999999993, avg_px_close=426.26, realized_return=-0.00249, realized_pnl=-0.11478583 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597408771933000000, ts_last=1597409626057000000, ts_closed=1597409626057000000, duration_ns=854124000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_009.84439191 USDT, locked=0.00000000 USDT, free=1_000_009.84439191 USDT), AccountBalance(total=9.97500000 ETH, locked=0.00000000 ETH, free=9.97500000 ETH)], margins=[], event_id=db68f92c-3ea9-486f-b495-ce655d041dd7)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E1, venue_order_id=BINANCE-1-046, account_id=BINANCE-001, trade_id=BINANCE-1-046, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=426.26 USDT, commission=0.00106565 USDT, liquidity_side=TAKER, ts_event=1597409626057000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:46.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-125346-001-000-19-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=426.26, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106565 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597409626057000000, ts_last=1597409626057000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:48.557000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-125346-001-000-19, event_id=f69da793-3d44-415e-9152-7603eb0bb8f0, ts_event=1597409628557000000, ts_init=1597409628557000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:48.557000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E2, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-125346-001-000-19, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:48.557000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-125346-001-000-19-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-125346-001-000-19, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:48.557000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E2, account_id=BINANCE-001, ts_event=1597409628557000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:48.557000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_020.49982626 USDT, locked=0.00000000 USDT, free=1_000_020.49982626 USDT), AccountBalance(total=9.95000000 ETH, locked=0.00000000 ETH, free=9.95000000 ETH)], margins=[], event_id=32270fdf-b602-4518-86a0-d271261bea19)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:48.557000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E2, venue_order_id=BINANCE-1-047, account_id=BINANCE-001, trade_id=BINANCE-1-047, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=426.26 USDT, commission=0.00106565 USDT, liquidity_side=TAKER, ts_event=1597409628557000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:48.557000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:48.557000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-125346-001-000-19-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=426.26000000000005, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00213130 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597409626057000000, ts_last=1597409628557000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:51.057000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-125346-001-000-19, event_id=bb578b2e-9581-4e90-9793-b4e498e212ea, ts_event=1597409631057000000, ts_init=1597409631057000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:51.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E3, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-125346-001-000-19, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:51.057000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-125346-001-000-19-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-125346-001-000-19, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:51.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E3, account_id=BINANCE-001, ts_event=1597409631057000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:51.057000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_031.15501063 USDT, locked=0.00000000 USDT, free=1_000_031.15501063 USDT), AccountBalance(total=9.92500000 ETH, locked=0.00000000 ETH, free=9.92500000 ETH)], margins=[], event_id=ab6690b4-acd6-4b02-9cdd-b9448da28794)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:51.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19-E3, venue_order_id=BINANCE-1-048, account_id=BINANCE-001, trade_id=BINANCE-1-048, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=426.25 USDT, commission=0.00106563 USDT, liquidity_side=TAKER, ts_event=1597409631057000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:51.057000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:51.057000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-125346-001-000-19-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=426.25666666666666, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00319693 USDT, unrealized_pnl=0.00050000 USDT, ts_opened=1597409626057000000, ts_last=1597409631057000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:53.557000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-125346-001-000-19, event_id=cafe5479-ab4f-474e-b773-eff662c7a672, ts_event=1597409633557000000, ts_init=1597409633557000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:53.557000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-125346-001-000-19, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-125346-001-000-19, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:53.557000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19, account_id=BINANCE-001, ts_event=1597409633557000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:53.557000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-125346-001-000-19\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:53.557000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_041.81044498 USDT, locked=0.00000000 USDT, free=1_000_041.81044498 USDT), AccountBalance(total=9.90000000 ETH, locked=0.00000000 ETH, free=9.90000000 ETH)], margins=[], event_id=9e4ecf98-5650-4c8e-ac2e-53e4d2280a72)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:53.557000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-125346-001-000-19, venue_order_id=BINANCE-1-049, account_id=BINANCE-001, trade_id=BINANCE-1-049, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=426.26 USDT, commission=0.00106565 USDT, liquidity_side=TAKER, ts_event=1597409633557000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:53.557000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:53:53.557000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-125346-001-000-19-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=426.25749999999994, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00426258 USDT, unrealized_pnl=-0.00025000 USDT, ts_opened=1597409626057000000, ts_last=1597409633557000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:55:36.331000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.27,426.63,426.00,426.02,560.19844,1597409736331000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:57:56.170000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.02,426.48,426.01,426.19,674.09649,1597409876170000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T12:59:55.018000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.20,426.57,426.20,426.31,511.72039,1597409995018000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:00:54.585000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.29,426.32,425.53,425.53,525.58961,1597410054585000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:01:48.303000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.53,425.55,424.76,424.79,983.49812,1597410108303000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:02:33.335000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.79,425.00,424.61,424.74,814.00718,1597410153335000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:03:31.111000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.76,424.81,424.50,424.50,693.20156,1597410211111000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:03:52.804000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.50,424.51,423.70,423.71,933.99934,1597410232804000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:04:13.728000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.70,423.88,423.23,423.85,876.89692,1597410253728000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:04:51.938000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.86,424.42,423.84,424.42,555.54818,1597410291938000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:05:26.942000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.43,424.50,423.50,423.63,545.91669,1597410326942000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:06:15.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.62,424.26,423.55,424.17,683.05244,1597410375874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:07:00.388000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.17,424.88,423.88,424.26,1452.97788,1597410420259000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:07:44.725000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.25,424.84,424.05,424.08,859.23398,1597410464710000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:07:56.798000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.08,424.15,422.76,422.80,701.29153,1597410476798000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:08:16.612000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.80,423.55,422.57,423.34,720.52785,1597410496612000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:09:05.847000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.38,424.01,423.36,423.58,481.63082,1597410545847000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:10:10.344000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.56,424.34,423.45,423.91,542.50919,1597410610344000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:11:11.902000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.91,424.20,423.65,424.03,606.01041,1597410671902000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:11:59.466000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.00,424.74,424.00,424.68,750.06106,1597410719466000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:12:36.115000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.68,425.20,424.64,424.85,615.97717,1597410756115000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:14:13.147000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.83,424.99,424.66,424.75,338.47997,1597410851683000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:15:31.703000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.75,424.79,424.49,424.49,793.76838,1597410931703000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:16:18.204000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.49,424.97,424.46,424.92,655.31443,1597410978204000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:17:43.901000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.94,425.34,424.92,425.06,833.26378,1597411063901000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.08,425.80,425.00,425.74,993.72753,1597411113274000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-20, side=BUY, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-131833-001-000-20, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-20, account_id=BINANCE-001, ts_event=1597411113274000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21, side=BUY, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-131833-001-000-21, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-131833-001-000-21, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-131833-001-000-21, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-131833-001-000-21, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-131833-001-000-21, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E1, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-131833-001-000-21, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-131833-001-000-21-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-131833-001-000-21, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E1, account_id=BINANCE-001, ts_event=1597411113274000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-131833-001-000-21: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.23218758 USDT, locked=0.00000000 USDT, free=999_999.23218758 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=139f7688-abee-462b-a4d0-5e2430ccf9eb)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-20, venue_order_id=BINANCE-1-050, account_id=BINANCE-001, trade_id=BINANCE-1-050, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.10000, last_px=425.74 USDT, commission=0.00425740 USDT, liquidity_side=TAKER, ts_event=1597411113274000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-125346-001-000-19-E1, closing_order_id=O-20200814-131833-001-000-20, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=426.25749999999994, avg_px_close=425.74, realized_return=0.00121, realized_pnl=0.04323002 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597409626057000000, ts_last=1597411113274000000, ts_closed=1597411113274000000, duration_ns=1487217000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_988.58762323 USDT, locked=0.00000000 USDT, free=999_988.58762323 USDT), AccountBalance(total=10.02500000 ETH, locked=0.00000000 ETH, free=10.02500000 ETH)], margins=[], event_id=4bfbb75a-395d-4783-8109-97a8ee49b719)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E1, venue_order_id=BINANCE-1-051, account_id=BINANCE-001, trade_id=BINANCE-1-051, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.74 USDT, commission=0.00106435 USDT, liquidity_side=TAKER, ts_event=1597411113274000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:33.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-131833-001-000-21-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=425.74, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106435 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597411113274000000, ts_last=1597411113274000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:35.774000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-131833-001-000-21, event_id=aeeca867-97ba-4d0d-804f-bc1aa6c8e3af, ts_event=1597411115774000000, ts_init=1597411115774000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:35.774000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E2, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-131833-001-000-21, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:35.774000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-131833-001-000-21-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-131833-001-000-21, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:35.774000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E2, account_id=BINANCE-001, ts_event=1597411115774000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:35.774000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_977.94355893 USDT, locked=0.00000000 USDT, free=999_977.94355893 USDT), AccountBalance(total=10.05000000 ETH, locked=0.00000000 ETH, free=10.05000000 ETH)], margins=[], event_id=dea2827e-f88a-4773-8c9c-6e968a1943a6)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:35.774000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E2, venue_order_id=BINANCE-1-052, account_id=BINANCE-001, trade_id=BINANCE-1-052, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.72 USDT, commission=0.00106430 USDT, liquidity_side=TAKER, ts_event=1597411115774000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:35.774000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:35.774000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-131833-001-000-21-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=425.7300000000001, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00212865 USDT, unrealized_pnl=-0.00050000 USDT, ts_opened=1597411113274000000, ts_last=1597411115774000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:38.274000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-131833-001-000-21, event_id=7b26d232-746f-41fd-8413-136acc47b4c7, ts_event=1597411118274000000, ts_init=1597411118274000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:38.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E3, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-131833-001-000-21, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:38.274000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-131833-001-000-21-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-131833-001-000-21, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:38.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E3, account_id=BINANCE-001, ts_event=1597411118274000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:38.274000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_967.29849453 USDT, locked=0.00000000 USDT, free=999_967.29849453 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=a6d3c786-f942-4c0e-9402-4c3c1b5e68a9)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:38.274000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21-E3, venue_order_id=BINANCE-1-053, account_id=BINANCE-001, trade_id=BINANCE-1-053, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.76 USDT, commission=0.00106440 USDT, liquidity_side=TAKER, ts_event=1597411118274000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:38.274000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-131833-001-000-21-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=425.73999999999995, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00319305 USDT, unrealized_pnl=0.00150000 USDT, ts_opened=1597411113274000000, ts_last=1597411118274000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-131833-001-000-21, event_id=910e1b41-471f-4ba2-9500-a986a4ccc5a6, ts_event=1597411120774000000, ts_init=1597411120774000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-131833-001-000-21, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-131833-001-000-21, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21, account_id=BINANCE-001, ts_event=1597411120774000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-131833-001-000-21\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_956.65393018 USDT, locked=0.00000000 USDT, free=999_956.65393018 USDT), AccountBalance(total=10.10000000 ETH, locked=0.00000000 ETH, free=10.10000000 ETH)], margins=[], event_id=1d796f86-688f-4fb2-8247-fddf04455b42)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-131833-001-000-21, venue_order_id=BINANCE-1-054, account_id=BINANCE-001, trade_id=BINANCE-1-054, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.74 USDT, commission=0.00106435 USDT, liquidity_side=TAKER, ts_event=1597411120774000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:18:40.774000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-131833-001-000-21-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=425.73999999999995, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00425740 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597411113274000000, ts_last=1597411120774000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:20:21.309000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.70,425.86,425.64,425.85,770.16085,1597411221309000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:21:30.605000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.85,425.85,425.21,425.82,705.87097,1597411290605000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:23:39.239000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.82,425.82,425.24,425.32,394.07659,1597411419239000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:25:04.622000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.32,425.50,424.88,425.03,494.19256,1597411504622000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:26:13.554000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.04,425.24,424.80,424.87,673.94813,1597411573554000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:28:00.462000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.87,425.47,424.82,425.47,705.28786,1597411680462000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:29:20.272000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.47,425.47,424.68,424.80,657.06870,1597411760272000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:01.207000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.78,424.99,423.94,424.20,504.56459,1597411801207000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.21,424.39,423.57,423.64,482.22153,1597411851460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-22, side=SELL, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-133051-001-000-22, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-22, account_id=BINANCE-001, ts_event=1597411851460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23, side=SELL, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-133051-001-000-23, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-133051-001-000-23, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-133051-001-000-23, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-133051-001-000-23, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-133051-001-000-23, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E1, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-133051-001-000-23, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-133051-001-000-23-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-133051-001-000-23, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E1, account_id=BINANCE-001, ts_event=1597411851460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-133051-001-000-23: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_977.50764180 USDT, locked=0.00000000 USDT, free=999_977.50764180 USDT), AccountBalance(total=10.05077000 ETH, locked=0.00000000 ETH, free=10.05077000 ETH)], margins=[], event_id=df69c205-288f-4514-a164-7d377e91d72c)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-22, venue_order_id=BINANCE-1-055, account_id=BINANCE-001, trade_id=BINANCE-1-055, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.04923, last_px=423.64 USDT, commission=0.00208558 USDT, liquidity_side=TAKER, ts_event=1597411851460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05077\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-131833-001-000-21-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05077, quantity=0.05077, peak_qty=0.10000, currency=USDT, avg_px_open=425.73999999999995, avg_px_close=423.64, realized_return=-0.00493, realized_pnl=-0.10972598 USDT, unrealized_pnl=-0.10661700 USDT, ts_opened=1597411113274000000, ts_last=1597411851460000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_999.01318613 USDT, locked=0.00000000 USDT, free=999_999.01318613 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=17a19d58-6ce7-4e9c-961c-02328c81fc8f)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-22, venue_order_id=BINANCE-1-055, account_id=BINANCE-001, trade_id=BINANCE-1-056, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.05077, last_px=423.63 USDT, commission=0.00215077 USDT, liquidity_side=TAKER, ts_event=1597411851460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-131833-001-000-21-E1, closing_order_id=O-20200814-133051-001-000-22, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=425.73999999999995, avg_px_close=423.634923, realized_return=-0.00494, realized_pnl=-0.21900145 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597411113274000000, ts_last=1597411851460000000, ts_closed=1597411851460000000, duration_ns=738186000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_009.60312703 USDT, locked=0.00000000 USDT, free=1_000_009.60312703 USDT), AccountBalance(total=9.97500000 ETH, locked=0.00000000 ETH, free=9.97500000 ETH)], margins=[], event_id=ab687325-4a70-48a2-8c47-164fed581d9f)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E1, venue_order_id=BINANCE-1-056, account_id=BINANCE-001, trade_id=BINANCE-1-057, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.64 USDT, commission=0.00105910 USDT, liquidity_side=TAKER, ts_event=1597411851460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:51.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-133051-001-000-23-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=423.64, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00105910 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597411851460000000, ts_last=1597411851460000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:53.960000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-133051-001-000-23, event_id=62df4c11-1065-45ab-8095-9f24fc6ebc9d, ts_event=1597411853960000000, ts_init=1597411853960000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:53.960000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E2, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-133051-001-000-23, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:53.960000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-133051-001-000-23-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-133051-001-000-23, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:53.960000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E2, account_id=BINANCE-001, ts_event=1597411853960000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:53.960000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_020.19656758 USDT, locked=0.00000000 USDT, free=1_000_020.19656758 USDT), AccountBalance(total=9.95000000 ETH, locked=0.00000000 ETH, free=9.95000000 ETH)], margins=[], event_id=0850edb2-25f3-415e-a075-95931472cdcf)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:53.960000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E2, venue_order_id=BINANCE-1-057, account_id=BINANCE-001, trade_id=BINANCE-1-058, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.78 USDT, commission=0.00105945 USDT, liquidity_side=TAKER, ts_event=1597411853960000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:53.960000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:53.960000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-133051-001-000-23-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=423.71, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00211855 USDT, unrealized_pnl=-0.00350000 USDT, ts_opened=1597411851460000000, ts_last=1597411853960000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:56.460000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-133051-001-000-23, event_id=84409e8d-4717-4f97-a1be-d50461d994fe, ts_event=1597411856460000000, ts_init=1597411856460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:56.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E3, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-133051-001-000-23, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:56.460000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-133051-001-000-23-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-133051-001-000-23, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:56.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E3, account_id=BINANCE-001, ts_event=1597411856460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:56.460000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_030.79025810 USDT, locked=0.00000000 USDT, free=1_000_030.79025810 USDT), AccountBalance(total=9.92500000 ETH, locked=0.00000000 ETH, free=9.92500000 ETH)], margins=[], event_id=cb09fd71-336a-4df4-a3f9-f0151702cf8f)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:56.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23-E3, venue_order_id=BINANCE-1-058, account_id=BINANCE-001, trade_id=BINANCE-1-059, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.79 USDT, commission=0.00105948 USDT, liquidity_side=TAKER, ts_event=1597411856460000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:56.460000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:56.460000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-133051-001-000-23-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=423.7366666666666, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00317803 USDT, unrealized_pnl=-0.00400000 USDT, ts_opened=1597411851460000000, ts_last=1597411856460000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:58.960000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-133051-001-000-23, event_id=e2757d58-22d0-4d39-94da-e78cd8c8a872, ts_event=1597411858960000000, ts_init=1597411858960000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:58.960000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-133051-001-000-23, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-133051-001-000-23, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:58.960000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23, account_id=BINANCE-001, ts_event=1597411858960000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:58.960000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-133051-001-000-23\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:58.960000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_041.38369865 USDT, locked=0.00000000 USDT, free=1_000_041.38369865 USDT), AccountBalance(total=9.90000000 ETH, locked=0.00000000 ETH, free=9.90000000 ETH)], margins=[], event_id=618eacba-da6a-462a-8478-50c7ee818129)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:58.960000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-133051-001-000-23, venue_order_id=BINANCE-1-059, account_id=BINANCE-001, trade_id=BINANCE-1-060, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.78 USDT, commission=0.00105945 USDT, liquidity_side=TAKER, ts_event=1597411858960000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:58.960000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:30:58.960000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-133051-001-000-23-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=423.7474999999999, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00423748 USDT, unrealized_pnl=-0.00325000 USDT, ts_opened=1597411851460000000, ts_last=1597411858960000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:31:43.518000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.64,423.92,423.51,423.53,592.05736,1597411903518000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:32:26.856000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.52,423.79,423.26,423.58,726.87584,1597411946747000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:33:02.219000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.58,423.58,423.00,423.22,859.39000,1597411982219000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:33:49.189000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.23,423.95,423.23,423.92,585.46722,1597412029189000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:35:04.878000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.92,424.34,423.75,424.05,805.00949,1597412104878000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:36:27.654000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.05,424.14,423.59,423.98,974.13089,1597412187654000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:37:27.716000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.97,424.60,423.74,424.52,1173.62018,1597412247716000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:39:01.928000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.54,424.55,424.03,424.08,722.48281,1597412341928000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:40:34.839000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.10,424.17,423.83,424.16,791.11386,1597412434839000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:41:36.294000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.16,424.25,423.89,424.09,674.33712,1597412496294000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:43:03.297000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.14,424.40,423.99,424.09,757.52452,1597412583297000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:45:00.889000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.09,424.37,424.00,424.13,452.91925,1597412700889000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:45:45.941000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.13,424.13,423.46,423.82,768.82876,1597412745522000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:46:48.599000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.84,424.17,423.52,424.03,632.71580,1597412808556000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:48:04.832000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.98,424.28,423.83,424.00,339.76366,1597412884832000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:48:53.877000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.00,425.00,423.99,424.99,787.30848,1597412933877000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.96,425.50,424.94,425.38,887.62385,1597412976198000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-24, side=BUY, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-134936-001-000-24, venue_order_id=None, position_id=None, tags=None)"
+ ]
+ }
+ ],
+ "source": [
+ "# Run the engine (from start to end of data)\n",
+ "engine.run()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Post-run and analysis\n",
+ "\n",
+ "Once the backtest is completed, a post-run tearsheet will be automatically logged using some\n",
+ "default statistics (or custom statistics which can be loaded, see the advanced [Portfolio statistics](../concepts/advanced/portfolio_statistics.md) guide).\n",
+ "\n",
+ "Also, many resultant data and execution objects will be held in memory, which we\n",
+ "can use to further analyze the performance by generating various reports."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ ", position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-24, account_id=BINANCE-001, ts_event=1597412976198000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25, side=BUY, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-134936-001-000-25, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-134936-001-000-25, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-134936-001-000-25, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-134936-001-000-25, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-134936-001-000-25, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E1, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-134936-001-000-25, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-134936-001-000-25-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-134936-001-000-25, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E1, account_id=BINANCE-001, ts_event=1597412976198000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-134936-001-000-25: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_998.84144485 USDT, locked=0.00000000 USDT, free=999_998.84144485 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=73a780b6-4282-475a-a305-a0b7b25aca69)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-24, venue_order_id=BINANCE-1-060, account_id=BINANCE-001, trade_id=BINANCE-1-061, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.10000, last_px=425.38 USDT, commission=0.00425380 USDT, liquidity_side=TAKER, ts_event=1597412976198000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-133051-001-000-23-E1, closing_order_id=O-20200814-134936-001-000-24, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=423.7474999999999, avg_px_close=425.38, realized_return=-0.00385, realized_pnl=-0.17174128 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597411851460000000, ts_last=1597412976198000000, ts_closed=1597412976198000000, duration_ns=1124738000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_988.20588140 USDT, locked=0.00000000 USDT, free=999_988.20588140 USDT), AccountBalance(total=10.02500000 ETH, locked=0.00000000 ETH, free=10.02500000 ETH)], margins=[], event_id=705c21cc-3061-4061-911a-b3a67bcb18f1)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E1, venue_order_id=BINANCE-1-061, account_id=BINANCE-001, trade_id=BINANCE-1-062, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.38 USDT, commission=0.00106345 USDT, liquidity_side=TAKER, ts_event=1597412976198000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:36.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-134936-001-000-25-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=425.38, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106345 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597412976198000000, ts_last=1597412976198000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:38.698000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-134936-001-000-25, event_id=f0aff557-fdb0-4a13-8a5c-e85ddc7211f7, ts_event=1597412978698000000, ts_init=1597412978698000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:38.698000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E2, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-134936-001-000-25, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:38.698000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-134936-001-000-25-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-134936-001-000-25, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:38.698000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E2, account_id=BINANCE-001, ts_event=1597412978698000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:38.698000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_977.56981790 USDT, locked=0.00000000 USDT, free=999_977.56981790 USDT), AccountBalance(total=10.05000000 ETH, locked=0.00000000 ETH, free=10.05000000 ETH)], margins=[], event_id=86630ab8-a8ec-4973-8fc9-f5e13284a6ed)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:38.698000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E2, venue_order_id=BINANCE-1-062, account_id=BINANCE-001, trade_id=BINANCE-1-063, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.40 USDT, commission=0.00106350 USDT, liquidity_side=TAKER, ts_event=1597412978698000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:38.698000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:38.698000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-134936-001-000-25-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=425.39, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00212695 USDT, unrealized_pnl=0.00050000 USDT, ts_opened=1597412976198000000, ts_last=1597412978698000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:41.198000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-134936-001-000-25, event_id=b0fa71e4-61d0-45b5-94b2-89866a372fdd, ts_event=1597412981198000000, ts_init=1597412981198000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:41.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E3, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-134936-001-000-25, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:41.198000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-134936-001-000-25-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-134936-001-000-25, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:41.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E3, account_id=BINANCE-001, ts_event=1597412981198000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:41.198000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_966.93400442 USDT, locked=0.00000000 USDT, free=999_966.93400442 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=1c47ef0b-7936-4e42-8a06-b8e8af278f9f)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:49:41.198000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25-E3, venue_order_id=BINANCE-1-063, account_id=BINANCE-001, trade_id=BINANCE-1-064, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.39 USDT, commission=0.00106348 USDT, liquidity_side=TAKER, ts_event=1597412981198000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-134936-001-000-25-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=425.38999999999993, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00319043 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597412976198000000, ts_last=1597412981198000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-134936-001-000-25, event_id=99ff5141-9ee9-412d-b1bb-6df7b298d9b9, ts_event=1597412983698000000, ts_init=1597412983698000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-134936-001-000-25, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-134936-001-000-25, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25, account_id=BINANCE-001, ts_event=1597412983698000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-134936-001-000-25\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_956.29694082 USDT, locked=0.00000000 USDT, free=999_956.29694082 USDT), AccountBalance(total=10.10000000 ETH, locked=0.00000000 ETH, free=10.10000000 ETH)], margins=[], event_id=19018db4-86d5-4ec9-8832-da8746bf0e50)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-134936-001-000-25, venue_order_id=BINANCE-1-064, account_id=BINANCE-001, trade_id=BINANCE-1-065, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=425.44 USDT, commission=0.00106360 USDT, liquidity_side=TAKER, ts_event=1597412983698000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.10000\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-134936-001-000-25-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=425.4024999999999, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00425403 USDT, unrealized_pnl=0.00375000 USDT, ts_opened=1597412976198000000, ts_last=1597412983698000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:50:23.088000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.39,425.75,425.28,425.75,821.61958,1597413023088000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T13:51:24.870000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.75,425.97,425.56,425.61,705.91396,1597413084870000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.60,425.64,425.30,425.41,873.34893,1597413196275000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.41,425.80,425.41,425.80,860.68112,1597413266519000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.85,426.10,425.59,425.91,1012.65747,1597413311228000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.86,425.88,425.60,425.61,477.63898,1597413420897000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.61,425.82,425.52,425.80,527.91281,1597413515295000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.79,425.86,425.28,425.33,575.32404,1597413604155000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.31,425.61,425.10,425.12,916.71373,1597413657508000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.13,425.15,424.63,424.89,853.85882,1597413723813000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.87,424.90,424.18,424.37,735.12614,1597413780504000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.40,424.40,423.75,424.30,674.36126,1597413819144000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.30,424.36,423.78,424.00,679.16631,1597413876874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-26, side=SELL, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-140436-001-000-26, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-26, account_id=BINANCE-001, ts_event=1597413876874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27, side=SELL, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-140436-001-000-27, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:04:36.874000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-140436-001-000-27, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-140436-001-000-27, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-140436-001-000-27, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-140436-001-000-27, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E1, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-140436-001-000-27, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-140436-001-000-27-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-140436-001-000-27, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E1, account_id=BINANCE-001, ts_event=1597413876874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-140436-001-000-27: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_998.69270082 USDT, locked=0.00000000 USDT, free=999_998.69270082 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=231853e2-f187-404c-b6df-c68b5677679d)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-26, venue_order_id=BINANCE-1-065, account_id=BINANCE-001, trade_id=BINANCE-1-066, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.10000, last_px=424.00 USDT, commission=0.00424000 USDT, liquidity_side=TAKER, ts_event=1597413876874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-134936-001-000-25-E1, closing_order_id=O-20200814-140436-001-000-26, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=425.4024999999999, avg_px_close=424.0, realized_return=-0.00330, realized_pnl=-0.14874403 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597412976198000000, ts_last=1597413876874000000, ts_closed=1597413876874000000, duration_ns=900676000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:14:30.892000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_009.29164082 USDT, locked=0.00000000 USDT, free=1_000_009.29164082 USDT), AccountBalance(total=9.97500000 ETH, locked=0.00000000 ETH, free=9.97500000 ETH)], margins=[], event_id=9f8b41b9-3663-442e-942c-af80459320aa)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E1, venue_order_id=BINANCE-1-066, account_id=BINANCE-001, trade_id=BINANCE-1-067, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=424.00 USDT, commission=0.00106000 USDT, liquidity_side=TAKER, ts_event=1597413876874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.02500\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-140436-001-000-27-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=424.0, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106000 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597413876874000000, ts_last=1597413876874000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-140436-001-000-27, event_id=1f3d6e5e-c58f-4144-917f-018b9b1839cb, ts_event=1597413879374000000, ts_init=1597413879374000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E2, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-140436-001-000-27, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-140436-001-000-27-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-140436-001-000-27, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E2, account_id=BINANCE-001, ts_event=1597413879374000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_019.88958092 USDT, locked=0.00000000 USDT, free=1_000_019.88958092 USDT), AccountBalance(total=9.95000000 ETH, locked=0.00000000 ETH, free=9.95000000 ETH)], margins=[], event_id=676e3345-1e4e-490a-8e7b-53623ae9733b)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E2, venue_order_id=BINANCE-1-067, account_id=BINANCE-001, trade_id=BINANCE-1-068, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.96 USDT, commission=0.00105990 USDT, liquidity_side=TAKER, ts_event=1597413879374000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.05000\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:24:35.817000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-140436-001-000-27-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=423.98, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00211990 USDT, unrealized_pnl=0.00100000 USDT, ts_opened=1597413876874000000, ts_last=1597413879374000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-140436-001-000-27, event_id=fd42cce0-3fec-48bd-ac41-79f8576d8a04, ts_event=1597413881874000000, ts_init=1597413881874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E3, side=SELL, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-140436-001-000-27, tags=None)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-140436-001-000-27-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-140436-001-000-27, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E3, account_id=BINANCE-001, ts_event=1597413881874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_030.48702107 USDT, locked=0.00000000 USDT, free=1_000_030.48702107 USDT), AccountBalance(total=9.92500000 ETH, locked=0.00000000 ETH, free=9.92500000 ETH)], margins=[], event_id=563defaa-4664-4c57-8089-c3e44736a5d4)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27-E3, venue_order_id=BINANCE-1-068, account_id=BINANCE-001, trade_id=BINANCE-1-069, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.94 USDT, commission=0.00105985 USDT, liquidity_side=TAKER, ts_event=1597413881874000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.07500\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-140436-001-000-27-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=423.96666666666664, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00317975 USDT, unrealized_pnl=0.00200000 USDT, ts_opened=1597413876874000000, ts_last=1597413881874000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-140436-001-000-27, event_id=b24f96e6-8811-4037-8db3-074e0de78ee6, ts_event=1597413884374000000, ts_init=1597413884374000000)\u001b[0m\n",
+ "\u001b[1m2020-08-14T14:46:41.511000000Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-140436-001-000-27, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-140436-001-000-27, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362779616Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27, account_id=BINANCE-001, ts_event=1597413884374000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362792211Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-140436-001-000-27\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362796572Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=1_000_041.08496117 USDT, locked=0.00000000 USDT, free=1_000_041.08496117 USDT), AccountBalance(total=9.90000000 ETH, locked=0.00000000 ETH, free=9.90000000 ETH)], margins=[], event_id=fb69b982-2a51-49bf-879d-d8756a5eda19)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362800665Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-140436-001-000-27, venue_order_id=BINANCE-1-069, account_id=BINANCE-001, trade_id=BINANCE-1-070, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.02500, last_px=423.96 USDT, commission=0.00105990 USDT, liquidity_side=TAKER, ts_event=1597413884374000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362804556Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=-0.10000\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362807838Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-140436-001-000-27-E1, closing_order_id=None, entry=SELL, side=SHORT, signed_qty=-0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=423.9649999999999, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00423965 USDT, unrealized_pnl=0.00050000 USDT, ts_opened=1597413876874000000, ts_last=1597413884374000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362812349Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.98,424.31,423.52,424.31,484.58544,1597413966869000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362815309Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.30,424.48,423.88,424.23,815.37821,1597414024766000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362817333Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.22,424.43,423.82,423.82,602.81955,1597414119790000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362819100Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.83,424.63,423.80,424.62,458.65539,1597414177193000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362820809Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.63,424.72,424.21,424.35,352.25703,1597414228411000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362822371Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.39,424.39,423.76,423.89,486.10782,1597414303391000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362823833Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.90,423.97,423.38,423.55,724.33719,1597414334571000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362825411Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.56,423.60,422.36,422.38,986.54446,1597414357391000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.362827060Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.38,423.13,422.09,422.99,804.27005,1597414368063000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364398357Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.96,423.32,422.64,423.26,663.46244,1597414413603000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364414963Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.30,423.45,422.60,422.60,496.52387,1597414470892000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364418952Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.55,422.68,422.03,422.12,472.34897,1597414508270000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364422225Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.16,422.99,422.16,422.77,430.82520,1597414562687000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364425104Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.76,422.76,422.13,422.75,775.89389,1597414608507000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364428224Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,422.75,423.86,422.75,423.60,867.32541,1597414634352000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364430813Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.66,424.47,423.60,424.11,868.61590,1597414667574000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364433940Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.15,424.23,423.73,423.94,917.10920,1597414744143000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364436877Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.99,424.21,423.62,424.20,693.55969,1597414811875000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364439712Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.21,424.50,423.99,423.99,442.68307,1597414880010000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364442722Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,423.93,424.22,423.62,424.20,508.56838,1597414969438000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364445259Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.19,424.73,424.04,424.38,452.56000,1597415075817000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364448187Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364451285Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-28, side=BUY, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364455674Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-142435-001-000-28, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364459788Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-28, account_id=BINANCE-001, ts_event=1597415075817000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364463231Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29, side=BUY, type=MARKET, quantity=0.10000, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-142435-001-000-29, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364467093Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-142435-001-000-29, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-142435-001-000-29, tags=None), position_id=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364470514Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: MarketOrder(BUY 0.10000 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-142435-001-000-29, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-142435-001-000-29, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364475353Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Order execution size schedule: [Quantity(0.02500), Quantity(0.02500), Quantity(0.02500), Quantity(0.02500)]\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364478142Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E1, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-142435-001-000-29, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364481279Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-142435-001-000-29-E1, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-142435-001-000-29, tags=None), position_id=None).\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364484629Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E1, account_id=BINANCE-001, ts_event=1597415075817000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364487453Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Started TWAP execution for O-20200814-142435-001-000-29: horizon_secs=10.0, interval_secs=2.5\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364490290Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_998.64271737 USDT, locked=0.00000000 USDT, free=999_998.64271737 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=b28032a3-6643-49c1-af63-cb6aa74e6cec)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364493587Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-28, venue_order_id=BINANCE-1-070, account_id=BINANCE-001, trade_id=BINANCE-1-071, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.10000, last_px=424.38 USDT, commission=0.00424380 USDT, liquidity_side=TAKER, ts_event=1597415075817000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364496511Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364499267Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-140436-001-000-27-E1, closing_order_id=O-20200814-142435-001-000-28, entry=SELL, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=423.9649999999999, avg_px_close=424.38, realized_return=-0.00098, realized_pnl=-0.04998345 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597413876874000000, ts_last=1597415075817000000, ts_closed=1597415075817000000, duration_ns=1198943000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364504623Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_988.03215642 USDT, locked=0.00000000 USDT, free=999_988.03215642 USDT), AccountBalance(total=10.02500000 ETH, locked=0.00000000 ETH, free=10.02500000 ETH)], margins=[], event_id=97e776b0-16af-4079-b4dc-19c4afa6552c)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364508036Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E1, venue_order_id=BINANCE-1-071, account_id=BINANCE-001, trade_id=BINANCE-1-072, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.38 USDT, commission=0.00106095 USDT, liquidity_side=TAKER, ts_event=1597415075817000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364511184Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.02500\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364514037Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionOpened(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-142435-001-000-29-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.025, quantity=0.02500, peak_qty=0.02500, currency=USDT, avg_px_open=424.38, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00106095 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597415075817000000, ts_last=1597415075817000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364516657Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-142435-001-000-29, event_id=fd9ccdea-a6df-432b-b61c-bea89d174b1a, ts_event=1597415078317000000, ts_init=1597415078317000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364519651Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E2, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-142435-001-000-29, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364522702Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-142435-001-000-29-E2, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-142435-001-000-29, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364525791Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E2, account_id=BINANCE-001, ts_event=1597415078317000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364528733Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_977.42159547 USDT, locked=0.00000000 USDT, free=999_977.42159547 USDT), AccountBalance(total=10.05000000 ETH, locked=0.00000000 ETH, free=10.05000000 ETH)], margins=[], event_id=f258571b-bb83-4562-b460-a35f37ada0a4)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364605764Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E2, venue_order_id=BINANCE-1-072, account_id=BINANCE-001, trade_id=BINANCE-1-073, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.38 USDT, commission=0.00106095 USDT, liquidity_side=TAKER, ts_event=1597415078317000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364611849Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.05000\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364614792Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-142435-001-000-29-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.05, quantity=0.05000, peak_qty=0.05000, currency=USDT, avg_px_open=424.38, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00212190 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597415075817000000, ts_last=1597415078317000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364618452Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-142435-001-000-29, event_id=3e406fd2-d70a-43c3-a2f3-f7f7dd4471da, ts_event=1597415080817000000, ts_init=1597415080817000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364621656Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E3, side=BUY, type=MARKET, quantity=0.02500, time_in_force=FOK, post_only=False, reduce_only=False, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=TWAP, exec_algorithm_params=None, exec_spawn_id=O-20200814-142435-001-000-29, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364624591Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-142435-001-000-29-E3, venue_order_id=None, position_id=None, exec_algorithm_id=TWAP, exec_spawn_id=O-20200814-142435-001-000-29, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364628521Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E3, account_id=BINANCE-001, ts_event=1597415080817000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364631901Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_966.81203462 USDT, locked=0.00000000 USDT, free=999_966.81203462 USDT), AccountBalance(total=10.07500000 ETH, locked=0.00000000 ETH, free=10.07500000 ETH)], margins=[], event_id=ee1c7b02-1f2c-4b6b-8bc8-674b838d0794)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364635106Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29-E3, venue_order_id=BINANCE-1-073, account_id=BINANCE-001, trade_id=BINANCE-1-074, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.34 USDT, commission=0.00106085 USDT, liquidity_side=TAKER, ts_event=1597415080817000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364638470Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.07500\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364641484Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-142435-001-000-29-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.075, quantity=0.07500, peak_qty=0.07500, currency=USDT, avg_px_open=424.3666666666666, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00318275 USDT, unrealized_pnl=-0.00200000 USDT, ts_opened=1597415075817000000, ts_last=1597415080817000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364770020Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.TWAPExecAlgorithm: TimeEvent(name=O-20200814-142435-001-000-29, event_id=048d5d57-8f65-4e69-b1a5-a5d9b6a7b4c0, ts_event=1597415083317000000, ts_init=1597415083317000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364776582Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: [CMD]--> SubmitOrder(order=MarketOrder(BUY 0.02500 ETHUSDT.BINANCE MARKET FOK, status=INITIALIZED, client_order_id=O-20200814-142435-001-000-29, venue_order_id=None, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, exec_algorithm_id=TWAP, exec_algorithm_params={'horizon_secs': 10.0, 'interval_secs': 2.5}, exec_spawn_id=O-20200814-142435-001-000-29, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000).\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364780180Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29, account_id=BINANCE-001, ts_event=1597415083317000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364783533Z\u001b[0m \u001b[94m[INFO] BACKTESTER-001.TWAPExecAlgorithm: Completed TWAP execution for O-20200814-142435-001-000-29\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364786281Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_956.20097362 USDT, locked=0.00000000 USDT, free=999_956.20097362 USDT), AccountBalance(total=10.10000000 ETH, locked=0.00000000 ETH, free=10.10000000 ETH)], margins=[], event_id=f2c1452e-0a01-4d54-8bd1-2b74d1dc646c)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364789139Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-142435-001-000-29, venue_order_id=BINANCE-1-074, account_id=BINANCE-001, trade_id=BINANCE-1-075, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=BUY, order_type=MARKET, last_qty=0.02500, last_px=424.40 USDT, commission=0.00106100 USDT, liquidity_side=TAKER, ts_event=1597415083317000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364792481Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0.10000\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364795468Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionChanged(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-142435-001-000-29-E1, closing_order_id=None, entry=BUY, side=LONG, signed_qty=0.1, quantity=0.10000, peak_qty=0.10000, currency=USDT, avg_px_open=424.3749999999999, avg_px_close=0.0, realized_return=0.00000, realized_pnl=-0.00424375 USDT, unrealized_pnl=0.00250000 USDT, ts_opened=1597415075817000000, ts_last=1597415083317000000, ts_closed=0, duration_ns=0)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364798819Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.38,425.21,424.23,425.21,635.74969,1597415182518000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364801397Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.22,425.22,424.28,424.30,717.92037,1597415260158000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364803767Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.27,424.88,423.99,424.77,636.19301,1597415330441000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364806944Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.77,424.77,424.21,424.37,442.56478,1597415410588000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364809896Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.36,424.90,424.32,424.90,528.19007,1597415488185000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364865103Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.90,425.56,424.89,425.56,604.15256,1597415537826000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364870522Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.57,425.75,425.35,425.35,689.42538,1597415612189000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364873556Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.35,425.64,425.25,425.53,372.01244,1597415708957000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364876253Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.50,425.52,425.00,425.43,453.82141,1597415772358000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364879031Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.42,425.47,424.86,424.86,670.42146,1597415879497000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364881465Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.85,425.53,424.85,425.31,488.30756,1597416013234000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364884380Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.31,425.31,424.57,424.92,796.41221,1597416060183000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364887011Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.89,425.25,424.75,424.82,541.24944,1597416185016000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364890318Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,424.83,425.48,424.73,425.45,405.38439,1597416324324000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364893333Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.46,425.75,425.42,425.69,661.48038,1597416401511000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364895573Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.70,425.96,425.69,425.95,505.83711,1597416499877000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364898287Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,425.96,426.50,425.96,426.45,679.85670,1597416560509000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364900747Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.43,426.50,426.23,426.45,537.64750,1597416632431000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364903805Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.46,427.00,426.45,426.97,683.19668,1597416681040000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364906646Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.97,426.98,426.47,426.72,681.17386,1597416720695000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364909190Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.72,426.75,426.51,426.57,558.71994,1597416793572000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364911839Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.55,427.01,426.46,426.74,436.27318,1597416859569000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364914337Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.73,426.98,426.71,426.73,802.76283,1597416934031000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364917058Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.70,426.74,426.51,426.67,524.35010,1597417005471000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364919724Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.66,426.76,426.22,426.39,735.56170,1597417069868000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364922135Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.40,426.47,426.00,426.20,752.30180,1597417118705000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.364924625Z\u001b[0m \u001b[36m[INFO] BACKTESTER-001.EMACrossTWAP: Bar(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL,426.26,426.86,426.26,426.82,570.75965,1597417181990000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365485822Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: No ETHUSDT.BINANCE open or emulated orders to cancel\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365497555Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Closing 1 open position\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365501012Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderInitialized(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-145958-001-000-30, side=SELL, type=MARKET, quantity=0.10000, time_in_force=GTC, post_only=False, reduce_only=True, quote_quantity=False, options={}, emulation_trigger=NO_TRIGGER, trigger_instrument_id=None, contingency_type=NO_CONTINGENCY, order_list_id=None, linked_order_ids=None, parent_order_id=None, exec_algorithm_id=None, exec_algorithm_params=None, exec_spawn_id=None, tags=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365505950Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> SubmitOrder(order=MarketOrder(SELL 0.10000 ETHUSDT.BINANCE MARKET GTC, status=INITIALIZED, client_order_id=O-20200814-145958-001-000-30, venue_order_id=None, position_id=None, tags=None), position_id=ETHUSDT.BINANCE-EMACrossTWAP-000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365509466Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderSubmitted(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-145958-001-000-30, account_id=BINANCE-001, ts_event=1597417198693000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365513148Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: [CMD]--> Unsubscribe(client_id=None, venue=BINANCE, data_type=Bar{'bar_type': BarType(ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL)})\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365516984Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: Unsubscribed from ETHUSDT.BINANCE-250-TICK-LAST-INTERNAL bar data\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365520156Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365523505Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365526666Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365529349Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: Disconnecting...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365532578Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: Disconnected\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365535666Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365538423Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365541507Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365544269Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: Disconnecting...\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365547775Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: Disconnected\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365550918Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365553323Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365555860Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: STOPPED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365558507Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=False, balances=[AccountBalance(total=999_998.88570472 USDT, locked=0.00000000 USDT, free=999_998.88570472 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=6e9d9162-b388-4ae1-9a21-fa7ff4089da6)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365562213Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] OrderFilled(instrument_id=ETHUSDT.BINANCE, client_order_id=O-20200814-145958-001-000-30, venue_order_id=BINANCE-1-075, account_id=BINANCE-001, trade_id=BINANCE-1-076, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, order_side=SELL, order_type=MARKET, last_qty=0.10000, last_px=426.89 USDT, commission=0.00426890 USDT, liquidity_side=TAKER, ts_event=1597417198693000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365565908Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: ETHUSDT.BINANCE net_position=0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.365568540Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: <--[EVT] PositionClosed(instrument_id=ETHUSDT.BINANCE, position_id=ETHUSDT.BINANCE-EMACrossTWAP-000, account_id=BINANCE-001, opening_order_id=O-20200814-142435-001-000-29-E1, closing_order_id=O-20200814-145958-001-000-30, entry=BUY, side=FLAT, signed_qty=0.0, quantity=0.00000, peak_qty=0.10000, currency=USDT, avg_px_open=424.3749999999999, avg_px_close=426.89, realized_return=0.00593, realized_pnl=0.24298735 USDT, unrealized_pnl=0.00000000 USDT, ts_opened=1597415075817000000, ts_last=1597417198693000000, ts_closed=1597417198693000000, duration_ns=2122876000000)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366302848Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366316897Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m BACKTEST POST-RUN\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366321135Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366324068Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run config ID: None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366326986Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run ID: 636ee571-94de-4f20-a96b-def8bf56514b\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366329918Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run started: 2024-09-17 15:22:36.867968+00:00\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366332894Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Run finished: 2024-09-17 15:22:38.331798+00:00\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366335755Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Elapsed time: 0 days 00:00:01.463830\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366338632Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Backtest start: 2020-08-14 10:00:00.223000+00:00\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366341453Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Backtest end: 2020-08-14 14:59:58.693000+00:00\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366344420Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Backtest range: 0 days 04:59:58.470000\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366346883Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Iterations: 69,806\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366349692Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Total events: 152\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366352313Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Total orders: 75\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366354774Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Total positions: 15\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366356871Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366359217Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m SimulatedVenue BINANCE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366361583Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366363910Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: CashAccount(id=BINANCE-001, type=CASH, base=None)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366366854Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366369992Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Balances starting:\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366372284Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 1_000_000.00000000 USDT\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366374810Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 10.00000000 ETH\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366377248Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366380095Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Balances ending:\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366382611Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 999_998.88570472 USDT\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366385195Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: 10.00000000 ETH\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366387469Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366390110Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Commissions:\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366393243Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: -0.12543578 USDT\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366395971Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366398626Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Unrealized PnLs (included in totals):\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366401250Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: None\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366403899Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366406587Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m PORTFOLIO PERFORMANCE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366408965Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m=================================================================\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366411459Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL Statistics (ETH)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366414420Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366417018Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL (total): 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366419782Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL% (total): 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366422376Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Max Winner: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366425277Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Avg Winner: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366427555Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Min Winner: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366429742Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Min Loser: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366432247Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Avg Loser: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366434481Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Max Loser: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366437386Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Expectancy: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366439716Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Win Rate: 0.0\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366441979Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366444278Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL Statistics (USDT)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366447172Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366449812Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL (total): -1.11429528\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366452504Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: PnL% (total): -0.00011142952799564228\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366455128Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Max Winner: 0.24298735\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366457531Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Avg Winner: 0.09627393666666667\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366460325Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Min Winner: 0.00260444\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366462994Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Min Loser: -0.03825979\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366466176Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Avg Loser: -0.11692642416666667\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366468827Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Max Loser: -0.21900145\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366471743Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Expectancy: -0.074286352\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366474660Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Win Rate: 0.2\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366477498Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366480111Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Returns Statistics\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366482950Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366485581Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Returns Volatility (252 days): nan\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366487966Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Average (Return): -0.0015462005179200783\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366490479Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Average Loss (Return): -0.002551242521256992\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366492976Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Average Win (Return): 0.0024739674954275762\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366495347Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Sharpe Ratio (252 days): nan\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366497906Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Sortino Ratio (252 days): -15.874507866387544\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366500213Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Profit Factor: 0.24242770677566333\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366503017Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Risk Return Ratio: -0.5879308154632413\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366505387Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366508414Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: General Statistics\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366511382Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366513827Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Long Ratio: 0.53\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:38.366516692Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: \u001b[36m-----------------------------------------------------------------\u001b[0m\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " total | \n",
+ " locked | \n",
+ " free | \n",
+ " currency | \n",
+ " account_id | \n",
+ " account_type | \n",
+ " base_currency | \n",
+ " margins | \n",
+ " reported | \n",
+ " info | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2020-08-14 10:00:00.223000+00:00 | \n",
+ " 1000000.00000000 | \n",
+ " 0E-8 | \n",
+ " 1000000.00000000 | \n",
+ " USDT | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " True | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 10:00:00.223000+00:00 | \n",
+ " 10.00000000 | \n",
+ " 0E-8 | \n",
+ " 10.00000000 | \n",
+ " ETH | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " True | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 10:22:34.574000+00:00 | \n",
+ " 999989.38468857 | \n",
+ " 0E-8 | \n",
+ " 999989.38468857 | \n",
+ " USDT | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " False | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 10:22:34.574000+00:00 | \n",
+ " 10.02500000 | \n",
+ " 0E-8 | \n",
+ " 10.02500000 | \n",
+ " ETH | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " False | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 10:22:37.074000+00:00 | \n",
+ " 999978.76937714 | \n",
+ " 0E-8 | \n",
+ " 999978.76937714 | \n",
+ " USDT | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " False | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 14:24:40.817000+00:00 | \n",
+ " 10.07500000 | \n",
+ " 0E-8 | \n",
+ " 10.07500000 | \n",
+ " ETH | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " False | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 14:24:43.317000+00:00 | \n",
+ " 999956.20097362 | \n",
+ " 0E-8 | \n",
+ " 999956.20097362 | \n",
+ " USDT | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " False | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 14:24:43.317000+00:00 | \n",
+ " 10.10000000 | \n",
+ " 0E-8 | \n",
+ " 10.10000000 | \n",
+ " ETH | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " False | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 14:59:58.693000+00:00 | \n",
+ " 999998.88570472 | \n",
+ " 0E-8 | \n",
+ " 999998.88570472 | \n",
+ " USDT | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " False | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ " 2020-08-14 14:59:58.693000+00:00 | \n",
+ " 10.00000000 | \n",
+ " 0E-8 | \n",
+ " 10.00000000 | \n",
+ " ETH | \n",
+ " BINANCE-001 | \n",
+ " CASH | \n",
+ " None | \n",
+ " [] | \n",
+ " False | \n",
+ " {} | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
156 rows × 10 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " total locked free \\\n",
+ "2020-08-14 10:00:00.223000+00:00 1000000.00000000 0E-8 1000000.00000000 \n",
+ "2020-08-14 10:00:00.223000+00:00 10.00000000 0E-8 10.00000000 \n",
+ "2020-08-14 10:22:34.574000+00:00 999989.38468857 0E-8 999989.38468857 \n",
+ "2020-08-14 10:22:34.574000+00:00 10.02500000 0E-8 10.02500000 \n",
+ "2020-08-14 10:22:37.074000+00:00 999978.76937714 0E-8 999978.76937714 \n",
+ "... ... ... ... \n",
+ "2020-08-14 14:24:40.817000+00:00 10.07500000 0E-8 10.07500000 \n",
+ "2020-08-14 14:24:43.317000+00:00 999956.20097362 0E-8 999956.20097362 \n",
+ "2020-08-14 14:24:43.317000+00:00 10.10000000 0E-8 10.10000000 \n",
+ "2020-08-14 14:59:58.693000+00:00 999998.88570472 0E-8 999998.88570472 \n",
+ "2020-08-14 14:59:58.693000+00:00 10.00000000 0E-8 10.00000000 \n",
+ "\n",
+ " currency account_id account_type \\\n",
+ "2020-08-14 10:00:00.223000+00:00 USDT BINANCE-001 CASH \n",
+ "2020-08-14 10:00:00.223000+00:00 ETH BINANCE-001 CASH \n",
+ "2020-08-14 10:22:34.574000+00:00 USDT BINANCE-001 CASH \n",
+ "2020-08-14 10:22:34.574000+00:00 ETH BINANCE-001 CASH \n",
+ "2020-08-14 10:22:37.074000+00:00 USDT BINANCE-001 CASH \n",
+ "... ... ... ... \n",
+ "2020-08-14 14:24:40.817000+00:00 ETH BINANCE-001 CASH \n",
+ "2020-08-14 14:24:43.317000+00:00 USDT BINANCE-001 CASH \n",
+ "2020-08-14 14:24:43.317000+00:00 ETH BINANCE-001 CASH \n",
+ "2020-08-14 14:59:58.693000+00:00 USDT BINANCE-001 CASH \n",
+ "2020-08-14 14:59:58.693000+00:00 ETH BINANCE-001 CASH \n",
+ "\n",
+ " base_currency margins reported info \n",
+ "2020-08-14 10:00:00.223000+00:00 None [] True {} \n",
+ "2020-08-14 10:00:00.223000+00:00 None [] True {} \n",
+ "2020-08-14 10:22:34.574000+00:00 None [] False {} \n",
+ "2020-08-14 10:22:34.574000+00:00 None [] False {} \n",
+ "2020-08-14 10:22:37.074000+00:00 None [] False {} \n",
+ "... ... ... ... ... \n",
+ "2020-08-14 14:24:40.817000+00:00 None [] False {} \n",
+ "2020-08-14 14:24:43.317000+00:00 None [] False {} \n",
+ "2020-08-14 14:24:43.317000+00:00 None [] False {} \n",
+ "2020-08-14 14:59:58.693000+00:00 None [] False {} \n",
+ "2020-08-14 14:59:58.693000+00:00 None [] False {} \n",
+ "\n",
+ "[156 rows x 10 columns]"
+ ]
+ },
+ "execution_count": 35,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "engine.trader.generate_account_report(BINANCE)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " trader_id | \n",
+ " strategy_id | \n",
+ " instrument_id | \n",
+ " venue_order_id | \n",
+ " position_id | \n",
+ " account_id | \n",
+ " last_trade_id | \n",
+ " type | \n",
+ " side | \n",
+ " quantity | \n",
+ " ... | \n",
+ " order_list_id | \n",
+ " linked_order_ids | \n",
+ " parent_order_id | \n",
+ " exec_algorithm_id | \n",
+ " exec_algorithm_params | \n",
+ " exec_spawn_id | \n",
+ " tags | \n",
+ " init_id | \n",
+ " ts_init | \n",
+ " ts_last | \n",
+ "
\n",
+ " \n",
+ " client_order_id | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " O-20200814-102234-001-000-1 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-004 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-004 | \n",
+ " MARKET | \n",
+ " BUY | \n",
+ " 0.02500 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " TWAP | \n",
+ " {'horizon_secs': 10.0, 'interval_secs': 2.5} | \n",
+ " O-20200814-102234-001-000-1 | \n",
+ " None | \n",
+ " e5626299-832c-47b1-a3fc-bb8925d8bace | \n",
+ " 2020-08-14 10:22:34.574000+00:00 | \n",
+ " 2020-08-14 10:22:42.074000+00:00 | \n",
+ "
\n",
+ " \n",
+ " O-20200814-102234-001-000-1-E1 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-001 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-001 | \n",
+ " MARKET | \n",
+ " BUY | \n",
+ " 0.02500 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " TWAP | \n",
+ " None | \n",
+ " O-20200814-102234-001-000-1 | \n",
+ " None | \n",
+ " ad4f5938-b20f-41af-9499-c17a3e35ece3 | \n",
+ " 2020-08-14 10:22:34.574000+00:00 | \n",
+ " 2020-08-14 10:22:34.574000+00:00 | \n",
+ "
\n",
+ " \n",
+ " O-20200814-102234-001-000-1-E2 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-002 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-002 | \n",
+ " MARKET | \n",
+ " BUY | \n",
+ " 0.02500 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " TWAP | \n",
+ " None | \n",
+ " O-20200814-102234-001-000-1 | \n",
+ " None | \n",
+ " 37a7bc1f-1116-4988-8c52-bfc0d36612e2 | \n",
+ " 2020-08-14 10:22:37.074000+00:00 | \n",
+ " 2020-08-14 10:22:37.074000+00:00 | \n",
+ "
\n",
+ " \n",
+ " O-20200814-102234-001-000-1-E3 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-003 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-003 | \n",
+ " MARKET | \n",
+ " BUY | \n",
+ " 0.02500 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " TWAP | \n",
+ " None | \n",
+ " O-20200814-102234-001-000-1 | \n",
+ " None | \n",
+ " 19c340d9-3c87-45a4-921c-8d14ed1d69f9 | \n",
+ " 2020-08-14 10:22:39.574000+00:00 | \n",
+ " 2020-08-14 10:22:39.574000+00:00 | \n",
+ "
\n",
+ " \n",
+ " O-20200814-103237-001-000-2 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-005 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-005 | \n",
+ " MARKET | \n",
+ " SELL | \n",
+ " 0.10000 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " b6698eb1-e678-4184-95a3-8ecaf93a3766 | \n",
+ " 2020-08-14 10:32:37.428000+00:00 | \n",
+ " 2020-08-14 10:32:37.428000+00:00 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " O-20200814-142435-001-000-29 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-074 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-075 | \n",
+ " MARKET | \n",
+ " BUY | \n",
+ " 0.02500 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " TWAP | \n",
+ " {'horizon_secs': 10.0, 'interval_secs': 2.5} | \n",
+ " O-20200814-142435-001-000-29 | \n",
+ " None | \n",
+ " fa0f7760-64f4-4b21-8757-aca1cee4a935 | \n",
+ " 2020-08-14 14:24:35.817000+00:00 | \n",
+ " 2020-08-14 14:24:43.317000+00:00 | \n",
+ "
\n",
+ " \n",
+ " O-20200814-142435-001-000-29-E1 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-071 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-072 | \n",
+ " MARKET | \n",
+ " BUY | \n",
+ " 0.02500 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " TWAP | \n",
+ " None | \n",
+ " O-20200814-142435-001-000-29 | \n",
+ " None | \n",
+ " 01bb7931-d867-47f3-840f-14c0b36c65fa | \n",
+ " 2020-08-14 14:24:35.817000+00:00 | \n",
+ " 2020-08-14 14:24:35.817000+00:00 | \n",
+ "
\n",
+ " \n",
+ " O-20200814-142435-001-000-29-E2 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-072 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-073 | \n",
+ " MARKET | \n",
+ " BUY | \n",
+ " 0.02500 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " TWAP | \n",
+ " None | \n",
+ " O-20200814-142435-001-000-29 | \n",
+ " None | \n",
+ " 8c2001c7-7e7a-4fd3-b131-bc818c72fdbc | \n",
+ " 2020-08-14 14:24:38.317000+00:00 | \n",
+ " 2020-08-14 14:24:38.317000+00:00 | \n",
+ "
\n",
+ " \n",
+ " O-20200814-142435-001-000-29-E3 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-073 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-074 | \n",
+ " MARKET | \n",
+ " BUY | \n",
+ " 0.02500 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " TWAP | \n",
+ " None | \n",
+ " O-20200814-142435-001-000-29 | \n",
+ " None | \n",
+ " fee24289-da82-4027-ada2-ebe24c99b12f | \n",
+ " 2020-08-14 14:24:40.817000+00:00 | \n",
+ " 2020-08-14 14:24:40.817000+00:00 | \n",
+ "
\n",
+ " \n",
+ " O-20200814-145958-001-000-30 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-1-075 | \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BINANCE-001 | \n",
+ " BINANCE-1-076 | \n",
+ " MARKET | \n",
+ " SELL | \n",
+ " 0.10000 | \n",
+ " ... | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " None | \n",
+ " 34e1b6c3-9cc6-46d0-a4d6-122438e097a0 | \n",
+ " 2020-08-14 14:59:58.693000+00:00 | \n",
+ " 2020-08-14 14:59:58.693000+00:00 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
74 rows × 31 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " trader_id strategy_id \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "O-20200814-102234-001-000-1-E1 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "O-20200814-102234-001-000-1-E2 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "O-20200814-102234-001-000-1-E3 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "O-20200814-103237-001-000-2 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "... ... ... \n",
+ "O-20200814-142435-001-000-29 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "O-20200814-142435-001-000-29-E1 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "O-20200814-142435-001-000-29-E2 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "O-20200814-142435-001-000-29-E3 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "O-20200814-145958-001-000-30 BACKTESTER-001 EMACrossTWAP-000 \n",
+ "\n",
+ " instrument_id venue_order_id \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 ETHUSDT.BINANCE BINANCE-1-004 \n",
+ "O-20200814-102234-001-000-1-E1 ETHUSDT.BINANCE BINANCE-1-001 \n",
+ "O-20200814-102234-001-000-1-E2 ETHUSDT.BINANCE BINANCE-1-002 \n",
+ "O-20200814-102234-001-000-1-E3 ETHUSDT.BINANCE BINANCE-1-003 \n",
+ "O-20200814-103237-001-000-2 ETHUSDT.BINANCE BINANCE-1-005 \n",
+ "... ... ... \n",
+ "O-20200814-142435-001-000-29 ETHUSDT.BINANCE BINANCE-1-074 \n",
+ "O-20200814-142435-001-000-29-E1 ETHUSDT.BINANCE BINANCE-1-071 \n",
+ "O-20200814-142435-001-000-29-E2 ETHUSDT.BINANCE BINANCE-1-072 \n",
+ "O-20200814-142435-001-000-29-E3 ETHUSDT.BINANCE BINANCE-1-073 \n",
+ "O-20200814-145958-001-000-30 ETHUSDT.BINANCE BINANCE-1-075 \n",
+ "\n",
+ " position_id \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "O-20200814-102234-001-000-1-E1 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "O-20200814-102234-001-000-1-E2 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "O-20200814-102234-001-000-1-E3 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "O-20200814-103237-001-000-2 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "... ... \n",
+ "O-20200814-142435-001-000-29 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "O-20200814-142435-001-000-29-E1 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "O-20200814-142435-001-000-29-E2 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "O-20200814-142435-001-000-29-E3 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "O-20200814-145958-001-000-30 ETHUSDT.BINANCE-EMACrossTWAP-000 \n",
+ "\n",
+ " account_id last_trade_id type side \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 BINANCE-001 BINANCE-1-004 MARKET BUY \n",
+ "O-20200814-102234-001-000-1-E1 BINANCE-001 BINANCE-1-001 MARKET BUY \n",
+ "O-20200814-102234-001-000-1-E2 BINANCE-001 BINANCE-1-002 MARKET BUY \n",
+ "O-20200814-102234-001-000-1-E3 BINANCE-001 BINANCE-1-003 MARKET BUY \n",
+ "O-20200814-103237-001-000-2 BINANCE-001 BINANCE-1-005 MARKET SELL \n",
+ "... ... ... ... ... \n",
+ "O-20200814-142435-001-000-29 BINANCE-001 BINANCE-1-075 MARKET BUY \n",
+ "O-20200814-142435-001-000-29-E1 BINANCE-001 BINANCE-1-072 MARKET BUY \n",
+ "O-20200814-142435-001-000-29-E2 BINANCE-001 BINANCE-1-073 MARKET BUY \n",
+ "O-20200814-142435-001-000-29-E3 BINANCE-001 BINANCE-1-074 MARKET BUY \n",
+ "O-20200814-145958-001-000-30 BINANCE-001 BINANCE-1-076 MARKET SELL \n",
+ "\n",
+ " quantity ... order_list_id linked_order_ids \\\n",
+ "client_order_id ... \n",
+ "O-20200814-102234-001-000-1 0.02500 ... None None \n",
+ "O-20200814-102234-001-000-1-E1 0.02500 ... None None \n",
+ "O-20200814-102234-001-000-1-E2 0.02500 ... None None \n",
+ "O-20200814-102234-001-000-1-E3 0.02500 ... None None \n",
+ "O-20200814-103237-001-000-2 0.10000 ... None None \n",
+ "... ... ... ... ... \n",
+ "O-20200814-142435-001-000-29 0.02500 ... None None \n",
+ "O-20200814-142435-001-000-29-E1 0.02500 ... None None \n",
+ "O-20200814-142435-001-000-29-E2 0.02500 ... None None \n",
+ "O-20200814-142435-001-000-29-E3 0.02500 ... None None \n",
+ "O-20200814-145958-001-000-30 0.10000 ... None None \n",
+ "\n",
+ " parent_order_id exec_algorithm_id \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 None TWAP \n",
+ "O-20200814-102234-001-000-1-E1 None TWAP \n",
+ "O-20200814-102234-001-000-1-E2 None TWAP \n",
+ "O-20200814-102234-001-000-1-E3 None TWAP \n",
+ "O-20200814-103237-001-000-2 None None \n",
+ "... ... ... \n",
+ "O-20200814-142435-001-000-29 None TWAP \n",
+ "O-20200814-142435-001-000-29-E1 None TWAP \n",
+ "O-20200814-142435-001-000-29-E2 None TWAP \n",
+ "O-20200814-142435-001-000-29-E3 None TWAP \n",
+ "O-20200814-145958-001-000-30 None None \n",
+ "\n",
+ " exec_algorithm_params \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 {'horizon_secs': 10.0, 'interval_secs': 2.5} \n",
+ "O-20200814-102234-001-000-1-E1 None \n",
+ "O-20200814-102234-001-000-1-E2 None \n",
+ "O-20200814-102234-001-000-1-E3 None \n",
+ "O-20200814-103237-001-000-2 None \n",
+ "... ... \n",
+ "O-20200814-142435-001-000-29 {'horizon_secs': 10.0, 'interval_secs': 2.5} \n",
+ "O-20200814-142435-001-000-29-E1 None \n",
+ "O-20200814-142435-001-000-29-E2 None \n",
+ "O-20200814-142435-001-000-29-E3 None \n",
+ "O-20200814-145958-001-000-30 None \n",
+ "\n",
+ " exec_spawn_id tags \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 O-20200814-102234-001-000-1 None \n",
+ "O-20200814-102234-001-000-1-E1 O-20200814-102234-001-000-1 None \n",
+ "O-20200814-102234-001-000-1-E2 O-20200814-102234-001-000-1 None \n",
+ "O-20200814-102234-001-000-1-E3 O-20200814-102234-001-000-1 None \n",
+ "O-20200814-103237-001-000-2 None None \n",
+ "... ... ... \n",
+ "O-20200814-142435-001-000-29 O-20200814-142435-001-000-29 None \n",
+ "O-20200814-142435-001-000-29-E1 O-20200814-142435-001-000-29 None \n",
+ "O-20200814-142435-001-000-29-E2 O-20200814-142435-001-000-29 None \n",
+ "O-20200814-142435-001-000-29-E3 O-20200814-142435-001-000-29 None \n",
+ "O-20200814-145958-001-000-30 None None \n",
+ "\n",
+ " init_id \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 e5626299-832c-47b1-a3fc-bb8925d8bace \n",
+ "O-20200814-102234-001-000-1-E1 ad4f5938-b20f-41af-9499-c17a3e35ece3 \n",
+ "O-20200814-102234-001-000-1-E2 37a7bc1f-1116-4988-8c52-bfc0d36612e2 \n",
+ "O-20200814-102234-001-000-1-E3 19c340d9-3c87-45a4-921c-8d14ed1d69f9 \n",
+ "O-20200814-103237-001-000-2 b6698eb1-e678-4184-95a3-8ecaf93a3766 \n",
+ "... ... \n",
+ "O-20200814-142435-001-000-29 fa0f7760-64f4-4b21-8757-aca1cee4a935 \n",
+ "O-20200814-142435-001-000-29-E1 01bb7931-d867-47f3-840f-14c0b36c65fa \n",
+ "O-20200814-142435-001-000-29-E2 8c2001c7-7e7a-4fd3-b131-bc818c72fdbc \n",
+ "O-20200814-142435-001-000-29-E3 fee24289-da82-4027-ada2-ebe24c99b12f \n",
+ "O-20200814-145958-001-000-30 34e1b6c3-9cc6-46d0-a4d6-122438e097a0 \n",
+ "\n",
+ " ts_init \\\n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 2020-08-14 10:22:34.574000+00:00 \n",
+ "O-20200814-102234-001-000-1-E1 2020-08-14 10:22:34.574000+00:00 \n",
+ "O-20200814-102234-001-000-1-E2 2020-08-14 10:22:37.074000+00:00 \n",
+ "O-20200814-102234-001-000-1-E3 2020-08-14 10:22:39.574000+00:00 \n",
+ "O-20200814-103237-001-000-2 2020-08-14 10:32:37.428000+00:00 \n",
+ "... ... \n",
+ "O-20200814-142435-001-000-29 2020-08-14 14:24:35.817000+00:00 \n",
+ "O-20200814-142435-001-000-29-E1 2020-08-14 14:24:35.817000+00:00 \n",
+ "O-20200814-142435-001-000-29-E2 2020-08-14 14:24:38.317000+00:00 \n",
+ "O-20200814-142435-001-000-29-E3 2020-08-14 14:24:40.817000+00:00 \n",
+ "O-20200814-145958-001-000-30 2020-08-14 14:59:58.693000+00:00 \n",
+ "\n",
+ " ts_last \n",
+ "client_order_id \n",
+ "O-20200814-102234-001-000-1 2020-08-14 10:22:42.074000+00:00 \n",
+ "O-20200814-102234-001-000-1-E1 2020-08-14 10:22:34.574000+00:00 \n",
+ "O-20200814-102234-001-000-1-E2 2020-08-14 10:22:37.074000+00:00 \n",
+ "O-20200814-102234-001-000-1-E3 2020-08-14 10:22:39.574000+00:00 \n",
+ "O-20200814-103237-001-000-2 2020-08-14 10:32:37.428000+00:00 \n",
+ "... ... \n",
+ "O-20200814-142435-001-000-29 2020-08-14 14:24:43.317000+00:00 \n",
+ "O-20200814-142435-001-000-29-E1 2020-08-14 14:24:35.817000+00:00 \n",
+ "O-20200814-142435-001-000-29-E2 2020-08-14 14:24:38.317000+00:00 \n",
+ "O-20200814-142435-001-000-29-E3 2020-08-14 14:24:40.817000+00:00 \n",
+ "O-20200814-145958-001-000-30 2020-08-14 14:59:58.693000+00:00 \n",
+ "\n",
+ "[74 rows x 31 columns]"
+ ]
+ },
+ "execution_count": 36,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "engine.trader.generate_order_fills_report()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " trader_id | \n",
+ " strategy_id | \n",
+ " instrument_id | \n",
+ " account_id | \n",
+ " opening_order_id | \n",
+ " closing_order_id | \n",
+ " entry | \n",
+ " side | \n",
+ " quantity | \n",
+ " peak_qty | \n",
+ " ts_opened | \n",
+ " ts_last | \n",
+ " ts_closed | \n",
+ " duration_ns | \n",
+ " avg_px_open | \n",
+ " avg_px_close | \n",
+ " commissions | \n",
+ " realized_return | \n",
+ " realized_pnl | \n",
+ "
\n",
+ " \n",
+ " position_id | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-4460-93b1-ff4c6c84a13c | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-102234-001-000-1-E1 | \n",
+ " O-20200814-103237-001-000-2 | \n",
+ " BUY | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 10:22:34.574000+00:00 | \n",
+ " 1597401157428000000 | \n",
+ " 2020-08-14 10:32:37.428000+00:00 | \n",
+ " 602854000000 | \n",
+ " 424.56249999999994 | \n",
+ " 423.49 | \n",
+ " ['0.00848054 USDT'] | \n",
+ " -0.00253 | \n",
+ " -0.11573054 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-4735-a06c-4a9f68b5c8d4 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-103237-001-000-3-E1 | \n",
+ " O-20200814-104611-001-000-4 | \n",
+ " SELL | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 10:32:37.428000+00:00 | \n",
+ " 1597401971428000000 | \n",
+ " 2020-08-14 10:46:11.428000+00:00 | \n",
+ " 814000000000 | \n",
+ " 423.48749999999995 | \n",
+ " 424.7 | \n",
+ " ['0.00848189 USDT'] | \n",
+ " -0.00286 | \n",
+ " -0.12973189 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-4bf2-bb08-2a47cceeaf25 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-104611-001-000-5-E1 | \n",
+ " O-20200814-110002-001-000-6 | \n",
+ " BUY | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 10:46:11.428000+00:00 | \n",
+ " 1597402802097000000 | \n",
+ " 2020-08-14 11:00:02.097000+00:00 | \n",
+ " 830669000000 | \n",
+ " 424.60499999999996 | \n",
+ " 424.14398199999994 | \n",
+ " ['0.00848750 USDT'] | \n",
+ " -0.00109 | \n",
+ " -0.05458930 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-4388-aab0-b7a3df20404a | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-110002-001-000-7-E1 | \n",
+ " O-20200814-111402-001-000-8 | \n",
+ " SELL | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 11:00:02.097000+00:00 | \n",
+ " 1597403642429000000 | \n",
+ " 2020-08-14 11:14:02.429000+00:00 | \n",
+ " 840332000000 | \n",
+ " 424.00499999999994 | \n",
+ " 425.57 | \n",
+ " ['0.00849577 USDT'] | \n",
+ " -0.00369 | \n",
+ " -0.16499577 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-4715-a5ae-c0d63ccc174e | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-111402-001-000-9-E1 | \n",
+ " O-20200814-113300-001-000-10 | \n",
+ " BUY | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 11:14:02.429000+00:00 | \n",
+ " 1597404780084000000 | \n",
+ " 2020-08-14 11:33:00.084000+00:00 | \n",
+ " 1137655000000 | \n",
+ " 425.6375 | \n",
+ " 425.34 | \n",
+ " ['0.00850979 USDT'] | \n",
+ " -0.0007 | \n",
+ " -0.03825979 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-4ad1-9018-d662222f737a | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-113300-001-000-11-E1 | \n",
+ " O-20200814-113705-001-000-12 | \n",
+ " SELL | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 11:33:00.084000+00:00 | \n",
+ " 1597405025204000000 | \n",
+ " 2020-08-14 11:37:05.204000+00:00 | \n",
+ " 245120000000 | \n",
+ " 425.43499999999995 | \n",
+ " 426.25 | \n",
+ " ['0.00851685 USDT'] | \n",
+ " -0.00192 | \n",
+ " -0.09001685 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-43ee-b874-33ef54fd1df6 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-113705-001-000-13-E1 | \n",
+ " O-20200814-120215-001-000-14 | \n",
+ " BUY | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.07500 | \n",
+ " 2020-08-14 11:37:05.204000+00:00 | \n",
+ " 1597406535235000000 | \n",
+ " 2020-08-14 12:02:15.235000+00:00 | \n",
+ " 1510031000000 | \n",
+ " 426.30999999999995 | \n",
+ " 426.43 | \n",
+ " ['0.00639556 USDT'] | \n",
+ " 0.00028 | \n",
+ " 0.00260444 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-4f68-a436-155a65f78d6e | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-120215-001-000-15-E1 | \n",
+ " O-20200814-123931-001-000-16 | \n",
+ " SELL | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 12:02:15.235000+00:00 | \n",
+ " 1597408771933000000 | \n",
+ " 2020-08-14 12:39:31.933000+00:00 | \n",
+ " 2236698000000 | \n",
+ " 426.36 | \n",
+ " 427.33 | \n",
+ " ['0.00853691 USDT'] | \n",
+ " -0.00228 | \n",
+ " -0.10553691 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-41fc-aeb5-46dde11fcd5d | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-123931-001-000-17-E1 | \n",
+ " O-20200814-125346-001-000-18 | \n",
+ " BUY | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 12:39:31.933000+00:00 | \n",
+ " 1597409626057000000 | \n",
+ " 2020-08-14 12:53:46.057000+00:00 | \n",
+ " 854124000000 | \n",
+ " 427.32249999999993 | \n",
+ " 426.26 | \n",
+ " ['0.00853583 USDT'] | \n",
+ " -0.00249 | \n",
+ " -0.11478583 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-4027-a0b5-bcddf269ccbd | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-125346-001-000-19-E1 | \n",
+ " O-20200814-131833-001-000-20 | \n",
+ " SELL | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 12:53:46.057000+00:00 | \n",
+ " 1597411113274000000 | \n",
+ " 2020-08-14 13:18:33.274000+00:00 | \n",
+ " 1487217000000 | \n",
+ " 426.25749999999994 | \n",
+ " 425.74 | \n",
+ " ['0.00851998 USDT'] | \n",
+ " 0.00121 | \n",
+ " 0.04323002 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-4e41-8179-5ae8f3fd4c83 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-131833-001-000-21-E1 | \n",
+ " O-20200814-133051-001-000-22 | \n",
+ " BUY | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 13:18:33.274000+00:00 | \n",
+ " 1597411851460000000 | \n",
+ " 2020-08-14 13:30:51.460000+00:00 | \n",
+ " 738186000000 | \n",
+ " 425.73999999999995 | \n",
+ " 423.634923 | \n",
+ " ['0.00849375 USDT'] | \n",
+ " -0.00494 | \n",
+ " -0.21900145 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-4b23-af27-4f65d4bb543d | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-133051-001-000-23-E1 | \n",
+ " O-20200814-134936-001-000-24 | \n",
+ " SELL | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 13:30:51.460000+00:00 | \n",
+ " 1597412976198000000 | \n",
+ " 2020-08-14 13:49:36.198000+00:00 | \n",
+ " 1124738000000 | \n",
+ " 423.7474999999999 | \n",
+ " 425.38 | \n",
+ " ['0.00849128 USDT'] | \n",
+ " -0.00385 | \n",
+ " -0.17174128 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-4403-864c-1003022097d1 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-134936-001-000-25-E1 | \n",
+ " O-20200814-140436-001-000-26 | \n",
+ " BUY | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 13:49:36.198000+00:00 | \n",
+ " 1597413876874000000 | \n",
+ " 2020-08-14 14:04:36.874000+00:00 | \n",
+ " 900676000000 | \n",
+ " 425.4024999999999 | \n",
+ " 424.0 | \n",
+ " ['0.00849403 USDT'] | \n",
+ " -0.0033 | \n",
+ " -0.14874403 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-42ef-a4c8-09b1fffafee0 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-140436-001-000-27-E1 | \n",
+ " O-20200814-142435-001-000-28 | \n",
+ " SELL | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 14:04:36.874000+00:00 | \n",
+ " 1597415075817000000 | \n",
+ " 2020-08-14 14:24:35.817000+00:00 | \n",
+ " 1198943000000 | \n",
+ " 423.9649999999999 | \n",
+ " 424.38 | \n",
+ " ['0.00848345 USDT'] | \n",
+ " -0.00098 | \n",
+ " -0.04998345 USDT | \n",
+ "
\n",
+ " \n",
+ " ETHUSDT.BINANCE-EMACrossTWAP-000 | \n",
+ " BACKTESTER-001 | \n",
+ " EMACrossTWAP-000 | \n",
+ " ETHUSDT.BINANCE | \n",
+ " BINANCE-001 | \n",
+ " O-20200814-142435-001-000-29-E1 | \n",
+ " O-20200814-145958-001-000-30 | \n",
+ " BUY | \n",
+ " FLAT | \n",
+ " 0.00000 | \n",
+ " 0.10000 | \n",
+ " 2020-08-14 14:24:35.817000+00:00 | \n",
+ " 1597417198693000000 | \n",
+ " 2020-08-14 14:59:58.693000+00:00 | \n",
+ " 2122876000000 | \n",
+ " 424.3749999999999 | \n",
+ " 426.89 | \n",
+ " ['0.00851265 USDT'] | \n",
+ " 0.00593 | \n",
+ " 0.24298735 USDT | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " trader_id \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... BACKTESTER-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 BACKTESTER-001 \n",
+ "\n",
+ " strategy_id \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... EMACrossTWAP-000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 EMACrossTWAP-000 \n",
+ "\n",
+ " instrument_id \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... ETHUSDT.BINANCE \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 ETHUSDT.BINANCE \n",
+ "\n",
+ " account_id \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... BINANCE-001 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 BINANCE-001 \n",
+ "\n",
+ " opening_order_id \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... O-20200814-102234-001-000-1-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... O-20200814-103237-001-000-3-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... O-20200814-104611-001-000-5-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... O-20200814-110002-001-000-7-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... O-20200814-111402-001-000-9-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... O-20200814-113300-001-000-11-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... O-20200814-113705-001-000-13-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... O-20200814-120215-001-000-15-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... O-20200814-123931-001-000-17-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... O-20200814-125346-001-000-19-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... O-20200814-131833-001-000-21-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... O-20200814-133051-001-000-23-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... O-20200814-134936-001-000-25-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... O-20200814-140436-001-000-27-E1 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 O-20200814-142435-001-000-29-E1 \n",
+ "\n",
+ " closing_order_id \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... O-20200814-103237-001-000-2 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... O-20200814-104611-001-000-4 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... O-20200814-110002-001-000-6 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... O-20200814-111402-001-000-8 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... O-20200814-113300-001-000-10 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... O-20200814-113705-001-000-12 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... O-20200814-120215-001-000-14 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... O-20200814-123931-001-000-16 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... O-20200814-125346-001-000-18 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... O-20200814-131833-001-000-20 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... O-20200814-133051-001-000-22 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... O-20200814-134936-001-000-24 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... O-20200814-140436-001-000-26 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... O-20200814-142435-001-000-28 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 O-20200814-145958-001-000-30 \n",
+ "\n",
+ " entry side quantity \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... BUY FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... SELL FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... BUY FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... SELL FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... BUY FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... SELL FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... BUY FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... SELL FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... BUY FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... SELL FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... BUY FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... SELL FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... BUY FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... SELL FLAT 0.00000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 BUY FLAT 0.00000 \n",
+ "\n",
+ " peak_qty \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 0.07500 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... 0.10000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 0.10000 \n",
+ "\n",
+ " ts_opened \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... 2020-08-14 10:22:34.574000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... 2020-08-14 10:32:37.428000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... 2020-08-14 10:46:11.428000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... 2020-08-14 11:00:02.097000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... 2020-08-14 11:14:02.429000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... 2020-08-14 11:33:00.084000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 2020-08-14 11:37:05.204000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... 2020-08-14 12:02:15.235000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... 2020-08-14 12:39:31.933000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 2020-08-14 12:53:46.057000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... 2020-08-14 13:18:33.274000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... 2020-08-14 13:30:51.460000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... 2020-08-14 13:49:36.198000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... 2020-08-14 14:04:36.874000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 2020-08-14 14:24:35.817000+00:00 \n",
+ "\n",
+ " ts_last \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... 1597401157428000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... 1597401971428000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... 1597402802097000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... 1597403642429000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... 1597404780084000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... 1597405025204000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 1597406535235000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... 1597408771933000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... 1597409626057000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 1597411113274000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... 1597411851460000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... 1597412976198000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... 1597413876874000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... 1597415075817000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 1597417198693000000 \n",
+ "\n",
+ " ts_closed \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... 2020-08-14 10:32:37.428000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... 2020-08-14 10:46:11.428000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... 2020-08-14 11:00:02.097000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... 2020-08-14 11:14:02.429000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... 2020-08-14 11:33:00.084000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... 2020-08-14 11:37:05.204000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 2020-08-14 12:02:15.235000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... 2020-08-14 12:39:31.933000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... 2020-08-14 12:53:46.057000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 2020-08-14 13:18:33.274000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... 2020-08-14 13:30:51.460000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... 2020-08-14 13:49:36.198000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... 2020-08-14 14:04:36.874000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... 2020-08-14 14:24:35.817000+00:00 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 2020-08-14 14:59:58.693000+00:00 \n",
+ "\n",
+ " duration_ns \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... 602854000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... 814000000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... 830669000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... 840332000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... 1137655000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... 245120000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 1510031000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... 2236698000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... 854124000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 1487217000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... 738186000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... 1124738000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... 900676000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... 1198943000000 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 2122876000000 \n",
+ "\n",
+ " avg_px_open \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... 424.56249999999994 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... 423.48749999999995 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... 424.60499999999996 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... 424.00499999999994 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... 425.6375 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... 425.43499999999995 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 426.30999999999995 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... 426.36 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... 427.32249999999993 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 426.25749999999994 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... 425.73999999999995 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... 423.7474999999999 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... 425.4024999999999 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... 423.9649999999999 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 424.3749999999999 \n",
+ "\n",
+ " avg_px_close \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... 423.49 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... 424.7 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... 424.14398199999994 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... 425.57 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... 425.34 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... 426.25 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 426.43 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... 427.33 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... 426.26 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 425.74 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... 423.634923 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... 425.38 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... 424.0 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... 424.38 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 426.89 \n",
+ "\n",
+ " commissions \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... ['0.00848054 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... ['0.00848189 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... ['0.00848750 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... ['0.00849577 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... ['0.00850979 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... ['0.00851685 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... ['0.00639556 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... ['0.00853691 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... ['0.00853583 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... ['0.00851998 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... ['0.00849375 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... ['0.00849128 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... ['0.00849403 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... ['0.00848345 USDT'] \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 ['0.00851265 USDT'] \n",
+ "\n",
+ " realized_return \\\n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... -0.00253 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... -0.00286 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... -0.00109 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... -0.00369 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... -0.0007 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... -0.00192 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 0.00028 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... -0.00228 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... -0.00249 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 0.00121 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... -0.00494 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... -0.00385 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... -0.0033 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... -0.00098 \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 0.00593 \n",
+ "\n",
+ " realized_pnl \n",
+ "position_id \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e152262f-7774-... -0.11573054 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ce48a4b8-27a1-... -0.12973189 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-57d5464e-d78b-... -0.05458930 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-8689f18e-b9e7-... -0.16499577 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7c2d6404-019d-... -0.03825979 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-201da9db-b662-... -0.09001685 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-4b86cc2f-ba1f-... 0.00260444 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-25c7ddaa-1a2e-... -0.10553691 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-e60944ff-9def-... -0.11478583 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-cc0c98b4-6d1d-... 0.04323002 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-491d1896-e7fa-... -0.21900145 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-3158242a-78a9-... -0.17174128 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-ab804686-6660-... -0.14874403 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000-7a9eead0-b485-... -0.04998345 USDT \n",
+ "ETHUSDT.BINANCE-EMACrossTWAP-000 0.24298735 USDT "
+ ]
+ },
+ "execution_count": 37,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "engine.trader.generate_positions_report()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Repeated runs\n",
+ "\n",
+ "We can also choose to reset the engine for repeated runs with different strategy and component configurations.\n",
+ "Calling the `.reset(...)` method will retain all loaded data and components, but reset all other stateful values\n",
+ "as if we had a fresh `BacktestEngine` (this avoids having to load the same data again)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:39.592902030Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.592919302Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.592938441Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593216580Z\u001b[0m [INFO] BACKTESTER-001.Cache: Reset\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593232607Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593257468Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593279879Z\u001b[0m [INFO] BACKTESTER-001.OrderEmulator: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593327564Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593352026Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593554217Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593591012Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: READY\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593671183Z\u001b[0m [INFO] BACKTESTER-001.Portfolio: Updated AccountState(account_id=BINANCE-001, account_type=CASH, base_currency=None, is_reported=True, balances=[AccountBalance(total=1_000_000.00000000 USDT, locked=0.00000000 USDT, free=1_000_000.00000000 USDT), AccountBalance(total=10.00000000 ETH, locked=0.00000000 ETH, free=10.00000000 ETH)], margins=[], event_id=4efeb596-47d7-4f2b-a20f-baadbeaedfb8)\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593703997Z\u001b[0m [INFO] BACKTESTER-001.OrderMatchingEngine(BINANCE): Reset OrderMatchingEngine ETHUSDT.BINANCE\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593708440Z\u001b[0m [INFO] BACKTESTER-001.SimulatedExchange(BINANCE): Reset\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.593711595Z\u001b[0m [INFO] BACKTESTER-001.BacktestEngine: Reset\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "# For repeated backtest runs make sure to reset the engine\n",
+ "engine.reset()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Individual components (actors, strategies, execution algorithms) need to be removed and added as required.\n",
+ "\n",
+ "See the [Trader](../api_reference/trading.md) API reference for a description of all methods available to achieve this."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u001b[1m2024-09-17T15:22:39.852427264Z\u001b[0m [INFO] BACKTESTER-001.DataClient-BINANCE: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852448931Z\u001b[0m [INFO] BACKTESTER-001.DataEngine: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852465006Z\u001b[0m [INFO] BACKTESTER-001.RiskEngine: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852501142Z\u001b[0m [INFO] BACKTESTER-001.ExecClient-BINANCE: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852523111Z\u001b[0m [INFO] BACKTESTER-001.ExecEngine: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852538628Z\u001b[0m [INFO] BACKTESTER-001.MessageBus: Closed message bus\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852558381Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Cleared all actors\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852585502Z\u001b[0m [INFO] BACKTESTER-001.EMACrossTWAP: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852603301Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Cleared all trading strategies\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852628542Z\u001b[0m [INFO] BACKTESTER-001.TWAPExecAlgorithm: DISPOSED\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852642154Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: Cleared all execution algorithms\u001b[0m\n",
+ "\u001b[1m2024-09-17T15:22:39.852661046Z\u001b[0m [INFO] BACKTESTER-001.BACKTESTER-001: DISPOSED\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Once done, good practice to dispose of the object if the script continues\n",
+ "engine.dispose()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Create Agent"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import datetime\n",
+ "from functools import partial\n",
+ "from typing import List, Optional\n",
+ "\n",
+ "from nautilus_trader.core.datetime import nanos_to_secs\n",
+ "from nautilus_trader.model.data import Bar, BarType, BarSpecification\n",
+ "from nautilus_trader.model.enums import AggregationSource\n",
+ "from nautilus_trader.model.identifiers import InstrumentId\n",
+ "from nautilus_trader.model.data import DataType\n",
+ "\n",
+ "from nautilus_trader.common.actor import Actor, ActorConfig\n",
+ "from nautilus_trader.common.enums import LogColor\n",
+ "from nautilus_trader.core.data import Data\n",
+ "from nautilus_trader.core.datetime import secs_to_nanos, unix_nanos_to_dt\n",
+ "from sklearn.linear_model import LinearRegression\n",
+ "from sklearn.metrics import r2_score\n",
+ "\n",
+ "# OrderSideParser\n",
+ "\n",
+ "import gymnasium as gym\n",
+ "\n",
+ "from stable_baselines3 import PPO"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "\n",
+ "\n",
+ "from nautilus_trader.config import StrategyConfig\n",
+ "from nautilus_trader.core.data import Data\n",
+ "from nautilus_trader.core.datetime import unix_nanos_to_dt\n",
+ "from nautilus_trader.core.message import Event\n",
+ "from nautilus_trader.model.enums import OrderSide, PositionSide, TimeInForce\n",
+ "from nautilus_trader.model.events.position import (\n",
+ " PositionChanged,\n",
+ " PositionClosed,\n",
+ " PositionEvent,\n",
+ " PositionOpened,\n",
+ ")\n",
+ "from nautilus_trader.model.identifiers import InstrumentId, PositionId\n",
+ "from nautilus_trader.model.objects import Price, Quantity\n",
+ "from nautilus_trader.model.position import Position\n",
+ "from nautilus_trader.trading.strategy import Strategy\n",
+ "\n",
+ "from nautilus_trader.model.functions import order_side_to_str"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Agents can extend actors \n",
+ "\n",
+ "class AgentConfig(ActorConfig):\n",
+ " source_symbol: str\n",
+ " target_symbol: str\n",
+ " bar_spec: str = \"10-SECOND-LAST\"\n",
+ " min_model_timedelta: str = \"1D\"\n",
+ "\n",
+ "\n",
+ "class Agent(Actor):\n",
+ " def __init__(self, config: AgentConfig):\n",
+ " super().__init__(config=config)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# iterations = 200\n",
+ "\n",
+ "# env = gym.make(\"CartPole-v1\", render_mode=\"human\")\n",
+ "\n",
+ "# model = PPO(\"MlpPolicy\", env, verbose=1)\n",
+ "# model.learn(total_timesteps=10_000)\n",
+ "\n",
+ "# vec_env = model.get_env()\n",
+ "# obs = vec_env.reset()\n",
+ "# for i in range(iterations):\n",
+ "# action, _states = model.predict(obs, deterministic=True)\n",
+ "# obs, reward, done, info = vec_env.step(action)\n",
+ "# vec_env.render()\n",
+ "# # VecEnv resets automatically\n",
+ "# # if done:\n",
+ "# # obs = env.reset()\n",
+ "\n",
+ "# env.close()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Supervised Learning"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 101,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Dividends | \n",
+ " Stock Splits | \n",
+ "
\n",
+ " \n",
+ " Date | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2014-03-27 00:00:00-04:00 | \n",
+ " 0.0 | \n",
+ " 2.002000 | \n",
+ "
\n",
+ " \n",
+ " 2015-04-27 00:00:00-04:00 | \n",
+ " 0.0 | \n",
+ " 1.002746 | \n",
+ "
\n",
+ " \n",
+ " 2022-07-18 00:00:00-04:00 | \n",
+ " 0.0 | \n",
+ " 20.000000 | \n",
+ "
\n",
+ " \n",
+ " 2024-06-10 00:00:00-04:00 | \n",
+ " 0.2 | \n",
+ " 0.000000 | \n",
+ "
\n",
+ " \n",
+ " 2024-09-09 00:00:00-04:00 | \n",
+ " 0.2 | \n",
+ " 0.000000 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Dividends Stock Splits\n",
+ "Date \n",
+ "2014-03-27 00:00:00-04:00 0.0 2.002000\n",
+ "2015-04-27 00:00:00-04:00 0.0 1.002746\n",
+ "2022-07-18 00:00:00-04:00 0.0 20.000000\n",
+ "2024-06-10 00:00:00-04:00 0.2 0.000000\n",
+ "2024-09-09 00:00:00-04:00 0.2 0.000000"
+ ]
+ },
+ "execution_count": 101,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "import yfinance as yf"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 105,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "[*********************100%***********************] 1 of 1 completed\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Open | \n",
+ " High | \n",
+ " Low | \n",
+ " Close | \n",
+ " Adj Close | \n",
+ " Volume | \n",
+ "
\n",
+ " \n",
+ " Date | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2020-01-02 | \n",
+ " 71.894997 | \n",
+ " 72.470001 | \n",
+ " 71.654999 | \n",
+ " 72.339996 | \n",
+ " 70.230347 | \n",
+ " 5200400 | \n",
+ "
\n",
+ " \n",
+ " 2020-01-03 | \n",
+ " 71.275002 | \n",
+ " 71.714996 | \n",
+ " 70.940002 | \n",
+ " 71.154999 | \n",
+ " 69.079903 | \n",
+ " 9963600 | \n",
+ "
\n",
+ " \n",
+ " 2020-01-06 | \n",
+ " 70.254997 | \n",
+ " 70.565002 | \n",
+ " 69.885002 | \n",
+ " 70.394997 | \n",
+ " 68.342064 | \n",
+ " 6514000 | \n",
+ "
\n",
+ " \n",
+ " 2020-01-07 | \n",
+ " 71.120003 | \n",
+ " 71.824997 | \n",
+ " 70.699997 | \n",
+ " 71.570000 | \n",
+ " 69.482811 | \n",
+ " 6526000 | \n",
+ "
\n",
+ " \n",
+ " 2020-01-08 | \n",
+ " 71.565002 | \n",
+ " 72.055000 | \n",
+ " 71.260002 | \n",
+ " 71.690002 | \n",
+ " 69.599297 | \n",
+ " 6112800 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2020-12-24 | \n",
+ " 106.599998 | \n",
+ " 107.455002 | \n",
+ " 106.599998 | \n",
+ " 107.434998 | \n",
+ " 105.028305 | \n",
+ " 1142800 | \n",
+ "
\n",
+ " \n",
+ " 2020-12-28 | \n",
+ " 108.639999 | \n",
+ " 108.745003 | \n",
+ " 107.120003 | \n",
+ " 107.220001 | \n",
+ " 104.818123 | \n",
+ " 2445600 | \n",
+ "
\n",
+ " \n",
+ " 2020-12-29 | \n",
+ " 107.839996 | \n",
+ " 107.894997 | \n",
+ " 105.959999 | \n",
+ " 106.949997 | \n",
+ " 104.554169 | \n",
+ " 4497600 | \n",
+ "
\n",
+ " \n",
+ " 2020-12-30 | \n",
+ " 107.574997 | \n",
+ " 109.050003 | \n",
+ " 107.574997 | \n",
+ " 108.925003 | \n",
+ " 106.484932 | \n",
+ " 2108800 | \n",
+ "
\n",
+ " \n",
+ " 2020-12-31 | \n",
+ " 108.980003 | \n",
+ " 109.269997 | \n",
+ " 108.135002 | \n",
+ " 109.209999 | \n",
+ " 106.763542 | \n",
+ " 2863000 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
253 rows × 6 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Open High Low Close Adj Close \\\n",
+ "Date \n",
+ "2020-01-02 71.894997 72.470001 71.654999 72.339996 70.230347 \n",
+ "2020-01-03 71.275002 71.714996 70.940002 71.154999 69.079903 \n",
+ "2020-01-06 70.254997 70.565002 69.885002 70.394997 68.342064 \n",
+ "2020-01-07 71.120003 71.824997 70.699997 71.570000 69.482811 \n",
+ "2020-01-08 71.565002 72.055000 71.260002 71.690002 69.599297 \n",
+ "... ... ... ... ... ... \n",
+ "2020-12-24 106.599998 107.455002 106.599998 107.434998 105.028305 \n",
+ "2020-12-28 108.639999 108.745003 107.120003 107.220001 104.818123 \n",
+ "2020-12-29 107.839996 107.894997 105.959999 106.949997 104.554169 \n",
+ "2020-12-30 107.574997 109.050003 107.574997 108.925003 106.484932 \n",
+ "2020-12-31 108.980003 109.269997 108.135002 109.209999 106.763542 \n",
+ "\n",
+ " Volume \n",
+ "Date \n",
+ "2020-01-02 5200400 \n",
+ "2020-01-03 9963600 \n",
+ "2020-01-06 6514000 \n",
+ "2020-01-07 6526000 \n",
+ "2020-01-08 6112800 \n",
+ "... ... \n",
+ "2020-12-24 1142800 \n",
+ "2020-12-28 2445600 \n",
+ "2020-12-29 4497600 \n",
+ "2020-12-30 2108800 \n",
+ "2020-12-31 2863000 \n",
+ "\n",
+ "[253 rows x 6 columns]"
+ ]
+ },
+ "execution_count": 105,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "smh_data = yf.download(\"SMH\", start=\"2020-01-01\", end=\"2021-01-01\")\n",
+ "smh_data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 106,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "[*********************100%***********************] 1 of 1 completed\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Open | \n",
+ " High | \n",
+ " Low | \n",
+ " Close | \n",
+ " Adj Close | \n",
+ " Volume | \n",
+ "
\n",
+ " \n",
+ " Date | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2020-01-02 | \n",
+ " 84.753334 | \n",
+ " 85.430000 | \n",
+ " 84.333336 | \n",
+ " 85.430000 | \n",
+ " 81.918747 | \n",
+ " 1275300 | \n",
+ "
\n",
+ " \n",
+ " 2020-01-03 | \n",
+ " 84.113335 | \n",
+ " 84.570000 | \n",
+ " 83.653336 | \n",
+ " 83.836670 | \n",
+ " 80.390915 | \n",
+ " 1235100 | \n",
+ "
\n",
+ " \n",
+ " 2020-01-06 | \n",
+ " 82.783333 | \n",
+ " 83.230003 | \n",
+ " 82.419998 | \n",
+ " 82.963333 | \n",
+ " 79.553459 | \n",
+ " 1615200 | \n",
+ "
\n",
+ " \n",
+ " 2020-01-07 | \n",
+ " 83.996666 | \n",
+ " 84.823334 | \n",
+ " 83.500000 | \n",
+ " 84.489998 | \n",
+ " 81.017380 | \n",
+ " 1146600 | \n",
+ "
\n",
+ " \n",
+ " 2020-01-08 | \n",
+ " 84.656670 | \n",
+ " 84.983330 | \n",
+ " 84.053329 | \n",
+ " 84.413330 | \n",
+ " 80.943855 | \n",
+ " 1297800 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2020-12-24 | \n",
+ " 123.930000 | \n",
+ " 124.430000 | \n",
+ " 123.556664 | \n",
+ " 124.373337 | \n",
+ " 120.611725 | \n",
+ " 574200 | \n",
+ "
\n",
+ " \n",
+ " 2020-12-28 | \n",
+ " 125.833336 | \n",
+ " 125.900002 | \n",
+ " 124.053329 | \n",
+ " 124.236664 | \n",
+ " 120.479195 | \n",
+ " 1108500 | \n",
+ "
\n",
+ " \n",
+ " 2020-12-29 | \n",
+ " 124.876663 | \n",
+ " 124.876663 | \n",
+ " 122.543335 | \n",
+ " 123.916664 | \n",
+ " 120.168869 | \n",
+ " 1334700 | \n",
+ "
\n",
+ " \n",
+ " 2020-12-30 | \n",
+ " 124.603333 | \n",
+ " 126.203331 | \n",
+ " 124.486664 | \n",
+ " 125.993332 | \n",
+ " 122.182716 | \n",
+ " 1159800 | \n",
+ "
\n",
+ " \n",
+ " 2020-12-31 | \n",
+ " 126.123337 | \n",
+ " 126.589996 | \n",
+ " 125.206665 | \n",
+ " 126.393333 | \n",
+ " 122.570633 | \n",
+ " 1193100 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
253 rows × 6 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Open High Low Close Adj Close \\\n",
+ "Date \n",
+ "2020-01-02 84.753334 85.430000 84.333336 85.430000 81.918747 \n",
+ "2020-01-03 84.113335 84.570000 83.653336 83.836670 80.390915 \n",
+ "2020-01-06 82.783333 83.230003 82.419998 82.963333 79.553459 \n",
+ "2020-01-07 83.996666 84.823334 83.500000 84.489998 81.017380 \n",
+ "2020-01-08 84.656670 84.983330 84.053329 84.413330 80.943855 \n",
+ "... ... ... ... ... ... \n",
+ "2020-12-24 123.930000 124.430000 123.556664 124.373337 120.611725 \n",
+ "2020-12-28 125.833336 125.900002 124.053329 124.236664 120.479195 \n",
+ "2020-12-29 124.876663 124.876663 122.543335 123.916664 120.168869 \n",
+ "2020-12-30 124.603333 126.203331 124.486664 125.993332 122.182716 \n",
+ "2020-12-31 126.123337 126.589996 125.206665 126.393333 122.570633 \n",
+ "\n",
+ " Volume \n",
+ "Date \n",
+ "2020-01-02 1275300 \n",
+ "2020-01-03 1235100 \n",
+ "2020-01-06 1615200 \n",
+ "2020-01-07 1146600 \n",
+ "2020-01-08 1297800 \n",
+ "... ... \n",
+ "2020-12-24 574200 \n",
+ "2020-12-28 1108500 \n",
+ "2020-12-29 1334700 \n",
+ "2020-12-30 1159800 \n",
+ "2020-12-31 1193100 \n",
+ "\n",
+ "[253 rows x 6 columns]"
+ ]
+ },
+ "execution_count": 106,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "soxx_data = yf.download(\"SOXX\", start=\"2020-01-01\", end=\"2021-01-01\")\n",
+ "soxx_data"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Pairs Trading Analysis\n",
+ "\n",
+ "#### Premise\n",
+ "- Two (or more) assets prices are related in some way\n",
+ "- Their prices typically move together\n",
+ "- Opportunities arise when one assert deviates from the relationship\n",
+ "- Buy one, sell the other with the expectation they will return to their relationship at some point in the future\n",
+ "\n",
+ "#### Benefits\n",
+ "- Applicable to a wide range of markets & assets\n",
+ "- market neutral (if the market suddenly tanks, don't lose money)\n",
+ "\n",
+ "#### Challenges\n",
+ "- Modelling the relationship (drifting pairs)\n",
+ "- Transaction costs\n",
+ "- Getting \"legged\"\n",
+ "\n",
+ "#### Example\n",
+ "- Two semiconductor ETFs `SMH` (VanEck Semiconductor ETF) and `SOXX` (iShares Semiconductor ETF)\n",
+ "- Fundamental reasons for a relationship (both ETFs of similar stocks)\n",
+ "- Visual analysis of price series confirms belief of relationship"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 99,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def make_bar_type(instrument_id: InstrumentId, bar_spec) -> BarType:\n",
+ " return BarType(instrument_id=instrument_id, bar_spec=bar_spec, aggregation_source=AggregationSource.EXTERNAL)\n",
+ "\n",
+ "\n",
+ "def one(iterable):\n",
+ " if len(iterable) == 0:\n",
+ " return None\n",
+ " elif len(iterable) > 1:\n",
+ " raise AssertionError(\"Too many values\")\n",
+ " else:\n",
+ " return iterable[0]\n",
+ "\n",
+ "\n",
+ "def bars_to_dataframe(source_id: str, source_bars: List[Bar], target_id: str, target_bars: List[Bar]) -> pd.DataFrame:\n",
+ " def _bars_to_frame(bars, instrument_id):\n",
+ " df = pd.DataFrame([t.to_dict(t) for t in bars]).astype({\"close\": float})\n",
+ " return df.assign(instrument_id=instrument_id).set_index([\"instrument_id\", \"ts_init\"])\n",
+ "\n",
+ " ldf = _bars_to_frame(bars=source_bars, instrument_id=source_id)\n",
+ " rdf = _bars_to_frame(bars=target_bars, instrument_id=target_id)\n",
+ " data = pd.concat([ldf, rdf])[\"close\"].unstack(0).sort_index().fillna(method=\"ffill\")\n",
+ " return data.dropna()\n",
+ "\n",
+ "\n",
+ "def human_readable_duration(ns: float):\n",
+ " from dateutil.relativedelta import relativedelta # type: ignore\n",
+ "\n",
+ " seconds = nanos_to_secs(ns)\n",
+ " delta = relativedelta(seconds=seconds)\n",
+ " attrs = [\"months\", \"days\", \"hours\", \"minutes\", \"seconds\"]\n",
+ " return \", \".join(\n",
+ " [\n",
+ " f\"{getattr(delta, attr)} {attr if getattr(delta, attr) > 1 else attr[:-1]}\"\n",
+ " for attr in attrs\n",
+ " if getattr(delta, attr)\n",
+ " ]\n",
+ " )\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import datetime\n",
+ "import pandas as pd\n",
+ "import hvplot.pandas\n",
+ "import holoviews as hv\n",
+ "\n",
+ "# from demo.backtest import CATALOG as catalog\n",
+ "# from demo.util import bars_to_dataframe"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Load pre-loaded sample data from nautilus DataCatalog\n",
+ "src_id = 'SMH.NASDAQ'\n",
+ "tgt_id = 'SOXX.NASDAQ'\n",
+ "src = catalog.bars(instrument_ids=[src_id], start=pd.Timestamp('2020-01-01'), end=pd.Timestamp('2020-01-10'), as_nautilus=True)\n",
+ "tgt = catalog.bars(instrument_ids=[tgt_id], start=pd.Timestamp('2020-01-01'), end=pd.Timestamp('2020-01-10'), as_nautilus=True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Merge into single Dataframe for convenience, filter for market hours only\n",
+ "df = bars_to_dataframe(source_id=src_id, source_bars=src, target_id=tgt_id, target_bars=tgt)\n",
+ "df.index = pd.to_datetime(df.index)\n",
+ "df = df.between_time(datetime.time(14, 30), datetime.time(21,0))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# View scatter plot of SMH vs SOXX\n",
+ "df.pct_change().cumsum().hvplot.step(y=[src_id, tgt_id], title=f\"Time Series {src_id} vs {tgt_id}\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# View scatter plot of SMH vs SOXX\n",
+ "df.hvplot.scatter(x=src_id, y=tgt_id, title=f\"Price Scatter {src_id} vs {tgt_id}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Setup Nautilus Trader Node"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Linear Regression Model"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "class ModelUpdate(Data):\n",
+ " def __init__(\n",
+ " self,\n",
+ " model: LinearRegression,\n",
+ " hedge_ratio: float,\n",
+ " std_prediction: float,\n",
+ " ts_init: int,\n",
+ " ):\n",
+ " super().__init__(ts_init=ts_init, ts_event=ts_init)\n",
+ " self.model = model\n",
+ " self.hedge_ratio = hedge_ratio\n",
+ " self.std_prediction = std_prediction\n",
+ "\n",
+ "\n",
+ "class Prediction(Data):\n",
+ " def __init__(\n",
+ " self,\n",
+ " instrument_id: str,\n",
+ " prediction: float,\n",
+ " ts_init: int,\n",
+ " ):\n",
+ " super().__init__(ts_init=ts_init, ts_event=ts_init)\n",
+ " self.instrument_id = instrument_id\n",
+ " self.prediction = prediction\n",
+ "\n",
+ "class PredictedPriceConfig(ActorConfig):\n",
+ " source_symbol: str\n",
+ " target_symbol: str\n",
+ " bar_spec: str = \"10-SECOND-LAST\"\n",
+ " min_model_timedelta: str = \"1D\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "\n",
+ "class PredictedPriceActor(Actor):\n",
+ " def __init__(self, config: PredictedPriceConfig):\n",
+ " super().__init__(config=config)\n",
+ "\n",
+ " self.source_id = InstrumentId.from_str(config.source_symbol)\n",
+ " self.target_id = InstrumentId.from_str(config.target_symbol)\n",
+ " self.bar_spec = BarSpecification.from_str(self.config.bar_spec)\n",
+ " self.model: Optional[LinearRegression] = None\n",
+ " self.hedge_ratio: Optional[float] = None\n",
+ " self._min_model_timedelta = secs_to_nanos(pd.Timedelta(self.config.min_model_timedelta).total_seconds())\n",
+ " self._last_model = pd.Timestamp(0)\n",
+ "\n",
+ " def on_start(self):\n",
+ " # Set instruments\n",
+ " self.left = self.cache.instrument(self.source_id)\n",
+ " self.right = self.cache.instrument(self.target_id)\n",
+ "\n",
+ " # Subscribe to bars\n",
+ " self.subscribe_bars(make_bar_type(instrument_id=self.source_id, bar_spec=self.bar_spec))\n",
+ " self.subscribe_bars(make_bar_type(instrument_id=self.target_id, bar_spec=self.bar_spec))\n",
+ "\n",
+ " def on_bar(self, bar: Bar):\n",
+ " self._check_model_fit(bar)\n",
+ " self._predict(bar)\n",
+ "\n",
+ " @property\n",
+ " def data_length_valid(self) -> bool:\n",
+ " return self._check_first_tick(self.source_id) and self._check_first_tick(self.target_id)\n",
+ "\n",
+ " @property\n",
+ " def has_fit_model_today(self):\n",
+ " return unix_nanos_to_dt(self.clock.timestamp_ns()).date() == self._last_model.date()\n",
+ "\n",
+ " def _check_first_tick(self, instrument_id) -> bool:\n",
+ " \"\"\"Check we have enough bar data for this `instrument_id`, according to `min_model_timedelta`\"\"\"\n",
+ " bars = self.cache.bars(bar_type=make_bar_type(instrument_id, bar_spec=self.bar_spec))\n",
+ " if not bars:\n",
+ " return False\n",
+ " delta = self.clock.timestamp_ns() - bars[-1].ts_init\n",
+ " return delta > self._min_model_timedelta\n",
+ "\n",
+ " def _check_model_fit(self, bar: Bar):\n",
+ " # Check we have the minimum required data\n",
+ " if not self.data_length_valid:\n",
+ " return\n",
+ "\n",
+ " # Check we haven't fit a model yet today\n",
+ " if self.has_fit_model_today:\n",
+ " return\n",
+ "\n",
+ " # Generate a dataframe from cached bar data\n",
+ " df = bars_to_dataframe(\n",
+ " source_id=self.source_id.value,\n",
+ " source_bars=self.cache.bars(bar_type=make_bar_type(self.source_id, bar_spec=self.bar_spec)),\n",
+ " target_id=self.target_id.value,\n",
+ " target_bars=self.cache.bars(bar_type=make_bar_type(self.target_id, bar_spec=self.bar_spec)),\n",
+ " )\n",
+ "\n",
+ " # Format the arrays for scikit-learn\n",
+ " X = df.loc[:, self.source_id.value].astype(float).values.reshape(-1, 1)\n",
+ " Y = df.loc[:, self.target_id.value].astype(float).values.reshape(-1, 1)\n",
+ "\n",
+ " # Fit a model\n",
+ " self.model = LinearRegression(fit_intercept=False)\n",
+ " self.model.fit(X, Y)\n",
+ " self.log.info(\n",
+ " f\"Fit model @ {unix_nanos_to_dt(bar.ts_init)}, r2: {r2_score(Y, self.model.predict(X))}\",\n",
+ " color=LogColor.BLUE,\n",
+ " )\n",
+ " self._last_model = unix_nanos_to_dt(bar.ts_init)\n",
+ "\n",
+ " # Record std dev of predictions (used for scaling our order price)\n",
+ " pred = self.model.predict(X)\n",
+ " errors = pred - Y\n",
+ " std_pred = errors.std()\n",
+ "\n",
+ " # The model slope is our hedge ratio (the ratio of source\n",
+ " self.hedge_ratio = float(self.model.coef_[0][0])\n",
+ " self.log.info(f\"Computed hedge_ratio={self.hedge_ratio:0.4f}\", color=LogColor.BLUE)\n",
+ "\n",
+ " # Publish model\n",
+ " model_update = ModelUpdate(\n",
+ " model=self.model, hedge_ratio=self.hedge_ratio, std_prediction=std_pred, ts_init=bar.ts_init\n",
+ " )\n",
+ " self.publish_data(\n",
+ " data_type=DataType(ModelUpdate, metadata={\"instrument_id\": self.target_id.value}), data=model_update\n",
+ " )\n",
+ "\n",
+ " def _predict(self, bar: Bar):\n",
+ " if self.model is not None and bar.bar_type.instrument_id == self.source_id:\n",
+ " pred = self.model.predict([[bar.close]])[0][0]\n",
+ " prediction = Prediction(instrument_id=self.target_id, prediction=pred, ts_init=bar.ts_init)\n",
+ " self.publish_data(\n",
+ " data_type=DataType(Prediction, metadata={\"instrument_id\": self.target_id.value}), data=prediction\n",
+ " )\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Strategy"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "class PairTraderConfig(StrategyConfig):\n",
+ " source_symbol: str\n",
+ " target_symbol: str\n",
+ " notional_trade_size_usd: int = 10_000\n",
+ " min_model_timedelta: datetime.timedelta = datetime.timedelta(days=1)\n",
+ " trade_width_std_dev: float = 2.5\n",
+ " bar_spec: str = \"10-SECOND-LAST\"\n",
+ " ib_long_short_margin_requirement = (0.25 + 0.17) / 2.0\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "class PairTrader(Strategy):\n",
+ " def __init__(self, config: PairTraderConfig):\n",
+ " super().__init__(config=config)\n",
+ " self.source_id = InstrumentId.from_str(config.source_symbol)\n",
+ " self.target_id = InstrumentId.from_str(config.target_symbol)\n",
+ " self.model: Optional[ModelUpdate] = None\n",
+ " self.hedge_ratio: Optional[float] = None\n",
+ " self.std_pred: Optional[float] = None\n",
+ " self.prediction: Optional[float] = None\n",
+ " self._current_edge: float = 0.0\n",
+ " self._current_required_edge: float = 0.0\n",
+ " self.bar_spec = BarSpecification.from_str(self.config.bar_spec)\n",
+ " self._summarised: set = set()\n",
+ " self._position_id: int = 0\n",
+ "\n",
+ " def on_start(self):\n",
+ " # Set instruments\n",
+ " self.source = self.cache.instrument(self.source_id)\n",
+ " self.target = self.cache.instrument(self.target_id)\n",
+ "\n",
+ " # Subscribe to bars\n",
+ " self.subscribe_bars(make_bar_type(instrument_id=self.source_id, bar_spec=self.bar_spec))\n",
+ " self.subscribe_bars(make_bar_type(instrument_id=self.target_id, bar_spec=self.bar_spec))\n",
+ "\n",
+ " # Subscribe to model and predictions\n",
+ " self.subscribe_data(data_type=DataType(ModelUpdate, metadata={\"instrument_id\": self.target_id.value}))\n",
+ " self.subscribe_data(data_type=DataType(Prediction, metadata={\"instrument_id\": self.target_id.value}))\n",
+ "\n",
+ " def on_bar(self, bar: Bar):\n",
+ " self._update_theoretical()\n",
+ " self._check_for_entry(bar)\n",
+ " self._check_for_exit(timer=None, bar=bar)\n",
+ "\n",
+ " def on_data(self, data: Data):\n",
+ " if isinstance(data, ModelUpdate):\n",
+ " self._on_model_update(data)\n",
+ " elif isinstance(data, Prediction):\n",
+ " self._on_prediction(data)\n",
+ " else:\n",
+ " raise TypeError()\n",
+ "\n",
+ " def on_event(self, event: Event):\n",
+ " self._check_for_hedge(timer=None, event=event)\n",
+ " if isinstance(event, (PositionOpened, PositionChanged)):\n",
+ " position = self.cache.position(event.position_id)\n",
+ " self._log.info(f\"{position}\", color=LogColor.YELLOW)\n",
+ " assert position.quantity < 200 # Runtime check for bug in code\n",
+ "\n",
+ " def _on_model_update(self, model_update: ModelUpdate):\n",
+ " self.model = model_update.model\n",
+ " self.hedge_ratio = model_update.hedge_ratio\n",
+ " self.std_pred = model_update.std_prediction\n",
+ "\n",
+ " def _on_prediction(self, prediction: Prediction):\n",
+ " self.prediction = prediction.prediction\n",
+ " self._update_theoretical()\n",
+ "\n",
+ " def _update_theoretical(self):\n",
+ " \"\"\"We've either received an update Bar market or a new prediction, update our `current_edge`\"\"\"\n",
+ " if not self.prediction:\n",
+ " return\n",
+ "\n",
+ " quote_right: Bar = self.cache.bar(make_bar_type(self.target_id, bar_spec=self.bar_spec))\n",
+ " if not quote_right:\n",
+ " return\n",
+ "\n",
+ " self._current_edge = 0\n",
+ " close_target = quote_right.close\n",
+ " if (self.prediction - close_target) > 0:\n",
+ " self._current_edge = self.prediction - close_target\n",
+ " elif (close_target - self.prediction) > 0:\n",
+ " self._current_edge = close_target - self.prediction\n",
+ "\n",
+ " def _check_for_entry(self, bar: Bar):\n",
+ " if bar.bar_type.instrument_id == self.target_id and self.prediction is not None:\n",
+ " # Send in orders\n",
+ " quote_target: Bar = self.cache.bar(make_bar_type(self.target_id, bar_spec=self.bar_spec))\n",
+ " if not quote_target:\n",
+ " return\n",
+ "\n",
+ " market_right = quote_target.close\n",
+ " self._current_required_edge = self.std_pred * self.config.trade_width_std_dev\n",
+ "\n",
+ " if self._current_edge > self._current_required_edge:\n",
+ " # Our theoretical price is above the market; we want to buy\n",
+ " side = OrderSide.BUY\n",
+ " max_volume = int(self.config.notional_trade_size_usd / market_right)\n",
+ " capped_volume = self._cap_volume(instrument_id=self.target_id, max_quantity=max_volume)\n",
+ " price = self.prediction - self._current_required_edge\n",
+ " self._log.debug(f\"{side} {max_volume=} {capped_volume=} {price=}\")\n",
+ " elif self._current_edge < -self._current_required_edge:\n",
+ " # Our theoretical price is below the market; we want to sell\n",
+ " side = OrderSide.SELL\n",
+ " max_volume = int(self.config.notional_trade_size_usd / market_right)\n",
+ " capped_volume = self._cap_volume(instrument_id=self.target_id, max_quantity=max_volume)\n",
+ " price = self.prediction + self._current_required_edge\n",
+ " self._log.debug(f\"{side} {max_volume=} {capped_volume=} {price=}\")\n",
+ " else:\n",
+ " return\n",
+ " if capped_volume == 0:\n",
+ " # We're at our max limit, cancel any remaining orders and return\n",
+ " for order in self.cache.orders_open(instrument_id=self.target_id, strategy_id=self.id):\n",
+ " self.cancel_order(order=order)\n",
+ " return\n",
+ " self._log.info(\n",
+ " f\"Entry opportunity: {side} market={market_right}, \"\n",
+ " f\"theo={self.prediction:0.3f} {capped_volume=} ({self._current_edge=:0.3f}, \"\n",
+ " f\"{self._current_required_edge=:0.3f})\",\n",
+ " color=LogColor.GREEN,\n",
+ " )\n",
+ " # Cancel any existing orders\n",
+ " for order in self.cache.orders_open(instrument_id=self.target_id, strategy_id=self.id):\n",
+ " self.cancel_order(order=order)\n",
+ " order = self.order_factory.limit(\n",
+ " instrument_id=self.target_id,\n",
+ " order_side=side,\n",
+ " price=Price(price, self.target.price_precision),\n",
+ " quantity=Quantity.from_int(capped_volume),\n",
+ " time_in_force=TimeInForce.IOC,\n",
+ " )\n",
+ " self._log.info(f\"ENTRY {order.info()}\", color=LogColor.BLUE)\n",
+ " self.submit_order(order, PositionId(f\"target-{self._position_id}\"))\n",
+ "\n",
+ " def _cap_volume(self, instrument_id: InstrumentId, max_quantity: int) -> int:\n",
+ " position_quantity = 0\n",
+ " position = self.current_position(instrument_id)\n",
+ " if position is not None:\n",
+ " position_quantity = position.quantity\n",
+ " return max(0, max_quantity - position_quantity)\n",
+ "\n",
+ " def _check_for_hedge(self, timer=None, event: Optional[Event] = None):\n",
+ " if not ((isinstance(event, (PositionEvent,)) and event.instrument_id == self.target_id)):\n",
+ " return\n",
+ "\n",
+ " timer_name = f\"hedge-{self.id}\"\n",
+ " try:\n",
+ " self._hedge_position(event)\n",
+ " # Keep scheduling this method to run until we're hedged\n",
+ " if timer_name in self.clock.timer_names:\n",
+ " self.clock.cancel_timer(timer_name)\n",
+ " self.clock.set_time_alert(\n",
+ " name=timer_name,\n",
+ " alert_time=self.clock.utc_now() + pd.Timedelta(seconds=2),\n",
+ " callback=partial(self._check_for_hedge, event=event),\n",
+ " )\n",
+ " except RepeatedEventComplete:\n",
+ " # Hedge is complete, return\n",
+ " if timer_name in self.clock.timer_names:\n",
+ " self.clock.cancel_timer(timer_name)\n",
+ " return\n",
+ "\n",
+ " def _hedge_position(self, event: PositionEvent):\n",
+ " # We've opened or changed position in our source instrument, we will likely need to hedge.\n",
+ " target_position = self.cache.position(event.position_id)\n",
+ " hedge_quantity = int(round(target_position.quantity * self.hedge_ratio, 0))\n",
+ " quantity = 0\n",
+ " if isinstance(event, PositionClosed):\n",
+ " # (possibly) Reducing our position in the target instrument\n",
+ " source_position: Position = self.current_position(self.source_id)\n",
+ " if source_position is not None and source_position.is_closed:\n",
+ " if source_position.id.value not in self._summarised:\n",
+ " self._summarise_position()\n",
+ " self._position_id += 1\n",
+ " quantity = source_position.quantity\n",
+ " side = self._opposite_side(source_position.side)\n",
+ " else:\n",
+ " # (possibly) Increasing our position in hedge instrument\n",
+ " side = self._opposite_side(target_position.side)\n",
+ " quantity = self._cap_volume(instrument_id=self.source_id, max_quantity=hedge_quantity)\n",
+ "\n",
+ " if quantity == 0:\n",
+ " # Fully hedged, cancel any existing orders\n",
+ " for order in self.cache.orders_open(instrument_id=self.source_id, strategy_id=self.id):\n",
+ " self.cancel_order(order=order)\n",
+ " raise RepeatedEventComplete\n",
+ " elif self.cache.orders_inflight(instrument_id=self.source_id, strategy_id=self.id):\n",
+ " # Don't send more orders if we have some currently in-flight\n",
+ " return\n",
+ "\n",
+ " # Cancel any existing orders\n",
+ " for order in self.cache.orders_open(instrument_id=self.source_id, strategy_id=self.id):\n",
+ " self.cancel_order(order=order)\n",
+ " order = self.order_factory.market(\n",
+ " instrument_id=self.source_id,\n",
+ " order_side=side,\n",
+ " quantity=Quantity.from_int(quantity),\n",
+ " )\n",
+ " self._log.info(f\"ENTRY HEDGE {order.info()}\", color=LogColor.BLUE)\n",
+ " self.submit_order(order, PositionId(f\"source-{self._position_id}\"))\n",
+ " return order\n",
+ "\n",
+ " def _check_for_exit(self, timer=None, bar: Optional[Bar] = None):\n",
+ " if not self.cache.positions(strategy_id=self.id):\n",
+ " return\n",
+ "\n",
+ " # Keep checking that we have successfully got a hedge\n",
+ " timer_name = f\"exit-{self.id}\"\n",
+ " try:\n",
+ " self._exit_position(bar=bar)\n",
+ " # Keep scheduling this method to run until we're exited\n",
+ " if timer_name in self.clock.timer_names:\n",
+ " self.clock.cancel_timer(timer_name)\n",
+ " self.clock.set_time_alert(\n",
+ " name=timer_name,\n",
+ " alert_time=self.clock.utc_now() + pd.Timedelta(seconds=2),\n",
+ " callback=partial(self._check_for_exit, bar=bar),\n",
+ " )\n",
+ " except RepeatedEventComplete:\n",
+ " # Hedge is complete, return\n",
+ " if timer_name in self.clock.timer_names:\n",
+ " self.clock.cancel_timer(timer_name)\n",
+ " return\n",
+ "\n",
+ " def _exit_position(self, bar: Bar):\n",
+ " position: Position = self.current_position(self.target_id)\n",
+ " if position is not None:\n",
+ " if position.is_closed:\n",
+ " raise RepeatedEventComplete()\n",
+ " if self._current_edge < (self._current_required_edge * 0.25):\n",
+ " if self.cache.orders_inflight(instrument_id=self.target_id, strategy_id=self.id):\n",
+ " # Order currently in-flight, don't send again\n",
+ " return\n",
+ " self._log.info(\n",
+ " f\"Trigger to close position {self._current_edge=:0.3f} {self._current_required_edge=:0.3f} (* 0.25)\",\n",
+ " color=LogColor.CYAN,\n",
+ " )\n",
+ " # We're close back to fair value, we should try and close our position\n",
+ " order = self.order_factory.market(\n",
+ " instrument_id=self.target_id,\n",
+ " order_side=self._opposite_side(position.side),\n",
+ " quantity=position.quantity,\n",
+ " )\n",
+ " self._log.info(f\"CLOSE {order.info()}\", color=LogColor.BLUE)\n",
+ " self.submit_order(order, PositionId(f\"target-{self._position_id}\"))\n",
+ "\n",
+ " def current_position(self, instrument_id: InstrumentId) -> Optional[Position]:\n",
+ " try:\n",
+ " side = {self.source_id: \"source\", self.target_id: \"target\"}[instrument_id]\n",
+ " return self.cache.position(PositionId(f\"{side}-{self._position_id}\"))\n",
+ " except AssertionError:\n",
+ " return None\n",
+ "\n",
+ " def _opposite_side(self, side: PositionSide):\n",
+ " return {PositionSide.LONG: OrderSide.SELL, PositionSide.SHORT: OrderSide.BUY, PositionSide.FLAT: None}[side]\n",
+ "\n",
+ " def _summarise_position(self):\n",
+ " src_pos: Position = self.current_position(instrument_id=self.source_id)\n",
+ " tgt_pos: Position = self.current_position(instrument_id=self.target_id)\n",
+ " self.log.warning(\"Hedge summary:\", color=LogColor.BLUE)\n",
+ " self.log.warning(\n",
+ " f\"target: {order_side_to_str(tgt_pos.events[0].order_side)} {tgt_pos.peak_qty}, \"\n",
+ " f\"{tgt_pos.avg_px_open=}, {tgt_pos.avg_px_close=}, {tgt_pos.realized_return=:0.4f}\",\n",
+ " color=LogColor.NORMAL,\n",
+ " )\n",
+ " self.log.warning(\n",
+ " f\"source: {order_side_to_str(src_pos.events[0].order_side)} {src_pos.peak_qty}, \"\n",
+ " f\"{src_pos.avg_px_open=}, {src_pos.avg_px_close=}, {src_pos.realized_return=:0.4f}\",\n",
+ " color=LogColor.NORMAL,\n",
+ " )\n",
+ "\n",
+ " def peak_notional(pos):\n",
+ " entry_order = self.cache.order(pos.events[0].client_order_id)\n",
+ " return pos.peak_qty * {OrderSide.BUY: 1.0, OrderSide.SELL: -1.0}[entry_order.side] * pos.avg_px_open\n",
+ "\n",
+ " tgt_notional = peak_notional(tgt_pos)\n",
+ " src_notional = peak_notional(src_pos)\n",
+ " margin_requirements = (abs(tgt_notional) + abs(src_notional)) * self.config.ib_long_short_margin_requirement\n",
+ " pnl = src_pos.realized_pnl + tgt_pos.realized_pnl\n",
+ " return_bps = float(pnl) / margin_requirements * 10_000\n",
+ " self.log.warning(\n",
+ " f\"position duration = {human_readable_duration(src_pos.duration_ns)} \"\n",
+ " f\"(opened={unix_nanos_to_dt(src_pos.ts_opened)}, closed={unix_nanos_to_dt(src_pos.ts_closed)}\",\n",
+ " color=LogColor.NORMAL,\n",
+ " )\n",
+ " self.log.warning(\n",
+ " f\"Spread=({tgt_notional:.0f}/{src_notional:.0f}), total_margin_required={margin_requirements:0.1f} \"\n",
+ " f\"PNL=${pnl}, margin_return={return_bps:0.1f}bps\\n\",\n",
+ " color=LogColor.GREEN if pnl > 0 else LogColor.RED,\n",
+ " )\n",
+ "\n",
+ " self._summarised.add(src_pos.id.value)\n",
+ "\n",
+ " def on_stop(self):\n",
+ " self.close_all_positions(self.source_id)\n",
+ " self.close_all_positions(self.target_id)\n",
+ "\n",
+ "\n",
+ "class RepeatedEventComplete(Exception):\n",
+ " pass\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Model Backtest"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import pathlib\n",
+ "from typing import Tuple\n",
+ "\n",
+ "from nautilus_trader.backtest.node import BacktestNode\n",
+ "from nautilus_trader.config import (\n",
+ " CacheConfig,\n",
+ " BacktestDataConfig,\n",
+ " BacktestEngineConfig,\n",
+ " BacktestRunConfig,\n",
+ " BacktestVenueConfig,\n",
+ " ImportableActorConfig,\n",
+ " ImportableStrategyConfig,\n",
+ " RiskEngineConfig,\n",
+ " StreamingConfig,\n",
+ ")\n",
+ "# from nautilus_trader.persistence.catalog import ParquetDataCatalog as DataCatalog\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Load Data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'/home/fortesenselabs/Tech/labs/Financial_Eng/Financial_Markets/lab/trade_flow/examples/notebooks/catalog'"
+ ]
+ },
+ "execution_count": 64,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# nautilus_talks_catalog_path = str(pathlib.Path.cwd().parent.joinpath(\"nautilus_talks/20220617/demo/catalog\"))\n",
+ "nautilus_talks_catalog_path = str(pathlib.Path.cwd().joinpath(\"catalog\"))\n",
+ "nautilus_talks_catalog_path"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 65,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "['data']"
+ ]
+ },
+ "execution_count": 65,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "\n",
+ "os.listdir(nautilus_talks_catalog_path)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 70,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[CurrencyPair(id=EUR/USD.SIM, raw_symbol=EUR/USD, asset_class=FX, instrument_class=SPOT, quote_currency=USD, is_inverse=False, price_precision=5, price_increment=0.00001, size_precision=0, size_increment=1, multiplier=1, lot_size=1000, margin_init=0.03, margin_maint=0.03, maker_fee=0.00002, taker_fee=0.00002, info=None)]"
+ ]
+ },
+ "execution_count": 70,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "\n",
+ "# CATALOG = DataCatalog(str(pathlib.Path(__file__).parent.joinpath(\"catalog\")))\n",
+ "LR_MODEL_DATA_CATALOG = ParquetDataCatalog(nautilus_talks_catalog_path)\n",
+ "\n",
+ "LR_MODEL_DATA_CATALOG.instruments()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Run Model Backtest"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 97,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "\n",
+ "def main(\n",
+ " instrument_ids: Tuple[str, str],\n",
+ " catalog: ParquetDataCatalog,\n",
+ " notional_trade_size_usd: int = 10_000,\n",
+ " start_time: str = None,\n",
+ " end_time: str = None,\n",
+ " log_level: str = \"ERROR\",\n",
+ " bypass_logging: bool = False,\n",
+ " persistence: bool = False,\n",
+ " **strategy_kwargs,\n",
+ "):\n",
+ " # Create model prediction actor\n",
+ " prediction = ImportableActorConfig(\n",
+ " actor_path=\"model:PredictedPriceActor\",\n",
+ " config_path=\"model:PredictedPriceConfig\",\n",
+ " config=dict(\n",
+ " source_symbol=instrument_ids[0],\n",
+ " target_symbol=instrument_ids[1],\n",
+ " ),\n",
+ " )\n",
+ "\n",
+ " # Create strategy\n",
+ " strategy = ImportableStrategyConfig(\n",
+ " strategy_path=\"strategy:PairTrader\",\n",
+ " config_path=\"strategy:PairTraderConfig\",\n",
+ " config=dict(\n",
+ " source_symbol=instrument_ids[0],\n",
+ " target_symbol=instrument_ids[1],\n",
+ " notional_trade_size_usd=notional_trade_size_usd,\n",
+ " **strategy_kwargs,\n",
+ " ),\n",
+ " )\n",
+ "\n",
+ " # Create backtest engine\n",
+ " engine = BacktestEngineConfig(\n",
+ " trader_id=\"BACKTESTER-001\",\n",
+ " cache=CacheConfig(tick_capacity=100_000),\n",
+ " # bypass_logging=bypass_logging,\n",
+ " # log_level=log_level,\n",
+ " streaming=StreamingConfig(catalog_path=str(catalog.path)) if persistence else None,\n",
+ " risk_engine=RiskEngineConfig(max_order_submit_rate=\"1000/00:00:01\"), # type: ignore\n",
+ " strategies=[strategy],\n",
+ " actors=[prediction],\n",
+ " )\n",
+ " venues = [\n",
+ " BacktestVenueConfig(\n",
+ " name=\"SIM\", # \"NASDAQ\"\n",
+ " oms_type=\"NETTING\",\n",
+ " account_type=\"CASH\",\n",
+ " base_currency=\"USD\",\n",
+ " starting_balances=[\"1_000_000 USD\"],\n",
+ " )\n",
+ " ]\n",
+ " print(\"instrument_ids => \", instrument_ids)\n",
+ " data = [\n",
+ " BacktestDataConfig(\n",
+ " data_cls=Bar.fully_qualified_name(),\n",
+ " catalog_path=str(catalog.path),\n",
+ " catalog_fs_protocol=catalog.fs_protocol,\n",
+ " catalog_fs_storage_options=catalog.fs_storage_options,\n",
+ " instrument_id=InstrumentId.from_str(instrument_id),\n",
+ " start_time=start_time,\n",
+ " end_time=end_time,\n",
+ " )\n",
+ " for instrument_id in instrument_ids\n",
+ " ]\n",
+ "\n",
+ " run_config = BacktestRunConfig(engine=engine, venues=venues, data=data)\n",
+ " \n",
+ " print(\"venues => \", run_config.venues)\n",
+ " node = BacktestNode(configs=[run_config])\n",
+ " return node.run()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 98,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "instrument_ids => EURUSD.SIM\n"
+ ]
+ },
+ {
+ "ename": "ValueError",
+ "evalue": "Error parsing `InstrumentId` from 'E': Missing '.' separator between symbol and venue components",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
+ "Cell \u001b[0;32mIn[98], line 6\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# typer.run(main)\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;66;03m# lr_catalog = LR_MODEL_DATA_CATALOG\u001b[39;00m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(LR_MODEL_DATA_CATALOG\u001b[38;5;241m.\u001b[39minstruments())\u001b[38;5;241m>\u001b[39m\u001b[38;5;241m0\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCouldn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt load instruments, have you run `poetry run inv extract-catalog`?\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m----> 6\u001b[0m [result] \u001b[38;5;241m=\u001b[39m \u001b[43mmain\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 7\u001b[0m \u001b[43m \u001b[49m\u001b[43mcatalog\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mLR_MODEL_DATA_CATALOG\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 8\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# instrument_ids=(\"SMH.NASDAQ\", \"SOXX.NASDAQ\"),\u001b[39;49;00m\n\u001b[1;32m 9\u001b[0m \u001b[43m \u001b[49m\u001b[43minstrument_ids\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mEURUSD.SIM\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 10\u001b[0m \u001b[43m \u001b[49m\u001b[43mlog_level\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mINFO\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 11\u001b[0m \u001b[43m \u001b[49m\u001b[43mpersistence\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 12\u001b[0m \u001b[43m \u001b[49m\u001b[43mend_time\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m2020-06-01\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 13\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 15\u001b[0m \u001b[38;5;28mprint\u001b[39m(result\u001b[38;5;241m.\u001b[39minstance_id)\n",
+ "Cell \u001b[0;32mIn[97], line 55\u001b[0m, in \u001b[0;36mmain\u001b[0;34m(instrument_ids, catalog, notional_trade_size_usd, start_time, end_time, log_level, bypass_logging, persistence, **strategy_kwargs)\u001b[0m\n\u001b[1;32m 45\u001b[0m venues \u001b[38;5;241m=\u001b[39m [\n\u001b[1;32m 46\u001b[0m BacktestVenueConfig(\n\u001b[1;32m 47\u001b[0m name\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSIM\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;66;03m# \"NASDAQ\"\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 52\u001b[0m )\n\u001b[1;32m 53\u001b[0m ]\n\u001b[1;32m 54\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minstrument_ids => \u001b[39m\u001b[38;5;124m\"\u001b[39m, instrument_ids)\n\u001b[0;32m---> 55\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43m[\u001b[49m\n\u001b[1;32m 56\u001b[0m \u001b[43m \u001b[49m\u001b[43mBacktestDataConfig\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 57\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_cls\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mBar\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfully_qualified_name\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 58\u001b[0m \u001b[43m \u001b[49m\u001b[43mcatalog_path\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mstr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mcatalog\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpath\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 59\u001b[0m \u001b[43m \u001b[49m\u001b[43mcatalog_fs_protocol\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcatalog\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfs_protocol\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 60\u001b[0m \u001b[43m \u001b[49m\u001b[43mcatalog_fs_storage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcatalog\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfs_storage_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 61\u001b[0m \u001b[43m \u001b[49m\u001b[43minstrument_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mInstrumentId\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_str\u001b[49m\u001b[43m(\u001b[49m\u001b[43minstrument_id\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 62\u001b[0m \u001b[43m \u001b[49m\u001b[43mstart_time\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstart_time\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 63\u001b[0m \u001b[43m \u001b[49m\u001b[43mend_time\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mend_time\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 64\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 65\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43minstrument_id\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43minstrument_ids\u001b[49m\n\u001b[1;32m 66\u001b[0m \u001b[43m\u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 68\u001b[0m run_config \u001b[38;5;241m=\u001b[39m BacktestRunConfig(engine\u001b[38;5;241m=\u001b[39mengine, venues\u001b[38;5;241m=\u001b[39mvenues, data\u001b[38;5;241m=\u001b[39mdata)\n\u001b[1;32m 70\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mvenues => \u001b[39m\u001b[38;5;124m\"\u001b[39m, run_config\u001b[38;5;241m.\u001b[39mvenues)\n",
+ "Cell \u001b[0;32mIn[97], line 61\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 45\u001b[0m venues \u001b[38;5;241m=\u001b[39m [\n\u001b[1;32m 46\u001b[0m BacktestVenueConfig(\n\u001b[1;32m 47\u001b[0m name\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSIM\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;66;03m# \"NASDAQ\"\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 52\u001b[0m )\n\u001b[1;32m 53\u001b[0m ]\n\u001b[1;32m 54\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minstrument_ids => \u001b[39m\u001b[38;5;124m\"\u001b[39m, instrument_ids)\n\u001b[1;32m 55\u001b[0m data \u001b[38;5;241m=\u001b[39m [\n\u001b[1;32m 56\u001b[0m BacktestDataConfig(\n\u001b[1;32m 57\u001b[0m data_cls\u001b[38;5;241m=\u001b[39mBar\u001b[38;5;241m.\u001b[39mfully_qualified_name(),\n\u001b[1;32m 58\u001b[0m catalog_path\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mstr\u001b[39m(catalog\u001b[38;5;241m.\u001b[39mpath),\n\u001b[1;32m 59\u001b[0m catalog_fs_protocol\u001b[38;5;241m=\u001b[39mcatalog\u001b[38;5;241m.\u001b[39mfs_protocol,\n\u001b[1;32m 60\u001b[0m catalog_fs_storage_options\u001b[38;5;241m=\u001b[39mcatalog\u001b[38;5;241m.\u001b[39mfs_storage_options,\n\u001b[0;32m---> 61\u001b[0m instrument_id\u001b[38;5;241m=\u001b[39m\u001b[43mInstrumentId\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_str\u001b[49m\u001b[43m(\u001b[49m\u001b[43minstrument_id\u001b[49m\u001b[43m)\u001b[49m,\n\u001b[1;32m 62\u001b[0m start_time\u001b[38;5;241m=\u001b[39mstart_time,\n\u001b[1;32m 63\u001b[0m end_time\u001b[38;5;241m=\u001b[39mend_time,\n\u001b[1;32m 64\u001b[0m )\n\u001b[1;32m 65\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m instrument_id \u001b[38;5;129;01min\u001b[39;00m instrument_ids\n\u001b[1;32m 66\u001b[0m ]\n\u001b[1;32m 68\u001b[0m run_config \u001b[38;5;241m=\u001b[39m BacktestRunConfig(engine\u001b[38;5;241m=\u001b[39mengine, venues\u001b[38;5;241m=\u001b[39mvenues, data\u001b[38;5;241m=\u001b[39mdata)\n\u001b[1;32m 70\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mvenues => \u001b[39m\u001b[38;5;124m\"\u001b[39m, run_config\u001b[38;5;241m.\u001b[39mvenues)\n",
+ "File \u001b[0;32m~/anaconda3/envs/algo_trading/lib/python3.11/site-packages/nautilus_trader/model/identifiers.pyx:347\u001b[0m, in \u001b[0;36mnautilus_trader.model.identifiers.InstrumentId.from_str\u001b[0;34m()\u001b[0m\n",
+ "File \u001b[0;32m~/anaconda3/envs/algo_trading/lib/python3.11/site-packages/nautilus_trader/model/identifiers.pyx:314\u001b[0m, in \u001b[0;36mnautilus_trader.model.identifiers.InstrumentId.from_str_c\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;31mValueError\u001b[0m: Error parsing `InstrumentId` from 'E': Missing '.' separator between symbol and venue components"
+ ]
+ }
+ ],
+ "source": [
+ "# typer.run(main)\n",
+ "# lr_catalog = LR_MODEL_DATA_CATALOG\n",
+ "\n",
+ "assert len(LR_MODEL_DATA_CATALOG.instruments())>0, \"Couldn't load instruments, have you run `poetry run inv extract-catalog`?\"\n",
+ " \n",
+ "[result] = main(\n",
+ " catalog=LR_MODEL_DATA_CATALOG,\n",
+ " # instrument_ids=(\"SMH.NASDAQ\", \"SOXX.NASDAQ\"),\n",
+ " instrument_ids=(\"EURUSD.SIM\"),\n",
+ " log_level=\"INFO\",\n",
+ " persistence=False,\n",
+ " end_time=\"2020-06-01\",\n",
+ " )\n",
+ "\n",
+ "print(result.instance_id)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# DUMP"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Add simulation module\n",
+ "\n",
+ "We can optionally plug in a module to simulate rollover interest. The data is available from pre-packaged test data."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from nautilus_trader.backtest.modules import FXRolloverInterestConfig\n",
+ "from nautilus_trader.backtest.modules import FXRolloverInterestModule\n",
+ "from nautilus_trader.test_kit.providers import TestDataProvider\n",
+ "\n",
+ "provider = TestDataProvider()\n",
+ "interest_rate_data = provider.read_csv(\"../data/short-term-interest.csv\")\n",
+ "config = FXRolloverInterestConfig(interest_rate_data)\n",
+ "fx_rollover_interest = FXRolloverInterestModule(config=config)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Add fill model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "For this backtest we'll use a simple probabilistic fill model."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "fill_model = FillModel(\n",
+ " prob_fill_on_limit=0.2,\n",
+ " prob_fill_on_stop=0.95,\n",
+ " prob_slippage=0.5,\n",
+ " random_seed=42,\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Add venue"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "For this backtest we just need a single trading venue which will be a similated FX ECN."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from nautilus_trader.model.currencies import JPY\n",
+ "from nautilus_trader.model.currencies import USD\n",
+ "from nautilus_trader.model.enums import AccountType\n",
+ "from nautilus_trader.model.enums import OmsType\n",
+ "from nautilus_trader.model.identifiers import Venue\n",
+ "from nautilus_trader.model.objects import Money\n",
+ "\n",
+ "SIM = Venue(\"SIM\")\n",
+ "engine.add_venue(\n",
+ " venue=SIM,\n",
+ " oms_type=OmsType.HEDGING, # Venue will generate position IDs\n",
+ " account_type=AccountType.MARGIN,\n",
+ " base_currency=None, # Multi-currency account\n",
+ " starting_balances=[Money(1_000_000, USD), Money(10_000_000, JPY)],\n",
+ " fill_model=fill_model,\n",
+ " modules=[fx_rollover_interest],\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we can add instruments and data. For this backtest we'll pre-process bid and ask side bar data into quote ticks using a `QuoteTickDataWrangler`."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Configure strategy"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Next we'll configure and initialize a simple `EMACross` strategy we'll use for the backtest."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from nautilus_trader.examples.strategies.ema_cross import EMACross\n",
+ "from nautilus_trader.examples.strategies.ema_cross import EMACrossConfig\n",
+ "\n",
+ "# Configure your strategy\n",
+ "config = EMACrossConfig(\n",
+ " instrument_id=USDJPY_SIM.id,\n",
+ " bar_type=BarType.from_str(\"USD/JPY.SIM-5-MINUTE-BID-INTERNAL\"),\n",
+ " fast_ema_period=10,\n",
+ " slow_ema_period=20,\n",
+ " trade_size=Decimal(1_000_000),\n",
+ ")\n",
+ "\n",
+ "# Instantiate and add your strategy\n",
+ "strategy = EMACross(config=config)\n",
+ "# engine.add_strategy(strategy=strategy)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# from nautilus_trader.examples.strategies.subscribe import SubscribeStrategy\n",
+ "# from nautilus_trader.examples.strategies.subscribe import SubscribeStrategyConfig\n",
+ "\n",
+ "# # Instantiate your strategy\n",
+ "# class PSubscribeStrategy(SubscribeStrategy):\n",
+ "# def __init__(self, config: SubscribeStrategyConfig) -> None:\n",
+ "# super().__init__(config)\n",
+ "\n",
+ "# def on_start(self) -> None:\n",
+ "# \"\"\"\n",
+ "# Actions to be performed on strategy start.\n",
+ "# \"\"\"\n",
+ "# self.instrument = self.cache.instrument(self.instrument_id)\n",
+ "# if self.instrument is None:\n",
+ "# self.log.error(f\"Could not find instrument for {self.instrument_id}\")\n",
+ "# self.stop()\n",
+ "# return\n",
+ "\n",
+ "# if self.config.book_type:\n",
+ "# self.book = OrderBook(\n",
+ "# instrument_id=self.instrument.id,\n",
+ "# book_type=self.config.book_type,\n",
+ "# )\n",
+ "# if self.config.snapshots:\n",
+ "# self.subscribe_order_book_at_interval(\n",
+ "# instrument_id=self.instrument_id,\n",
+ "# book_type=self.config.book_type,\n",
+ "# )\n",
+ "# else:\n",
+ "# self.subscribe_order_book_deltas(\n",
+ "# instrument_id=self.instrument_id,\n",
+ "# book_type=self.config.book_type,\n",
+ "# )\n",
+ "\n",
+ "# if self.config.trade_ticks:\n",
+ "# self.subscribe_trade_ticks(instrument_id=self.instrument_id)\n",
+ "# if self.config.quote_ticks:\n",
+ "# self.subscribe_quote_ticks(instrument_id=self.instrument_id)\n",
+ "# if self.config.bars:\n",
+ "# bar_type: BarType = BarType(\n",
+ "# instrument_id=self.instrument_id,\n",
+ "# bar_spec=BarSpecification(\n",
+ "# step=1,\n",
+ "# aggregation=BarAggregation.MINUTE,\n",
+ "# price_type=PriceType.LAST,\n",
+ "# ),\n",
+ "# aggregation_source=AggregationSource.EXTERNAL,\n",
+ "# )\n",
+ "# self.subscribe_bars(bar_type)\n",
+ "\n",
+ "# def on_bar(self, bar: Bar) -> None:\n",
+ "# print(\"bar => \", bar)\n",
+ "\n",
+ "\n",
+ "# # Configure your strategy\n",
+ "# # strategy_config = SubscribeStrategyConfig(\n",
+ "# # instrument_id=InstrumentId.from_str(f\"Step Index.{BROKER_SERVER}\"), # \"EUR/USD.{BROKER_SERVER}\"\n",
+ "# # quote_ticks=True,\n",
+ "# # bars=True,\n",
+ "# # )\n",
+ "\n",
+ "# strategy = PSubscribeStrategy(config=strategy_config)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from nautilus_trader.common.enums import LogColor\n",
+ "from nautilus_trader.config import StrategyConfig\n",
+ "from nautilus_trader.core.correctness import PyCondition\n",
+ "from nautilus_trader.indicators.ta_lib.manager import TAFunctionWrapper\n",
+ "from nautilus_trader.indicators.ta_lib.manager import TALibIndicatorManager\n",
+ "from nautilus_trader.model.data import Bar\n",
+ "from nautilus_trader.model.data import BarType\n",
+ "from nautilus_trader.model.instruments import Instrument\n",
+ "from nautilus_trader.trading.strategy import Strategy\n",
+ "\n",
+ "\n",
+ "class TALibStrategyConfig(StrategyConfig, frozen=True):\n",
+ " \"\"\"\n",
+ " Configuration for ``TALibStrategy`` instances.\n",
+ "\n",
+ " Parameters\n",
+ " ----------\n",
+ " bar_type : BarType\n",
+ " The bar type for the strategy.\n",
+ "\n",
+ " \"\"\"\n",
+ "\n",
+ " bar_type: BarType\n",
+ "\n",
+ "\n",
+ "\n",
+ "class TALibStrategy(Strategy):\n",
+ " \"\"\"\n",
+ " A trading strategy demonstration using TA-Lib (Technical Analysis Library) for\n",
+ " generating trading signals based on technical indicators. This strategy is intended\n",
+ " for educational purposes and does not execute real trading orders. Instead, it logs\n",
+ " potential actions derived from technical analysis signals.\n",
+ "\n",
+ " This strategy is configured to use a variety of technical indicators such as EMA (Exponential\n",
+ " Moving Averages), RSI (Relative Strength Index), and MACD (Moving Average Convergence Divergence).\n",
+ " It demonstrates how these indicators can be utilized to identify potential trading opportunities\n",
+ " based on market data.\n",
+ "\n",
+ " The strategy responds to incoming bar data (candlestick data) and analyzes it using the set\n",
+ " indicators to make decisions. It can identify conditions like EMA crossovers, overbought or\n",
+ " oversold RSI levels, and MACD histogram values to log potential buy or sell signals.\n",
+ "\n",
+ " Parameters\n",
+ " ----------\n",
+ " config : TALibStrategyConfig\n",
+ " The configuration object for the strategy, which includes the `bar_type` specifying the\n",
+ " market data type (like minute bars, tick bars, etc.) to be used in the strategy.\n",
+ "\n",
+ " Attributes\n",
+ " ----------\n",
+ " instrument_id : InstrumentId\n",
+ " The ID of the instrument (like a stock or currency pair) that the strategy operates on.\n",
+ " bar_type : BarType\n",
+ " The type of market data bars the strategy is configured to use.\n",
+ " indicator_manager : TALibIndicatorManager\n",
+ " Manages the indicators used in the strategy, handling their initialization, update,\n",
+ " and value retrieval.\n",
+ "\n",
+ " \"\"\"\n",
+ "\n",
+ " def __init__(self, config: TALibStrategyConfig) -> None:\n",
+ " PyCondition.type(config.bar_type, BarType, \"config.bar_type\")\n",
+ " super().__init__(config)\n",
+ "\n",
+ " # Configuration\n",
+ " self.instrument_id = config.bar_type.instrument_id\n",
+ " self.bar_type = config.bar_type\n",
+ "\n",
+ " # Create the indicators for the strategy\n",
+ " self.indicator_manager: TALibIndicatorManager = TALibIndicatorManager(\n",
+ " bar_type=self.bar_type,\n",
+ " period=2,\n",
+ " )\n",
+ "\n",
+ " # Specify the necessary indicators, configuring them as individual or grouped instances\n",
+ " # in TALibIndicatorManager. This approach uses string identifiers, each corresponding to\n",
+ " # an indicator's output name, to instantiate TAFunctionWrappers\n",
+ " indicators = [\n",
+ " \"ATR_14\",\n",
+ " \"EMA_10\",\n",
+ " \"EMA_20\",\n",
+ " \"RSI_14\",\n",
+ " \"MACD_12_26_9\",\n",
+ " \"MACD_12_26_9_SIGNAL\",\n",
+ " \"MACD_12_26_9_HIST\",\n",
+ " ]\n",
+ " self.indicator_manager.set_indicators(TAFunctionWrapper.from_list_of_str(indicators))\n",
+ "\n",
+ " # Initialize on_start\n",
+ " self.instrument: Instrument | None = None\n",
+ "\n",
+ " def on_start(self) -> None:\n",
+ " \"\"\"\n",
+ " Actions to be performed on strategy start.\n",
+ " \"\"\"\n",
+ " self.instrument = self.cache.instrument(self.instrument_id)\n",
+ " if self.instrument is None:\n",
+ " self.log.error(f\"Could not find instrument for {self.instrument_id}\")\n",
+ " self.stop()\n",
+ " return\n",
+ "\n",
+ " # Register the indicators for updating\n",
+ " self.register_indicator_for_bars(self.bar_type, self.indicator_manager)\n",
+ "\n",
+ " # Subscribe to live data\n",
+ " self.subscribe_bars(self.bar_type)\n",
+ " self.subscribe_quote_ticks(self.instrument_id)\n",
+ "\n",
+ " def on_bar(self, bar: Bar) -> None:\n",
+ " \"\"\"\n",
+ " Actions to be performed when the strategy is running and receives a bar.\n",
+ "\n",
+ " Parameters\n",
+ " ----------\n",
+ " bar : Bar\n",
+ " The bar received.\n",
+ "\n",
+ " \"\"\"\n",
+ " self.log.info(repr(bar), LogColor.CYAN)\n",
+ "\n",
+ " # Check if indicators ready\n",
+ " if not self.indicators_initialized():\n",
+ " self.log.info(\n",
+ " f\"Waiting for indicators to warm up [{self.cache.bar_count(self.bar_type)}]\",\n",
+ " color=LogColor.BLUE,\n",
+ " )\n",
+ " return # Wait for indicators to warm up...\n",
+ "\n",
+ " if bar.is_single_price():\n",
+ " # Implies no market information for this bar\n",
+ " return\n",
+ "\n",
+ " # Check EMA cross-over\n",
+ " if self.indicator_manager.value(\"EMA_10\") > self.indicator_manager.value(\n",
+ " \"EMA_20\",\n",
+ " 1,\n",
+ " ) and self.indicator_manager.value(\"EMA_10\", 1) < self.indicator_manager.value(\"EMA_20\"):\n",
+ " self.log.info(\"EMA_10 crossed above EMA_20\", color=LogColor.GREEN)\n",
+ " elif self.indicator_manager.value(\"EMA_10\") < self.indicator_manager.value(\n",
+ " \"EMA_20\",\n",
+ " 1,\n",
+ " ) and self.indicator_manager.value(\"EMA_10\", 1) > self.indicator_manager.value(\"EMA_20\"):\n",
+ " self.log.info(\"EMA_10 crossed below EMA_20\", color=LogColor.GREEN)\n",
+ "\n",
+ " # Check RSI\n",
+ " if self.indicator_manager.value(\"RSI_14\") > 70:\n",
+ " self.log.info(\"RSI_14 is overbought\", color=LogColor.MAGENTA)\n",
+ " elif self.indicator_manager.value(\"RSI_14\") < 30:\n",
+ " self.log.info(\"RSI_14 is oversold\", color=LogColor.MAGENTA)\n",
+ "\n",
+ " # Check MACD Histogram\n",
+ " if self.indicator_manager.value(\"MACD_12_26_9_HIST\") > 0:\n",
+ " self.log.info(\"MACD_12_26_9_HIST is positive\", color=LogColor.MAGENTA)\n",
+ " elif self.indicator_manager.value(\"MACD_12_26_9_HIST\") < 0:\n",
+ " self.log.info(\"MACD_12_26_9_HIST is negative\", color=LogColor.MAGENTA)\n",
+ "\n",
+ " def on_stop(self) -> None:\n",
+ " \"\"\"\n",
+ " Actions to be performed when the strategy is stopped.\n",
+ " \"\"\"\n",
+ " # Unsubscribe from data\n",
+ " self.unsubscribe_bars(self.bar_type)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Generating reports\n",
+ "\n",
+ "Additionally, we can produce various reports to further analyze the backtest result."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "engine.trader.generate_account_report(SIM)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "engine.trader.generate_order_fills_report()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "engine.trader.generate_positions_report()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# env = gym.make(\"CartPole-v1\", render_mode=\"human\")\n",
+ "\n",
+ "# model = PPO(\"MlpPolicy\", env, verbose=1)\n",
+ "# model.learn(total_timesteps=10_000)\n",
+ "\n",
+ "# vec_env = model.get_env()\n",
+ "# obs = vec_env.reset()\n",
+ "# for i in range(1000):\n",
+ "# action, _states = model.predict(obs, deterministic=True)\n",
+ "# obs, reward, done, info = vec_env.step(action)\n",
+ "# vec_env.render()\n",
+ "# # VecEnv resets automatically\n",
+ "# # if done:\n",
+ "# # obs = env.reset()\n",
+ "\n",
+ "# env.close()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "nautilus_trader",
+ "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.11.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}