Giter VIP home page Giter VIP logo

bitcoin-trading-dca's Introduction

Bitcoin investing using Dollar Cost Averaging strategy

This node script let you set a daily amount to invest on crypto currency (Bitcoin in this case) via the kraken crypto exchange.

Dollar Cost Averaging

Dollar-cost averaging (DCA) is an investment technique of buying a fixed dollar amount of a particular investment on a regular schedule, regardless of the share price. The investor purchases more shares when prices are low and fewer shares when prices are high.

Dollar Cost Averaging has being initially used in the stock market to pursue an investment on an higher number of stocks with the same amount spend, just by investing it in a longer period of time due to the volatility of the stocks.

In the case of crypto-currency is well known that the volatility of those assets is way higher than the traditional shares purchased in the stock market. This makes the Dollar Cost Averaging strategy well suited for this type of investments.

How you should choose investment amount and range

This highly depends on your risk level, in my case what I've done is set up a total investment amount. Let's say I want to invest 1000$ and I want to spread my investment for 3 months. I also know I want to invest daily to take advantage of the volatility of the bitcoin against the dollar.

1000 / (3 * 30) = 1000 / 90 = ~11$ / day

I will then setup my .env file

KRAKEN_KEY=myKrakenKeyHere
KRAKEN_SECRET=myKrakenSecretKeyHere
INVESTMENT_AMOUNT=11.11
ASSETS_PAIR=XXBTZEUR

Pre-requisites

In order to make it work you will need

  • A bitcoin wallet obviously. I've used a desktop/paper wallet Electrum
  • A way to exchange EUR with Bitcoins and other crypto-currencies. This repo uses Kraken Exchange
  • node.js 8
  • npm

Getting started

Once you have registered your bitcoin wallet, you have your kraken account with enough funds and you've installed node js, you can start

Clone the project locally

git clone github.com/0x13a/bitcoin-trading-dca && cd bitcoin-trading-dca

Install the dependencies

npm install

Run

This should be run once a day, every day, after lunch or setup a cronjob that runs it for you every day

node index.js

Serverless template

There is a serverless template that you can use if you want to deploy this to an aws lambda https://github.com/izifortune/bitcoin-trading-dca-serverless

Disclaimer

Dollar Cost Averaging is meant to be used as a long-term strategy. This does not mean that returns are guaranteed, it's an investment and it's on your own risk. The general idea of this is to be used as Buy, hold and don't watch too closely

bitcoin-trading-dca's People

Contributors

alkuhar avatar balinterdi avatar izifortune avatar bootandy avatar pirhoo avatar

Watchers

James Cloos avatar Abner Chou 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.