57 Commits

Author SHA1 Message Date
David Brazda 093fe5dfbc static site pwd protected, load dotenv moved to config, aggregator vecotrized chng 2024-06-04 12:47:48 +02:00
David Brazda 05b7725a25 vectorized aggregator, minor changes (#198) 2024-05-17 14:09:42 +02:00
pvlasak 3de7d23009 Feature/dotenv (#195)
* load_dotenv from python-dotenv library imported

* WEB_API_KEY is read as virtual environment variable specified in .env file

* env file referenced by variable imported from config.py

* env file directory and env file variables defined

* bash script to create env file

* Delete env_migration.sh

---------

Co-authored-by: David Brazda <davidbrazda61@gmail.com>
2024-05-09 12:47:32 +02:00
David Brazda 9e7d974ebd sitemap added (#194) 2024-04-28 18:56:36 +02:00
David Brazda 66a4cb5d7c update of vbt doc 2024-04-25 06:24:51 +02:00
David Brazda 0bf9aadb0c fix 2024-04-17 13:04:57 +02:00
pvlasak 81ca678f55 Feature/market attribute (#185)
* RunManagerRecord class has a new attribute market. Market enum is imported.

* row_to_runmanager function considers market column

* add_run_manager_record and update_run_manager_record functions are changed. fetch_all_markets_in_run_manager is new.

* new Market enumeration class is defined

* market_value used for job scheduling. start and stop functions have modifications of market parameter input

* new is_market_day function + modifications of get_todays_market_times function

* market attribute set default to US

* row_to_runmanager function has no string formatter for market attribute

* add_run_manager_record function adn update_run_manager_record function update the DB column market based on record.market data

* start_runman_record and stop_runman_record have got no market parameter

* get_todays_market_times function is changed

* default value for market atribute is Market.US

* update_run_manager_record function has no if condition for market key

* market_value deleted, used enumaration value Market.US instead of string US

* get_todays_market_times has a new if condition for Market.CRYPTO

* update includes market column in the run_manager table

* market attribute in Run Manager record has value given by enumeration as Market.US

* documentation of changes made in the branch

* remove README_feature_market.md

* back to original state

* Delete README_feature_market.md

* _start_runman_record has an additional else condition

* is_market_day renamed to is_US_market_day

* transferables column added into runner_header table
2024-04-17 12:14:01 +02:00
David Brazda 96c7f7207f vectorbtdoc 2024-04-16 15:53:51 +02:00
David Brazda 26b72763da bugfix (#181) 2024-03-18 18:42:09 +01:00
David Brazda adc7c3c1b6 hard stop / soft stop for cutoff (#177) martingale base (#178) 2024-03-15 13:36:28 +01:00
David Brazda a6343abe88 highlight logs on gui (#176) 2024-03-15 11:06:18 +01:00
David Brazda 075984fcff archrunner db query searches for symbol, name (#175) 2024-03-15 10:04:46 +01:00
David Brazda 5fce627fe3 toml validation to frontend (#174) 2024-03-14 17:39:52 +01:00
David Brazda 8de1356aa8 #163 transferables (#172) 2024-03-14 14:16:01 +01:00
David Brazda 7f47890cad #168 #166 and additional fixes (#169) 2024-03-13 12:31:06 +01:00
David Brazda 8cf1aea2a8 run updte 2024-03-07 14:07:46 +01:00
David Brazda 9231c1d273 bugfix - kontrolu na maxloss provadime az u eventy FILL, kdy je znama celkova castka 2024-03-06 15:50:16 +01:00
David Brazda 9391d89aab #148 #158 config refactoring to support profiles/reloading (#165) 2024-03-06 14:30:24 +01:00
David Brazda 9cff5fe6a1 #155 + presun row_to from db.py to transform.py 2024-03-06 13:31:09 +01:00
David Brazda 0e5cf5f3e0 Merge pull request #161 from drew2323/local
Minor changes for installation on windows
2024-03-04 17:03:50 +01:00
David Brazda 90c33c0528 Delete run.sh 2024-03-04 17:01:47 +01:00
Petr Vlasak e9e6534d2b primary live account api and secret changed 2024-03-04 16:57:10 +01:00
Petr Vlasak 5874528d23 line 29 has deleted integrity and crossorigin value 2024-02-28 08:08:21 +01:00
Petr Vlasak 985445d814 user_data_dir function has a second parameter author, ACCOUNT1_LIVE has still PAPER_API_KEY and SECRET_KEY 2024-02-28 08:04:02 +01:00
Petr Vlasak 6c1f7f0e2e changed VIRTUAL_ENV_DIR and PYTHON_TO_USE 2024-02-27 18:15:35 +01:00
David Brazda 20aaa2ac23 #135 -> BT same period button 2024-02-27 12:03:57 +07:00
David Brazda 691514b102 all dates in gui are in market time zone (even start/stop) 2024-02-27 10:53:30 +07:00
David Brazda 84903aff77 batchprofit/batchcount columns hidden from archiverunners gui 2024-02-27 08:15:07 +07:00
David Brazda 4887e32665 #149 2024-02-26 22:42:03 +07:00
David Brazda ce99448a48 moved config related services into separated package 2024-02-26 19:35:19 +07:00
David Brazda 887ea0ef00 #147 2024-02-26 11:30:13 +07:00
David Brazda af7b678699 zpet debug podminka 2024-02-24 21:23:17 +07:00
David Brazda 04c63df045 docasny disable pro testing 2024-02-24 21:17:10 +07:00
David Brazda ebac207489 #143 2024-02-24 20:32:01 +07:00
David Brazda 9f99ddc86a live_data_feed stored in runner_archive 2024-02-23 21:20:07 +07:00
David Brazda e75fbc7194 bugfix 2024-02-23 21:04:23 +07:00
David Brazda c4d05f47ff #139 konfigurace LIVE_DATA_FEED 2024-02-23 12:35:02 +07:00
David Brazda f6e31f45f9 #136 bugfix properly closing ws 2024-02-23 10:30:12 +07:00
David Brazda c42b1c4e1e fix 2024-02-22 23:23:20 +07:00
David Brazda 1bf11d0dc4 fix 2024-02-22 23:20:54 +07:00
David Brazda 1abbb07390 Scheduler support #24sched 2024-02-22 23:05:49 +07:00
David Brazda b58639454b unknown symbol msg 2024-02-12 10:45:23 +07:00
David Brazda a7e83fe051 bugfix create batch image (check for None from Alpaca) 2024-02-11 15:26:15 +07:00
David Brazda 6795338eba createbatch image tool + send to telefram enrichment 2024-02-11 12:37:19 +07:00
David Brazda 9aa8b58877 updatnute requirements.txt 2024-02-10 21:35:53 +07:00
David Brazda eff78e8157 keys to env variables, optimalizations 2024-02-10 21:02:00 +07:00
David Brazda d8bcc4bb8f Merge branch 'master' of https://github.com/drew2323/v2trading 2024-02-06 11:16:58 +07:00
David Brazda 7abdf47545 ok 2024-02-06 11:16:09 +07:00
David Brazda 1f8afef042 calendar wrapper with retry, histo bars with retry 2024-02-06 11:14:38 +07:00
David Brazda df60d16eb4 Update README.md 2024-02-06 09:52:53 +07:00
David Brazda 535c2824b0 Update README.md 2024-02-06 09:34:33 +07:00
David Brazda 9cf936672d Update README.md 2024-02-06 09:30:56 +07:00
David Brazda c1ad713a12 bugfix None in trade response 2024-02-05 10:22:20 +07:00
David Brazda e9bb8b84ec fixes 2024-02-04 17:55:43 +07:00
David Brazda 603736d441 Merge branch 'master' of https://github.com/drew2323/v2trading 2024-02-04 17:54:09 +07:00
David Brazda 2c968691d1 Update README.md 2024-01-31 13:39:33 +07:00
David Brazda 435b4d899a Create README.md 2024-01-31 13:37:45 +07:00
1121 changed files with 96978 additions and 1619820 deletions
+4 -79
View File
@@ -1,9 +1,9 @@
# V2TRADING - Advanced Algorithmic Trading Platform **README - V2TRADING - Advanced Algorithmic Trading Platform**
## Overview **Overview**
Custom-built algorithmic trading platform for research, backtesting and live trading. Trading engine capable of processing tick data, providing custom aggregation, managing trades, and supporting backtesting in a highly accurate and efficient manner. Custom-built algorithmic trading platform for research, backtesting and automated trading. Trading engine capable of processing tick data, managing trades, and supporting backtesting in a highly accurate and efficient manner.
## Key Features **Key Features**
- **Trading Engine**: At the core of the platform is a trading engine that processes tick data in real time. This engine is responsible for aggregating data and managing the execution of trades, ensuring precision and speed in trade placement and execution. - **Trading Engine**: At the core of the platform is a trading engine that processes tick data in real time. This engine is responsible for aggregating data and managing the execution of trades, ensuring precision and speed in trade placement and execution.
- **High-Fidelity Backtesting Environment**: ability to backtest strategies with 1:1 precision - meaning a tick-by-tick backtesting. This level of precision in backtesting, down to millisecond accuracy, mirrors live trading environments and is vital for developing and testing high-frequency trading strategies. - **High-Fidelity Backtesting Environment**: ability to backtest strategies with 1:1 precision - meaning a tick-by-tick backtesting. This level of precision in backtesting, down to millisecond accuracy, mirrors live trading environments and is vital for developing and testing high-frequency trading strategies.
@@ -51,78 +51,3 @@ This repository represents a sophisticated and evolving tool for algorithmic tra
</p> </p>
# Installation Instructions
This document outlines the steps for installing and setting up the necessary environment for the application. These instructions are applicable for both Windows and Linux operating systems. Please follow the steps carefully to ensure a smooth setup.
## Prerequisites
Before beginning the installation process, ensure the following prerequisites are met:
- TA-Lib Library:
- Windows: Download and build the TA-Lib library. Install Visual Studio Community with the Visual C++ feature. Navigate to `C:\ta-lib\c\make\cdr\win32\msvc` in the command prompt and build the library using the available makefile.
- Linux: Install TA-Lib using your distribution's package manager or compile from source following the instructions available on the TA-Lib GitHub repository.
- Alpaca Paper Trading Account: Create an account at [Alpaca Markets](https://alpaca.markets/) and generate `API_KEY` and `SECRET_KEY` for your paper trading account.
## Installation Steps
**Clone the Repository:** Clone the remote repository to your local machine.
`git clone git@github.com:drew2323/v2trading.git <name_of_local_folder>`
**Install Python:** Ensure Python 3.10.11 is installed on your system.
**Create a Virtual Environment:** Set up a Python virtual environment.
`python -m venv <path_to_venv_folder>`
**Activate Virtual Environment:**
- Windows: `source ./<venv_folder>/Scripts/activate`
- Linux: `source ./<venv_folder>/bin/activate`
**Install Dependencies:** Install the program requirements.
pip install -r requirements.txt
Note: It's permissible to comment out references to `keras` and `tensorflow` modules, as well as the `ml-room` repository in `requirements.txt`.
**Environment Variables:** In `run.sh`, modify the `VIRTUAL_ENV_DIR` and `PYTHON_TO_USE` variables as necessary.
**Data Directory:** Navigate to `DATA_DIR` and create folders: `aggcache`, `tradecache`, and `models`.
**Media and Static Folders:** Create `media` and `static` folders one level above the repository directory. Also create `.env` file there.
**Database Setup:** Create the `v2trading.db` file using SQL commands from `v2trading_create_db.sql`.
```
import sqlite3
with open("v2trading_create_db.sql", "r") as f:
sql_statements = f.read()
conn = sqlite3.connect('v2trading.db')
cursor = conn.cursor()
cursor.executescript(sql_statements)
conn.commit()
conn.close()
```
Ensure the `config_table` is not empty by making an initial entry.
**Start the Application:** Run `main.py` in VSCode to start the application.
**Accessing the Application:** If the uvicorn server runs successfully at `http://0.0.0.0:8000`, access the application at `http://localhost:8000/static/`.
**Database Configuration:** Add dynamic button and JS configurations to the `config_table` in `v2trading.db` via the "Config" section on the main page.
Please replace placeholders (e.g., `<name_of_local_folder>`, `<path_to_venv_folder>`) with your actual paths and details. Follow these instructions to ensure the application is set up correctly and ready for use.
## Environmental variables
Trading platform can support N different accounts. Their API keys are stored as environmental variables in .env file located in the root directory.
Account for trading api is selected when each strategy is run. However for realtime websocket data), always ACCOUNT1 is used for all strategies. The data point selection (iex vs sip) is set by LIVE_DATA_FEED environment variable.
.env file should contain:
```
ACCOUNT1_LIVE_API_KEY=<ACCOUNT1_LIVE_API_KEY>
ACCOUNT1_LIVE_SECRET_KEY=<ACCOUNT1_LIVE_SECRET_KEY>
ACCOUNT1_LIVE_FEED=sip
ACCOUNT1_PAPER_API_KEY=<ACCOUNT1_PAPER_API_KEY>
ACCOUNT1_PAPER_SECRET_KEY=<ACCOUNT1_PAPER_SECRET_KEY>
ACCOUNT1_PAPER_FEED=sip
ACCOUNT2_PAPER_API_KEY=<ACCOUNT2_PAPER_API_KEY>
ACCOUNT2_PAPER_SECRET_KEY=ACCOUNT2_PAPER_SECRET_KEY<>
ACCOUNT2_PAPER_FEED=iex
WEB_API_KEY=<pass-for-webapi>
```
+19 -140
View File
@@ -1,34 +1,21 @@
absl-py==2.0.0 absl-py==2.0.0
alpaca==1.0.0 alpaca==1.0.0
alpaca-py==0.18.1 alpaca-py==0.7.1
altair==4.2.2 altair==4.2.2
annotated-types==0.6.0
anyio==3.6.2 anyio==3.6.2
appdirs==1.4.4 appdirs==1.4.4
appnope==0.1.3
APScheduler==3.10.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.2.1 asttokens==2.2.1
astunparse==1.6.3 astunparse==1.6.3
async-lru==2.0.4
attrs==22.2.0 attrs==22.2.0
Babel==2.15.0
beautifulsoup4==4.12.3
better-exceptions==0.3.3 better-exceptions==0.3.3
bleach==6.0.0 bleach==6.0.0
blinker==1.5 blinker==1.5
bottle==0.12.25
cachetools==5.3.0 cachetools==5.3.0
CD==1.1.0
certifi==2022.12.7 certifi==2022.12.7
cffi==1.16.0
chardet==5.1.0 chardet==5.1.0
charset-normalizer==3.0.1 charset-normalizer==3.0.1
click==8.1.3 click==8.1.3
colorama==0.4.6 colorama==0.4.6
comm==0.1.4
contourpy==1.0.7 contourpy==1.0.7
cycler==0.11.0 cycler==0.11.0
dash==2.9.1 dash==2.9.1
@@ -36,189 +23,90 @@ dash-bootstrap-components==1.4.1
dash-core-components==2.0.0 dash-core-components==2.0.0
dash-html-components==2.0.0 dash-html-components==2.0.0
dash-table==5.0.0 dash-table==5.0.0
dateparser==1.1.8
debugpy==1.8.1
decorator==5.1.1 decorator==5.1.1
defusedxml==0.7.1
dill==0.3.7
dm-tree==0.1.8
entrypoints==0.4 entrypoints==0.4
exceptiongroup==1.1.3
executing==1.2.0 executing==1.2.0
fastapi==0.109.2 fastapi==0.95.0
fastjsonschema==2.19.1
filelock==3.13.1
Flask==2.2.3 Flask==2.2.3
flatbuffers==23.5.26 flatbuffers==23.5.26
fonttools==4.39.0 fonttools==4.39.0
fpdf2==2.7.6
fqdn==1.5.1
gast==0.4.0 gast==0.4.0
gitdb==4.0.10 gitdb==4.0.10
GitPython==3.1.31 GitPython==3.1.31
google-auth==2.23.0 google-auth==2.23.0
google-auth-oauthlib==1.0.0 google-auth-oauthlib==1.0.0
google-pasta==0.2.0 google-pasta==0.2.0
greenlet==3.0.3
grpcio==1.58.0 grpcio==1.58.0
h11==0.14.0 h11==0.14.0
h5py==3.10.0 h5py==3.9.0
html2text==2024.2.26
httpcore==1.0.5
httpx==0.27.0
humanize==4.9.0
icecream==2.1.3 icecream==2.1.3
idna==3.4 idna==3.4
imageio==2.31.6
importlib-metadata==6.1.0 importlib-metadata==6.1.0
ipykernel==6.29.4
ipython==8.17.2
ipywidgets==8.1.1
isoduration==20.11.0
itables==2.0.1
itsdangerous==2.1.2 itsdangerous==2.1.2
jax==0.4.23
jaxlib==0.4.23
jedi==0.19.1
Jinja2==3.1.2 Jinja2==3.1.2
joblib==1.3.2 joblib==1.3.2
json5==0.9.25 jsonschema==4.17.3
jsonpointer==2.4 keras==2.13.1
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter_client==8.6.1
jupyter_core==5.7.2
jupyter_server==2.14.0
jupyter_server_terminals==0.5.3
jupyterlab==4.1.8
jupyterlab-widgets==3.0.9
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.1
kaleido==0.2.1
keras==3.0.2
keras-core==0.1.7
keras-nightly==3.0.3.dev2024010203
keras-nlp-nightly==0.7.0.dev2024010203
keras-tcn @ git+https://github.com/drew2323/keras-tcn.git@4bddb17a02cb2f31c9fe2e8f616b357b1ddb0e11
kiwisolver==1.4.4 kiwisolver==1.4.4
libclang==16.0.6 libclang==16.0.6
lightweight-charts @ git+https://github.com/drew2323/lightweight-charts-python@10fd42f785182edfbf6b46a19a4ef66e85985a23
llvmlite==0.39.1
Markdown==3.4.3 Markdown==3.4.3
markdown-it-py==2.2.0 markdown-it-py==2.2.0
MarkupSafe==2.1.2 MarkupSafe==2.1.2
matplotlib==3.8.2 matplotlib==3.7.1
matplotlib-inline==0.1.6
mdurl==0.1.2 mdurl==0.1.2
mistune==3.0.2
ml-dtypes==0.3.1
mlroom @ git+https://github.com/drew2323/mlroom.git@692900e274c4e0542d945d231645c270fc508437
mplfinance==0.12.10b0
msgpack==1.0.4 msgpack==1.0.4
mypy-extensions==1.0.0
namex==0.0.7
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
newtulipy==0.4.6 newtulipy==0.4.6
notebook_shim==0.2.4 numpy==1.24.2
numba==0.56.4
numpy==1.23.5
oauthlib==3.2.2 oauthlib==3.2.2
opt-einsum==3.3.0 opt-einsum==3.3.0
orjson==3.9.10
overrides==7.7.0
packaging==23.0 packaging==23.0
pandas==2.2.1 pandas==1.5.3
pandocfilters==1.5.1
param==1.13.0 param==1.13.0
parso==0.8.3
patsy==0.5.6
pexpect==4.8.0
Pillow==9.4.0 Pillow==9.4.0
platformdirs==4.2.0 plotly==5.13.1
plotly==5.22.0
prometheus_client==0.20.0
prompt-toolkit==3.0.39
proto-plus==1.22.2 proto-plus==1.22.2
protobuf==3.20.3 protobuf==3.20.3
proxy-tools==0.1.0
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
pyarrow==11.0.0 pyarrow==11.0.0
pyasn1==0.4.8 pyasn1==0.4.8
pyasn1-modules==0.2.8 pyasn1-modules==0.2.8
pycparser==2.22
pyct==0.5.0 pyct==0.5.0
pydantic==2.6.4 pydantic==1.10.5
pydantic_core==2.16.3
pydeck==0.8.0 pydeck==0.8.0
Pygments==2.14.0 Pygments==2.14.0
pyinstrument==4.5.3 pyinstrument==4.5.3
Pympler==1.0.1 Pympler==1.0.1
pyobjc-core==10.3
pyobjc-framework-Cocoa==10.3
pyobjc-framework-Security==10.3
pyobjc-framework-WebKit==10.3
pyparsing==3.0.9 pyparsing==3.0.9
pyrsistent==0.19.3 pyrsistent==0.19.3
pysos==1.3.0 pysos==1.3.0
python-dateutil==2.8.2 python-dateutil==2.8.2
python-dotenv==1.0.0 python-dotenv==1.0.0
python-json-logger==2.0.7
python-multipart==0.0.6
pytz==2022.7.1 pytz==2022.7.1
pytz-deprecation-shim==0.1.0.post0 pytz-deprecation-shim==0.1.0.post0
pyviz-comms==2.2.1 pyviz-comms==2.2.1
PyWavelets==1.5.0
pywebview==5.1
PyYAML==6.0 PyYAML==6.0
pyzmq==25.1.2
referencing==0.35.1
regex==2023.10.3
requests==2.31.0 requests==2.31.0
requests-oauthlib==1.3.1 requests-oauthlib==1.3.1
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.3.1 rich==13.3.1
rpds-py==0.18.0
rsa==4.9 rsa==4.9
schedule==1.2.1 scikit-learn==1.3.1
scikit-learn==1.3.2
scipy==1.11.2 scipy==1.11.2
seaborn==0.12.2 seaborn==0.12.2
semver==2.13.0 semver==2.13.0
Send2Trash==1.8.3
six==1.16.0 six==1.16.0
smmap==5.0.0 smmap==5.0.0
sniffio==1.3.0 sniffio==1.3.0
soupsieve==2.5
SQLAlchemy==2.0.27
sseclient-py==1.7.2 sseclient-py==1.7.2
stack-data==0.6.3 starlette==0.26.1
starlette==0.36.3
statsmodels==0.14.1
streamlit==1.20.0 streamlit==1.20.0
structlog==23.1.0 structlog==23.1.0
TA-Lib==0.4.28
tb-nightly==2.16.0a20240102
tenacity==8.2.2 tenacity==8.2.2
tensorboard==2.15.1 tensorboard==2.13.0
tensorboard-data-server==0.7.1 tensorboard-data-server==0.7.1
tensorflow-addons==0.23.0 tensorflow==2.13.0
tensorflow-estimator==2.15.0 tensorflow-estimator==2.13.0
tensorflow-io-gcs-filesystem==0.34.0 tensorflow-io-gcs-filesystem==0.34.0
termcolor==2.3.0 termcolor==2.3.0
terminado==0.18.1
tf-estimator-nightly==2.14.0.dev2023080308
tf-nightly==2.16.0.dev20240101
tf_keras-nightly==2.16.0.dev2023123010
threadpoolctl==3.2.0 threadpoolctl==3.2.0
tinycss2==1.3.0
tinydb==4.7.1 tinydb==4.7.1
tinydb-serialization==2.1.0 tinydb-serialization==2.1.0
tinyflux==0.4.0 tinyflux==0.4.0
@@ -227,24 +115,15 @@ tomli==2.0.1
toolz==0.12.0 toolz==0.12.0
tornado==6.2 tornado==6.2
tqdm==4.65.0 tqdm==4.65.0
traitlets==5.13.0 typing_extensions==4.5.0
typeguard==2.13.3
types-python-dateutil==2.9.0.20240316
typing_extensions==4.9.0
tzdata==2023.2 tzdata==2023.2
tzlocal==4.3 tzlocal==4.3
uri-template==1.3.0
urllib3==1.26.14 urllib3==1.26.14
uvicorn==0.21.1 uvicorn==0.21.1
-e git+https://github.com/drew2323/v2trading.git@1f85b271dba2b9baf2c61b591a08849e9d684374#egg=v2realbot #-e git+https://github.com/drew2323/v2trading.git@940348412f67ecd551ef8d0aaedf84452abf1320#egg=v2realbot
validators==0.20.0 validators==0.20.0
vectorbtpro @ file:///Users/davidbrazda/Downloads/vectorbt.pro-2024.2.22
wcwidth==0.2.9
webcolors==1.13
webencodings==0.5.1 webencodings==0.5.1
websocket-client==1.7.0 websockets==10.4
websockets==11.0.3
Werkzeug==2.2.3 Werkzeug==2.2.3
widgetsnbextension==4.0.9 wrapt==1.15.0
wrapt==1.14.1
zipp==3.15.0 zipp==3.15.0
-243
View File
@@ -1,243 +0,0 @@
absl-py
alpaca
alpaca-py
altair
annotated-types
anyio
appdirs
appnope
APScheduler
argon2-cffi
argon2-cffi-bindings
arrow
asttokens
astunparse
async-lru
attrs
Babel
beautifulsoup4
better-exceptions
bleach
blinker
bottle
cachetools
CD
certifi
cffi
chardet
charset-normalizer
click
colorama
comm
contourpy
cycler
dash
dash-bootstrap-components
dash-core-components
dash-html-components
dash-table
dateparser
debugpy
decorator
defusedxml
dill
dm-tree
entrypoints
exceptiongroup
executing
fastapi
fastjsonschema
filelock
Flask
flatbuffers
fonttools
fpdf2
fqdn
gast
gitdb
GitPython
google-auth
google-auth-oauthlib
google-pasta
greenlet
grpcio
h11
h5py
html2text
httpcore
httpx
humanize
icecream
idna
imageio
importlib-metadata
ipykernel
ipython
ipywidgets
isoduration
itables
itsdangerous
jax
jaxlib
jedi
Jinja2
joblib
json5
jsonpointer
jsonschema
jsonschema-specifications
jupyter-events
jupyter-lsp
jupyter_client
jupyter_core
jupyter_server
jupyter_server_terminals
jupyterlab
jupyterlab-widgets
jupyterlab_pygments
jupyterlab_server
kaleido
keras
keras-core
keras-nightly
keras-nlp-nightly
keras-tcn @ git+https://github.com/drew2323/keras-tcn.git
kiwisolver
libclang
lightweight-charts @ git+https://github.com/drew2323/lightweight-charts-python.git
llvmlite
Markdown
markdown-it-py
MarkupSafe
matplotlib
matplotlib-inline
mdurl
mistune
ml-dtypes
mlroom @ git+https://github.com/drew2323/mlroom.git
mplfinance
msgpack
mypy-extensions
namex
nbclient
nbconvert
nbformat
nest-asyncio
newtulipy
notebook_shim
numba
numpy
oauthlib
opt-einsum
orjson
overrides
packaging
pandas
pandocfilters
param
parso
patsy
pexpect
Pillow
platformdirs
plotly
prometheus_client
prompt-toolkit
proto-plus
protobuf
proxy-tools
psutil
ptyprocess
pure-eval
pyarrow
pyasn1
pyasn1-modules
pycparser
pyct
pydantic
pydantic_core
pydeck
Pygments
pyinstrument
pyparsing
pyrsistent
pysos
python-dateutil
python-dotenv
python-json-logger
python-multipart
pytz
pytz-deprecation-shim
pyviz-comms
PyWavelets
pywebview
PyYAML
pyzmq
referencing
regex
requests
requests-oauthlib
rfc3339-validator
rfc3986-validator
rich
rpds-py
rsa
schedule
scikit-learn
scipy
seaborn
semver
Send2Trash
six
smmap
sniffio
soupsieve
SQLAlchemy
sseclient-py
stack-data
starlette
statsmodels
streamlit
structlog
TA-Lib
tb-nightly
tenacity
tensorboard
tensorboard-data-server
tensorflow-addons
tensorflow-estimator
tensorflow-io-gcs-filesystem
termcolor
terminado
tf-estimator-nightly
tf-nightly
tf_keras-nightly
threadpoolctl
tinycss2
tinydb
tinydb-serialization
tinyflux
toml
tomli
toolz
tornado
tqdm
traitlets
typeguard
types-python-dateutil
typing_extensions
tzdata
tzlocal
uri-template
urllib3
uvicorn
validators
wcwidth
webcolors
webencodings
websocket-client
websockets
Werkzeug
widgetsnbextension
wrapt
zipp
+1 -1
View File
@@ -402,7 +402,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.10" "version": "3.10.11"
} }
}, },
"nbformat": 4, "nbformat": 4,
+2 -2
View File
@@ -5,7 +5,7 @@
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Loading trades and vectorized aggregation\n", "# Loading trades and vectorized aggregation\n",
"This notebook fetches the trades from remote or local cache and aggregates them to bars of given type (time, volume, dollar) and resolution\n", "Describes how to fetch trades (remote/cached) and use new vectorized aggregation to aggregate bars of given type (time, volume, dollar) and resolution\n",
"\n", "\n",
"`fetch_trades_parallel` enables to fetch trades of given symbol and interval, also can filter conditions and minimum size. return `trades_df`\n", "`fetch_trades_parallel` enables to fetch trades of given symbol and interval, also can filter conditions and minimum size. return `trades_df`\n",
"`aggregate_trades` acceptss `trades_df` and ressolution and type of bars (VOLUME, TIME, DOLLAR) and return aggregated ohlcv dataframe `ohlcv_df`" "`aggregate_trades` acceptss `trades_df` and ressolution and type of bars (VOLUME, TIME, DOLLAR) and return aggregated ohlcv dataframe `ohlcv_df`"
@@ -1594,7 +1594,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.10" "version": "3.10.11"
} }
}, },
"nbformat": 4, "nbformat": 4,
+3 -2
View File
@@ -43884,7 +43884,8 @@
"# ))\n", "# ))\n",
"\n", "\n",
"# thirtymin_slope_to_compare.vbt.plot(fig=fig, add_trace_kwargs=dict(secondary_y=True), trace_kwargs=dict(name=\"30min slope\",\n", "# thirtymin_slope_to_compare.vbt.plot(fig=fig, add_trace_kwargs=dict(secondary_y=True), trace_kwargs=dict(name=\"30min slope\",\n",
"# line=dict(color=\"yellow\"), \n", "# line=dict(color=\"yellow\"),\n",
" \n",
"# fill=None,\n", "# fill=None,\n",
"# connectgaps=True,\n", "# connectgaps=True,\n",
"# ))\n", "# ))\n",
@@ -44661,7 +44662,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.10" "version": "3.10.11"
} }
}, },
"nbformat": 4, "nbformat": 4,
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-107
View File
@@ -1,107 +0,0 @@
# Plotly
* MAKE_SUBPLOT Defines layout (if more then 1x1 or secondary y axis are required)
```python
fig = vbt.make_subplots(rows=2, cols=1, shared_xaxes=True,
specs=[[{"secondary_y": True}], [{"secondary_y": False}]],
vertical_spacing=0.02, subplot_titles=("Row 1 title", "Row 2 title"))
```
Then the different [sr/df generic accessor](http://5.161.179.223:8000/static/js/vbt/api/generic/accessors/index.html#vectorbtpro.generic.accessors.GenericAccessor.areaplot) are added with ADD_TRACE_KWARGS and TRACE_KWARGS. Other types of plot available in [plotting module](http://5.161.179.223:8000/static/js/vbt/api/generic/plotting/index.html)
```python
#using accessor
close.vbt.plot(fig=fig, add_trace_kwargs=dict(secondary_y=False,row=1, col=1), trace_kwargs=dict(line=dict(color="blue")))
indvolume.vbt.barplot(fig=fig, add_trace_kwargs=dict(secondary_y=False, row=2, col=1))
#using plotting module
vbt.Bar(indvolume, fig=fig, add_trace_kwargs=dict(secondary_y=False, row=2, col=1))
```
* ADD_TRACE_KWARGS - determines positioning withing subplot
```python
add_trace_kwargs=dict(secondary_y=False,row=1, col=1)
```
* TRACE_KWARGS - other styling of trace
```python
trace_kwargs=dict(name="LONGS",
line=dict(color="#ffe476"),
marker=dict(color="limegreen"),
fill=None,
connectgaps=True)
```
## Example
```python
fig = vbt.make_subplots(rows=2, cols=1, shared_xaxes=True,
specs=[[{"secondary_y": True}], [{"secondary_y": False}]],
vertical_spacing=0.02, subplot_titles=("Price and Indicators", "Volume"))
# Plotting the close price
close.vbt.plot(fig=fig, add_trace_kwargs=dict(secondary_y=False,row=1, col=1), trace_kwargs=dict(line=dict(color="blue")))
```
# Data
## Resampling
```python
t1data = basic_data[['open', 'high', 'low', 'close', 'volume','vwap','buyvolume','sellvolume']].resample("1T")
t1data = t1data.transform(lambda df: df.between_time('09:30', '16:00').dropna()) #main session data only, no nans
t5data = basic_data[['open', 'high', 'low', 'close', 'volume','vwap','buyvolume','sellvolume']].resample("5T")
t5data = t5data.transform(lambda df: df.between_time('09:30', '16:00').dropna())
dailydata = basic_data[['open', 'high', 'low', 'close', 'volume', 'vwap']].resample("D").dropna()
#realign 5min close to 1min so it can be compared with 1min
t5data_close_realigned = t5data.close.vbt.realign_closing("1T").between_time('09:30', '16:00').dropna()
#same with open
t5data.open.vbt.realign_opening("1h")
```
### Define resample function for custom column
Example of custom feature config [Binance Data](http://5.161.179.223:8000/static/js/vbt/api/data/custom/binance/index.html#vectorbtpro.data.custom.binance.BinanceData.feature_config).
Other [reduced functions available](http://5.161.179.223:8000/static/js/vbt/api/generic/nb/apply_reduce/index.html). (mean, min, max, median, nth ...)
```python
from vectorbtpro.utils.config import merge_dicts, Config, HybridConfig
from vectorbtpro import _typing as tp
from vectorbtpro.generic import nb as generic_nb
_feature_config: tp.ClassVar[Config] = HybridConfig(
{
"buyvolume": dict(
resample_func=lambda self, obj, resampler: obj.vbt.resample_apply(
resampler,
generic_nb.sum_reduce_nb,
)
),
"sellvolume": dict(
resample_func=lambda self, obj, resampler: obj.vbt.resample_apply(
resampler,
generic_nb.sum_reduce_nb,
)
)
}
)
basic_data._feature_config = _feature_config
```
### Validate resample
```python
t2dataclose = t2data.close.rename("15MIN - realigned").vbt.realign_closing("1T")
fig = t1data.close.rename("1MIN").vbt.plot()
t2data.close.rename("15MIN").vbt.plot(fig=fig)
t2dataclose.vbt.plot(fig=fig)
```
## Persisting
```python
basic_data.to_parquet(partition_by="day", compression="gzip")
day_data = vbt.ParquetData.pull("BAC", filters=[("group", "==", "2024-05-03")])
vbt.print_dir_tree("BTC-USD")#overeni directory structure
```
# Discover
```python
vbt.phelp(vbt.talib(atr).run) #parameters it accepts
vbt.pdir(pf) - get available properties and methods
vbt.pprint(basic_data) #to get correct shape, info about instance
```
+2 -2
View File
@@ -1,3 +1,3 @@
API_KEY = '' API_KEY = 'PKGGEWIEYZOVQFDRY70L'
SECRET_KEY = '' SECRET_KEY = 'O5Kt8X4RLceIOvM98i5LdbalItsX7hVZlbPYHy8Y'
MAX_BATCH_SIZE = 1 MAX_BATCH_SIZE = 1
+1 -1
View File
@@ -32,7 +32,7 @@ PROFILING_OUTPUT_DIR = DATA_DIR
#NALOADUJEME DOTENV ENV VARIABLES #NALOADUJEME DOTENV ENV VARIABLES
if load_dotenv(ENV_FILE, verbose=True) is False: if load_dotenv(ENV_FILE, verbose=True) is False:
print(f"Error loading.env file {ENV_FILE}. Now depending on ENV VARIABLES set externally.") raise Exception(f"Error loading.env file {ENV_FILE}")
else: else:
print(f"Loaded env variables from file {ENV_FILE}") print(f"Loaded env variables from file {ENV_FILE}")
+1 -20
View File
@@ -18,7 +18,6 @@ from fastapi.security import HTTPBasic, HTTPBasicCredentials
from v2realbot.enums.enums import Env, Mode from v2realbot.enums.enums import Env, Mode
from typing import Annotated from typing import Annotated
import os import os
import psutil
import uvicorn import uvicorn
import orjson import orjson
from queue import Queue, Empty from queue import Queue, Empty
@@ -1026,25 +1025,7 @@ def get_metadata(model_name: str):
# "last_modified": os.path.getmtime(model_path), # "last_modified": os.path.getmtime(model_path),
# # ... other metadata fields ... # # ... other metadata fields ...
# } # }
@app.get("/system-info")
def get_system_info():
"""Get system info, e.g. disk free space, used percentage ... """
disk_total = round(psutil.disk_usage('/').total / 1024**3, 1)
disk_used = round(psutil.disk_usage('/').used / 1024**3, 1)
disk_free = round(psutil.disk_usage('/').free / 1024**3, 1)
disk_used_percentage = round(psutil.disk_usage('/').percent, 1)
# memory_total = round(psutil.virtual_memory().total / 1024**3, 1)
# memory_perc = round(psutil.virtual_memory().percent, 1)
# cpu_time_user = round(psutil.cpu_times().user,1)
# cpu_time_system = round(psutil.cpu_times().system,1)
# cpu_time_idle = round(psutil.cpu_times().idle,1)
# network_sent = round(psutil.net_io_counters().bytes_sent / 1024**3, 6)
# network_recv = round(psutil.net_io_counters().bytes_recv / 1024**3, 6)
return {"disk_space": {"total": disk_total, "used": disk_used, "free" : disk_free, "used_percentage" : disk_used_percentage},
# "memory": {"total": memory_total, "used_percentage": memory_perc},
# "cpu_time" : {"user": cpu_time_user, "system": cpu_time_system, "idle": cpu_time_idle},
# "network": {"sent": network_sent, "received": network_recv}
}
# Thread function to insert data from the queue into the database # Thread function to insert data from the queue into the database
def insert_queue2db(): def insert_queue2db():
-21
View File
@@ -131,29 +131,9 @@
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.41.0/min/vs/editor/editor.main.js"></script> --> <!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.41.0/min/vs/editor/editor.main.js"></script> -->
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.41.0/min/vs/loader.min.js"></script> --> <!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.41.0/min/vs/loader.min.js"></script> -->
<script src="/static/js/systeminfo.js"> </script>
</head> </head>
<body> <body>
<div id="main" class="mainConteiner flex-container content"> <div id="main" class="mainConteiner flex-container content">
<div id="system-info" class="flex-items">
<label data-bs-toggle="collapse" data-bs-target="#system-info-inner" aria-expanded="true">
<h4>System Info </h4>
</label>
<div id="system-info-inner" class="collapse">
<div id="system-info-output"></div>
<div id="graphical-output">
<div id="disk-gauge-container">
<span id="title"> Disk Space: </span>
<span id="free-space">Free: -- GB</span> |
<span id="total-space">Total: -- GB</span> |
<span id="used-percent">Used: -- %</span>
<div id="disk-gauge">
<div id="disk-gauge-bar"></div>
</div>
</div>
</div>
</div>
</div>
<div id="chartContainer" class="flex-items"> <div id="chartContainer" class="flex-items">
<label data-bs-toggle="collapse" data-bs-target="#chartContainerInner" aria-expanded="true"> <label data-bs-toggle="collapse" data-bs-target="#chartContainerInner" aria-expanded="true">
<h4>Chart</h4> <h4>Chart</h4>
@@ -250,7 +230,6 @@
<!-- <table id="trades-data-table" class="dataTable no-footer" style="width: 300px;display: contents;"></table> --> <!-- <table id="trades-data-table" class="dataTable no-footer" style="width: 300px;display: contents;"></table> -->
</div> </div>
</div> </div>
<div id="runner-table" class="flex-items"> <div id="runner-table" class="flex-items">
<label data-bs-toggle="collapse" data-bs-target="#runner-table-inner"> <label data-bs-toggle="collapse" data-bs-target="#runner-table-inner">
<h4>Running Strategies</h4> <h4>Running Strategies</h4>
-31
View File
@@ -1,31 +0,0 @@
function get_system_info() {
console.log('Button get system status clicked')
$.ajax({
url: '/system-info',
type: 'GET',
beforeSend: function (xhr) {
xhr.setRequestHeader('X-API-Key',
API_KEY); },
success: function(response) {
$.each(response, function(index, item) {
if (index=="disk_space") {
$('#disk-gauge-bar').css('width', response.disk_space.used_percentage + '%');
$('#free-space').text('Free: ' + response.disk_space.free + ' GB');
$('#total-space').text('Total: ' + response.disk_space.total + ' GB');
$('#used-percent').text('Used: ' + response.disk_space.used_percentage + '%');
} else {
var formatted_item = JSON.stringify(item, null, 4)
$('#system-info-output').append('<p>' + index + ': ' + formatted_item + '</p>');
}
});
},
error: function(xhr, status, error) {
$('#disk-gauge-bar').html('An error occurred: ' + error + xhr.responseText + status);
}
});
}
$(document).ready(function(){
get_system_info()
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More