A hedge scalping strategy based on directional analysis using a quantitative approach
- Dashboard: https://tradesimple.xyz
- APIv2: http://api.tradesimple.xyz/data/quantdatav2.json
Directional Scalper | API Scraper | Dashboard | Directional Scalper Multi | Menu GUI |
---|---|---|---|---|
- Clone the repo
git clone https://github.com/donewiththedollar/directionalscalper.git
- Install requirements
pip3.11 install -r requirements.txt
- Add API key(s) to config.json in /configs folder
- Run the bot
python3.11 multi_bot.py --config config.json
to display the menu - Multi bot auto symbol rotator strategy example:
python3.11 multi_bot.py --exchange bybit --strategy bybit_mfirsi_trend_rotator --config config.json
- Old single coin strategy example:
python3.11 bot.py --exchange bybit --symbol DOGEUSDT --strategy bybit_auto_hedge_maker_v2 --config config.json
Bybit, Binance, Bitget, Huobi
Exchanges that are WIP: MEXC, Phemex
- Run multi_bot
python3.11 multi_bot.py
or with argumentspython3.11 multi_bot.py --exchange bybit --strategy bybit_mfirsi_trend_rotator --config config.json
- Start a tmux session
tmux new -s dash
- Inside the tmux session, ensure you are in project directory and
streamlit run dashboard.py
- If you are having issues, you may have not ran
pip3.11 install -r requirements.txt
again as requirements have changed in recent revisions.
Steps to set up Directionalscalper v2
sudo apt-get update
sudo apt-get upgrade -y
git clone https://github.com/donewiththedollar/directionalscalper.git
Now you have the bot but you must install Python 3.11
Here is how you can install Python 3.11 from source:
All of these commands one by one copy and pasted into terminal:
wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz
tar -xvf Python-3.11.0.tgz
cd Python-3.11.0
-
sudo apt-get update
-
sudo apt-get install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev
-
./configure --enable-optimizations
-
make
-
sudo make altinstall
-
python3.11 --version
After typing python3.11 —version, it should display that you have python3.11 installed
Now install PIP
-
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
-
pip3.11 -V
This pip3.11 -V should show you have pip3.11 installed, no error.
Starting the bot for the first time making sure it works
Make sure you are in the directory directionalscalper
so cd ~/directionalscalper should bring you there if you are not already there.
Run these:
pip3.11 install -r requirements.txt
Modify your config_example.json file with your bitget API keys and then run this:
python3.11 bot.py --exchange bybit --symbol SUIUSDT --strategy bybit_hedge_mfirsi_maker --config config_bybit_sub1.json
or a different exchange:
python3.11 bot.py --exchange bitget --symbol OPUSDT_UMCBL --strategy bitget_hedge_dynamic --config config_example.json
- Create
config.json
fromconfig.example.json
in /configs directory - Enter exchange_api_key and exchange_api_secret
- Check/fill all other options. For telegram/discord see below
python3.11 multi_bot.py --config config_name.json
python3.11 multi_bot.py (no params opens menu) python3.11 multi_bot.py --exchange bybit --strategy bybit_mfirsi_trend_rotator --config config_name.json python3.11 multi_bot.py --exchange bybit --strategy bybit_rotator_aggressive --config config_name.json
python3.11 bot.py --exchange bybit --symbol SUIUSDT --strategy bybit_hedge_mfirsi_maker --config config_bybit_sub1.json
python3.11 bot.py --exchange bitget --symbol XRPUSDT_UMCBL --amount 15 --strategy bitget_hedge --config config_main.json
python3.11 bot.py --exchange huobi --strategy huobi_auto_hedge --account_name account_4 --amount 1 --symbol DOGEUSDT --config config.json
- Example of starting a different strategy. In this example amount is not needed, as it is dynamic based on minimum required by Bitget.
python3.11 bot.py --exchange bitget --symbol XRPUSDT_UMCBL --strategy bitget_hedge_dynamic --config config_main.json
- binance_auto_hedge
- bybit_hedge
- bybit_auto_hedge - Dynamic entry, take profit distance, position leverage per side. Table included.
- bybit_auto_hedge_maker
- bybit_hedge_mfirsi_maker - MFI, RSI, ERI, MA for entry. Pure maker, dynamic entry size, dynamic take profit based on 5m spread
- bybit_hedge_mfirsionly_maker - MFIRSI only as entry. Pure maker, dynamic entry size, dynamic take profit based on 5m spread
- bybit_longonly
- bybit_shortonly
- bybit_longonly_dynamic_leverage
- bybit_shortonly_dynamic_leverage
- bitget_hedge
- bitget_hedge_dynamic
- bitget_longonly_dynamic
- bitget_shortonly_dynamic
- huobi_hedge
- huobi_auto_hedge
--config', type=str, default='config.json', help='Path to the configuration file')
--exchange', type=str, help='The name of the exchange to use')
--strategy', type=str, help='The name of the strategy to use')
--symbol', type=str, help='The trading symbol to use')
--amount', type=str, help='The size to use')
To run the bot inside docker container use the following command:
docker-compose run directional-scalper python3.11 bot.py --symbol SUIUSDT --strategy bybit_hedge_mfirsi_maker --config config_main.json
If you need to use a proxy to access the Exchange API, you can set the environment variables as shown in the following example:
$ export HTTP_PROXY="http://10.10.1.10:3128" # these proxies won't work for you, they are here for example
$ export HTTPS_PROXY="http://10.10.1.10:1080"
- Get token from botfather after creating new bot, send a message to your new bot
- Go to https://api.telegram.org/bot<bot_token>/getUpdates
- Replacing <bot_token> with your token from the botfather after creating new bot
- Look for chat id and copy the chat id into config.json
- Install developer requirements from pipenv
pipenv install --dev
(to keep requirements in a virtual environment) - Install pre-commit hooks
pre-commit install
(if you intend to commit code to the repo) - Run pytest
pytest -vv
(if you have written any tests to make sure the code works as expected)
- A lot of top secret cutting edge stuff
- Binance, Phemex, MEXC base. (MEXC Futs API down until Q4)
Funds acquired through contributions will be judiciously allocated towards the maintenance and enhancement of our API server infrastructure. This financial support is instrumental in ensuring seamless operations, while also facilitating continuous improvements to our broader network infrastructure.
- BTC: bc1q9hyvvtcsm0k39svz59hjgz4f6dr6c2k4wlrxmc
- USDT (ERC20): 0xb40b2842d4ce93e31CFC8DC2629E2Bd426e4b87E