Giter VIP home page Giter VIP logo

-calper's Introduction

Directional Scalper

A hedge scalping strategy based on directional analysis using a quantitative approach

GitHub Pipenv locked Python version License: MIT Code style: black

Supports Bybit only, other exchanges coming soon

Links

Directional Scalper API Scraper

Quickstart

  • Clone the repo git clone https://github.com/donewiththedollar/directionalscalper.git
  • Install requirements pip3 install -r requirements.txt

Setting up the bot

  1. Create config.json from config.example.json in /config directory

  2. Enter exchange_api_key and exchange_api_secret

  3. Check/fill all other options. For telegram see below

  4. Get token from botfather after creating new bot, send a message to your new bot

  5. Go to https://api.telegram.org/bot<bot_token>/getUpdates

  6. Replacing <bot_token> with your token from the botfather after creating new bot

  7. Look for chat id and copy the chat id into config.json

Starting the bot

  • Hedge mode is recommended, but you can of course use the other modes as well. Low lot size is recommended.

python3 bot.py --mode hedge --symbol GALAUSDT --iqty 1 --tg off --config config.json --avoidfees on

  • Starting the bot in violent mode is not recommended, but ensures violent profit taking while putting you at risk of liquidation depending on your wallet_exposure and violent_multiplier

python3 bot.py --mode violent --symbol OPUSDT --iqty 0.1 --tg off --config config.json --avoidfees on

  • Starting the bot in debug mode for inverse perpetuals BTCUSD
  • Inverse is currently short only, used as a hedge against your BTC balance, to accumulate BTC with no risk, no losses

python3 bot_inverse_debugmode.py --mode inverse --symbol BTCUSD --iqty 1 --tg off

Modes

  • --mode [hedge, aggressive, violent, long, short, longbias, btclinear-long, btclinear-short]

Some (most) modes are in development, hedge mode is the recommended mode that has proven to be profitable and allows you to control your risk accordingly.

Parameters

--avoidfees [on, off] --deleverage [on, off]

  • only use one or the other [avoidfees, or deleverage], deleverage is incremental TP, while avoidfees is incremental TP including the taker fees.

Docker

To run the bot inside docker container use the following command:

docker-compose run directional-scalper python3 bot.py --mode hedge --symbol GALAUSDT --iqty 1 --tg off

  • There are six working modes:

long, short, hedge, aggressive, inverse, violent

Developer instructions

  • 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)

To do:

  • Instance manager
  • Auto calculation for violent parameters (violent_multiplier and wallet_exposure are key)
  • Auto calculation for lot size so the user does not have to determine size
  • Refactor so the main bot is not thousands of lines of code :)

Donations

If you would like to show your appreciation for this project through donations, there are a few addresses here to choose from

  • BTC: bc1q9hyvvtcsm0k39svz59hjgz4f6dr6c2k4wlrxmc

-calper's People

Contributors

bgizdov avatar donewiththedollar avatar ecoppen avatar krishna3114 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.