Skip to content

Commit

Permalink
Merge pull request #33 from hummingbot/feat/directional_backtesting
Browse files Browse the repository at this point in the history
Feat/directional backtesting
  • Loading branch information
fengtality authored Jul 21, 2023
2 parents f71877d + 3905ed2 commit 813522a
Show file tree
Hide file tree
Showing 22 changed files with 1,082 additions and 98 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ __pycache__/
# C extensions
*.

*.ipynb

secrets.toml
.idea/*

Expand Down
2 changes: 2 additions & 0 deletions constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
CANDLES_DATA_PATH = "data/candles"
DOWNLOAD_CANDLES_CONFIG_YML = "hummingbot_files/scripts_configs/data_downloader_config.yml"
BOTS_FOLDER = "hummingbot_files/bot_configs"
DIRECTIONAL_STRATEGIES_PATH = "quants_lab/strategy/experiments"
OPTIMIZATIONS_PATH = "quants_lab/optimizations"
5 changes: 4 additions & 1 deletion environment_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ dependencies:
- sqlalchemy
- pip
- pip:
- ccxt
- streamlit
- watchdog
- plotly
Expand All @@ -17,5 +16,9 @@ dependencies:
- pandas_ta
- pyyaml
- commlib-py
- jupyter
- optuna
- optuna-dashboard
- streamlit-ace
- git+https://github.com/hummingbot/hbot-remote-client-py.git
- git+https://github.com/hummingbot/docker-manager.git
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,9 @@ color:
# The tick size is the frequency with which the clock notifies the time iterators by calling the
# c_tick() method, that means for example that if the tick size is 1, the logic of the strategy
# will run every second.
tick_size: 1.0
tick_size: 1.0

market_data_collection:
market_data_collection_enabled: true
market_data_collection_interval: 60
market_data_collection_depth: 20
194 changes: 194 additions & 0 deletions hummingbot_files/bot_configs/data_downloader/conf_client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
####################################
### client_config_map config ###
####################################

instance_id: e90c0d6f2b1e2d54fa0c0a69612b07174320963b

log_level: INFO

debug_console: false

strategy_report_interval: 900.0

logger_override_whitelist:
- hummingbot.strategy.arbitrage
- hummingbot.strategy.cross_exchange_market_making
- conf

log_file_path: /home/hummingbot/logs

kill_switch_mode: {}

# What to auto-fill in the prompt after each import command (start/config)
autofill_import: disabled

telegram_mode: {}

# MQTT Bridge configuration.
mqtt_bridge:
mqtt_host: localhost
mqtt_port: 1883
mqtt_username: ''
mqtt_password: ''
mqtt_namespace: hbot
mqtt_ssl: false
mqtt_logger: true
mqtt_notifier: true
mqtt_commands: true
mqtt_events: true
mqtt_external_events: true
mqtt_autostart: true

# Error log sharing
send_error_logs: true

# Can store the previous strategy ran for quick retrieval.
previous_strategy: null

# Advanced database options, currently supports SQLAlchemy's included dialects
# Reference: https://docs.sqlalchemy.org/en/13/dialects/
# To use an instance of SQLite DB the required configuration is
# db_engine: sqlite
# To use a DBMS the required configuration is
# db_host: 127.0.0.1
# db_port: 3306
# db_username: username
# db_password: password
# db_name: dbname
db_mode:
db_engine: sqlite

pmm_script_mode: {}

# Balance Limit Configurations
# e.g. Setting USDT and BTC limits on Binance.
# balance_asset_limit:
# binance:
# BTC: 0.1
# USDT: 1000
balance_asset_limit:
kucoin: {}
ciex: {}
ascend_ex_paper_trade: {}
crypto_com: {}
mock_paper_exchange: {}
btc_markets: {}
bitmart: {}
hitbtc: {}
loopring: {}
mexc: {}
polkadex: {}
bybit: {}
foxbit: {}
gate_io_paper_trade: {}
kucoin_paper_trade: {}
altmarkets: {}
ascend_ex: {}
bittrex: {}
probit_kr: {}
binance: {}
bybit_testnet: {}
okx: {}
bitmex: {}
binance_us: {}
probit: {}
gate_io: {}
lbank: {}
whitebit: {}
bitmex_testnet: {}
kraken: {}
huobi: {}
binance_paper_trade: {}
ndax_testnet: {}
coinbase_pro: {}
ndax: {}
bitfinex: {}

# Fixed gas price (in Gwei) for Ethereum transactions
manual_gas_price: 50.0

# Gateway API Configurations
# default host to only use localhost
# Port need to match the final installation port for Gateway
gateway:
gateway_api_host: localhost
gateway_api_port: '15888'

certs_path: /home/hummingbot/certs

# Whether to enable aggregated order and trade data collection
anonymized_metrics_mode:
anonymized_metrics_interval_min: 15.0

# Command Shortcuts
# Define abbreviations for often used commands
# or batch grouped commands together
command_shortcuts:
- command: spreads
help: Set bid and ask spread
arguments:
- Bid Spread
- Ask Spread
output:
- config bid_spread $1
- config ask_spread $2

# A source for rate oracle, currently ascend_ex, binance, coin_gecko, kucoin, gate_io
rate_oracle_source:
name: binance

# A universal token which to display tokens values in, e.g. USD,EUR,BTC
global_token:
global_token_name: USD
global_token_symbol: $

# Percentage of API rate limits (on any exchange and any end point) allocated to this bot instance.
# Enter 50 to indicate 50%. E.g. if the API rate limit is 100 calls per second, and you allocate
# 50% to this setting, the bot will have a maximum (limit) of 50 calls per second
rate_limits_share_pct: 100.0

commands_timeout:
create_command_timeout: 10.0
other_commands_timeout: 30.0

# Tabulate table format style (https://github.com/astanin/python-tabulate#table-format)
tables_format: psql

paper_trade:
paper_trade_exchanges:
- binance
- kucoin
- ascend_ex
- gate_io
paper_trade_account_balance:
BTC: 1.0
USDT: 1000.0
ONE: 1000.0
USDQ: 1000.0
TUSD: 1000.0
ETH: 10.0
WETH: 10.0
USDC: 1000.0
DAI: 1000.0

color:
top_pane: '#000000'
bottom_pane: '#000000'
output_pane: '#262626'
input_pane: '#1C1C1C'
logs_pane: '#121212'
terminal_primary: '#5FFFD7'
primary_label: '#5FFFD7'
secondary_label: '#FFFFFF'
success_label: '#5FFFD7'
warning_label: '#FFFF00'
info_label: '#5FD7FF'
error_label: '#FF0000'
gold_label: '#FFD700'
silver_label: '#C0C0C0'
bronze_label: '#CD7F32'

# The tick size is the frequency with which the clock notifies the time iterators by calling the
# c_tick() method, that means for example that if the tick size is 1, the logic of the strategy
# will run every second.
tick_size: 1.0
2 changes: 1 addition & 1 deletion hummingbot_files/compose_files/data-downloader-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"
services:
bot:
container_name: candles_downloader
image: dardonacci/hummingbot:development
image: hummingbot/hummingbot:development
volumes:
- "../../data/candles:/home/hummingbot/data"
- "../bot_configs/data_downloader/conf:/home/hummingbot/conf"
Expand Down
1 change: 0 additions & 1 deletion pages/2_🚀_Strategy_Performance.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import ccxt

import pandas as pd
import streamlit as st
Expand Down
Loading

0 comments on commit 813522a

Please sign in to comment.