Giter Club home page Giter Club logo

binance-dca's Introduction

FreePalestine.Dev

Binance Dollar cost averaging (DCA)

Python package

This Package serves as an easy to use/setup python package to schedule market buy orders with a pre defined frequency.

screenshot

DCA

Dollar cost averaging (DCA) is an investment strategy that aims to apply value investing principles to regular investment. The term was first coined by Benjamin Graham in his book The Intelligent Investor. Graham writes that dollar cost averaging "means simply that the practitioner invests in common stocks the same number of dollars each month or each quarter. In this way he buys more shares when the market is low than when it is high, and he is likely to end up with a satisfactory overall price for all his holdings."

From Wikipedia, the free encyclopedia

How to use

Simple Example

from ba_dca.dca import DCA
from ba_dca.order import Order,Frequency
dca = DCA()
# Create Two orders which has same start time, but different frequency
order1 = Order("BTCUSDT", 10, Frequency.DAILY)
order2 = Order("ETHUSDT", 10, Frequency.WEEKLY)
dca.add_order(order1)
dca.add_order(order2)
dca.run()
>>> 
Executing new order
[{'price': '29113.07000000', 'qty': '0.00034300', 'commission': '0.00000000', 'commissionAsset': 'BTC', 'tradeId': 280829}]
Executing new order
[{'price': '1821.89000000', 'qty': '0.00548000', 'commission': '0.00000000', 'commissionAsset': 'ETH', 'tradeId': 157282}]
Executing new order
[{'price': '29113.07000000', 'qty': '0.00034300', 'commission': '0.00000000', 'commissionAsset': 'BTC', 'tradeId': 280830}]
Executing new order
[{'price': '1821.89000000', 'qty': '0.00548000', 'commission': '0.00000000', 'commissionAsset': 'ETH', 'tradeId': 157288}]
Executing new order
[{'price': '29113.07000000', 'qty': '0.00034300', 'commission': '0.00000000', 'commissionAsset': 'BTC', 'tradeId': 280833}]
Executing new order
[{'price': '1821.89000000', 'qty': '0.00548000', 'commission': '0.00000000', 'commissionAsset': 'ETH', 'tradeId': 157292}]

Custom frequency

from ba_dca.dca import DCA
from ba_dca.order import Order,Frequency
from datetime import datetime
from dateutil.relativedelta import relativedelta
dca = DCA()
# Create an order which will be executed with frequency (1 month + 1 week + 2 days)
freq1 = relativedelta(days=+2,weeks=+1,months=1)
order1 = Order("BTCUSDT", 10, freq1)
dca.add_order(order1)
dca.run()

binance-dca's People

Contributors

hemaz avatar

Watchers

 avatar

binance-dca's Issues

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.