Giter Site home page Giter Site logo

dca's Introduction

Weighted Dollar Cost Average (WDCA)

alt dca_front Each red arrow represent a buying step.

The idea of this this algorithm is to smooth the entrance fee. It will buy all the new lows by weighting them.

For example :

The first buy will cost 10$. The second will cost 11$. The goal to increment the amount to invest is to attrack the price down to the bottom.

It buy only the lower price, if the price increases, we will count each candle between the last low and the new low and we make the sum of it.

For example, if at each candle it increments to 1$ and it starts to 10$ :

  • price : 9, 8, 13, 10, 9, 7
  • invest : 10, 11, 0(12), 0(13), 0(14), 12+13+14+15 => when the price is 7$, it invests 54$ (12+13+14+15).

Install

make install

Run all tests

make tests

Run in development mode

make run

Deploy to production

Configure application

make generate-configuration

setup dca_configuration_production.json file:

  • price_initialisation: the price/amount of the first investment
  • step_price: the price increase each iteration. For example, for the third iteration, price_initialisation + 3 - 1 * step_price will be invested.
  • traded_pair : the pair to trade (ETHEUR, BTCEUR, XBTUSDC)
  • force_buy_under_price (optional): under this price each iteration is bought
  • max_amount_to_spend (optional): the maximum amount to spend each iteration
  • max_total_amount_to_spend (optional): the total maximum to spend

json dca configuration:

{
  "price_initialisation": 10,
  "step_price": 1,
  "traded_pair": "XBTEUR",
  "force_buy_under_price": 20,
  "max_amount_to_spend": 10000,
  "max_total_amount_to_spend": 1000
}

Add secret key for the kraken broker

Add a kraken.key file with the first line the key, and the second line the secret key.

Add secret key for the telegram chat

Add a telegram.key file with the first line the chat_id, and the second line the secret key.

Run

Clear db if it is the first run

  • Run iteration manually

    make run-production
  • Scheduling execution with cron task

Add all this lines after crontab -e

  • “At 00:00 on Monday.” for the first line and “At 00:02 on Monday.” for the second and last lines

    0 0 * * 1 cd /home/pi/Documents/dca/ && make run-production >> log.txt 2>&1
    2 0 * * 1 cd /home/pi/Documents/dca/ && make backup-db >> log.txt 2>&1
    2 0 * * 1 cd /home/pi/Documents/dca/ && make copy-data-to-front >> log.txt 2>&1
    45 21 * * 0 cd /home/pi/Documents/dca/ && make pulse >> log.txt 2>&1

Display front

Copy the backups files in front > chart > data and add json extension to the files.

make run-front

Estimate configuration parameters

make projection

faq

dca's People

Contributors

scra3 avatar

Watchers

James Cloos 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.