Giter VIP home page Giter VIP logo

bewagner / kraken_api_dca Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 5.0 890 KB

If you're looking for a way to automate your regular crypto purchases via Kraken, you have come to the right place. The kraken_api_dca.py script allows you to specify orders in all trading pairs on Kraken. Just let your computer run the script at regular intervals and you have your automated Dollar-cost averaging bot.

License: GNU General Public License v3.0

Python 100.00%
cryptocurrency dca kraken investing

kraken_api_dca's People

Contributors

bewagner avatar cardano-blockhouse avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

kraken_api_dca's Issues

Market orders are never used

By reading the README I understood that markets orders were used by default and it would used limit order only for debug

But in the code, that's not what it does : it always uses limit orders and there is no way to change that from the configuration :

order_type: OrderType = OrderType.limit,

AttributeError: 'NoneType' object has no attribute 'utf8_mode'

Hi, noob here, I just tried the script and it seems to work great, however i get this error and can't work out what the issue is?

Any ideas?

Exception ignored in: <function Logger.del at 0x7fb2db4048>
Traceback (most recent call last):
File "/home/pi/kraken_api_dca/logger.py", line 26, in del
File "/usr/lib/python3.7/pathlib.py", line 1186, in open
File "/usr/lib/python3.7/_bootlocale.py", line 35, in getpreferredencoding
AttributeError: 'NoneType' object has no attribute 'utf8_mode'

Let user choose limit price in %

When making a new oder the user should be able to specify (in the json file) the % they want to open the order below the current price. That way you can still dca but use the market fluctuations to get a better price overall.

Error during setting Order, DCA Buy not possible

$ python3 kraken_api_dca.py 
Read the following orders from the orders.json file:
        - [pair: XXBTZEUR, amount_in_fiat: 100, debug: True]
        - [pair: XXBTZEUR, amount_in_fiat: 50, debug: True]
Start placing order [pair: XXBTZEUR, amount_in_fiat: 100, debug: True]
ORDER: pair: XXBTZEUR, amount in fiat: 100, style: buy, type: limitERROR: ['EOrder:Invalid price:XXBTZEUR price can only be specified up to 1 decimals.']

My orders.json:

[
  {
    "pair":"XXBTZEUR",
    "amount_in_fiat":100,
    "debug":true
  },
  {
    "pair":"XXBTZEUR",
    "amount_in_fiat":50,
    "debug":true
  }
]

Running with and without venv no change.
ERROR: ['EOrder:Invalid price:XXBTZEUR price can only be specified up to 1 decimals.']
Does it recognize the pair as price?


python3.8 -V
Python 3.8.10

Collecting krakenex==2.1.0
  Downloading krakenex-2.1.0.tar.gz (36 kB)
Collecting requests<3,>=2.18.2
  Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 1.2 MB/s 
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
     |████████████████████████████████| 138 kB 24.5 MB/s 
Collecting chardet<5,>=3.0.2
  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
     |████████████████████████████████| 178 kB 81.5 MB/s 
Collecting idna<3,>=2.5
  Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 2.8 MB/s 
Collecting certifi>=2017.4.17
  Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
     |████████████████████████████████| 145 kB 81.1 MB/s 
Using legacy setup.py install for krakenex, since package 'wheel' is not installed.
Installing collected packages: urllib3, chardet, idna, certifi, requests, krakenex
    Running setup.py install for krakenex ... done
Successfully installed certifi-2021.5.30 chardet-4.0.0 idna-2.10 krakenex-2.1.0 requests-2.25.1 urllib3-1.26.6

Unexpected Keyword argument "Data" when pulling prices.

Read the following orders from the orders.json file:
- [pair: XETHZUSD, amount_in_fiat: 100, debug: True]
- [pair: XXBTZUSD, amount_in_fiat: 200, debug: True]
Start placing order [pair: XETHZUSD, amount_in_fiat: 100, debug: True]
Traceback (most recent call last):
File "/Users/bm/Downloads/kraken_api_dca-main/kraken_api_dca.py", line 13, in
order.place(kraken, logger)
File "/Users/bm/Downloads/kraken_api_dca-main/order.py", line 49, in place
current_crypto_price = current_price(self.pair, kraken)
File "/Users/bm/Downloads/kraken_api_dca-main/price_calculation.py", line 11, in current_price
price_data = kraken.query_public('Ticker', data={'pair': pair})
TypeError: API.query_public() got an unexpected keyword argument 'data'

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.