Code Monkey home page Code Monkey logo

dca-btc-bot's Introduction

DCA Bitcoin Bot

Simple bot that buys bitcoin in Buda.com following the Dollar Cost Averaging (DCA) strategy.

Getting Started

To get the bot working, first, you need to clone the repo.

git clone https://github.com/aamatte/dca-btc-bot.git

Create a secrets.yml file.

credentials:
  Buda:
    key: 'do not share your keys'
    secret: 'do not share your keys'
  Currencyconverter:
    key: 'do not share your keys'
  OpenExchangeRates:
    app_id: 'do not share your keys'

Adjust your settings in settings.yml. You have to edit:

...

investment:
  market: 'BTCCLP'  # Market this bot will be buying at buda.com
  ref_exchange: 'Bitstamp'  # Exchange used for reference price
  ref_market: 'BTCUSD' # Market used at reference exchange for price
  interval_hours: 2  # Hour interval when the bot tries to buy
  monthly_amount: 300000  # Monthly investment in quote amount
  overprice_limit: 0.03  # Max overprice allowed in percentage where 0.03 means 3%
currency_converter: 'OpenExchangeRates'  # Name of currency converter to use
withdrawal:
  enabled: False  # Enable or disable feature, boolean
  address: '1soveryfakeaddressreplacemepleace'  # Address where funds will be withdrawn
  min_amount: 30000  # Minimum amount to withdraw
  amount_currency: 'CLP'  # Currency defined for amount calculations

...

Finally, if you want to run the bot.

pipenv install
pipenv shell
python bots.py run buda

That will run the bot in dry_run mode (it won't place any order). Once you are sure everything is correct, in settings.yml set:

dry_run: False

Prerequisites

You need to have installed python3.7 and pipenv.

Deployment

You can run the bot every 2-5 minutes with a cron job.

crontab -e

At the end of the file put something like this:

*/2 * * * * cd ~/dca-btc-bot && /usr/local/bin/pipenv run ~/dca-btc-bot/bots.py run buda >> ~/dca-btc-bot/log.log 2>&1

That will run the bot every 2 minutes.

Built With

Contributing

Please read CONTRIBUTING.md for details on the code of conduct, and the process for submitting pull requests.

License

MIT

dca-btc-bot's People

Contributors

aamatte avatar delta575 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.