Collection of publicly available strategies and trading bots for trading bitcoin futures on delta.
This module supports Python 3.5 and later.
Delta is not responsible for any losses incurred when using this code. This code is intended for sample purposes ONLY - do not use this code for real trades unless you fully understand what it does and what its caveats are.
Develop on Testnet first!
-
Create a Testnet Delta account and deposit some BTC
-
Create a new virtualenv and install dependencies
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
- create a log folder
mkdir log
Market Makers profit by charging higher offer prices than bid prices. The difference is called the ‘spread’. The spread compensates the market makers for the risk inherited in such trades. The risk is the price movement against the market makers trading position.
-
You can create multiple configurations for multiple running instances. Lets create a configuration for running the bot on testnet
-
Copy
config/.env.sample
toconfig/.env.testnet
. You can tweak settings here. -
Edit
config/accounts.json
to enter your account credentials. -
From the root folder, Pass the environment and run
strategy_runner.py
-
You can also run your strategy from pm2, add your bot configurations in
ecosystem.config.js
pm2 start ecosystem.config.js --only=MyBot
- Writing your own custom strategy is super easy. Just refer to
market_maker/custom_strategy.py
- Once you define your custom_strategy, add it in strategy runner.
from market_maker.custom_strategy import CustomStrategy
mm = CustomStrategy()
mm.run_loop()