Giter Site home page Giter Site logo

ali-raheem / kraken-trailing-bot Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 2.0 48 KB

Bot to manage trailing stop loss orders on Kraken.

License: GNU General Public License v3.0

Python 100.00%
trading-bot kraken kraken-exchange-api kraken-platform cryptocurrency

kraken-trailing-bot's Introduction

Kraken Trailing Bot

DISCLAIMER: I am not responsible for your lost money, or any trouble you get into to. I have lost LOADS of money with this, bugs can potentially cost you dearly. You have been warned.

Description

This bot takes a currency pair and an amount to trade and an "offset". It monitors the market and manages a stop-loss trade which is maintained no lower than the peak - some offset.

This means you can have a stop loss order but take advantages of gains.

Please familiarise yourself with the Kraken API docs. Especially the call rate limit which is part of the how not to be banned rules! Don't annoy Kraken with this.

Issues

Not a complete list:

  • I'm not entirely sure the database mangement works, you might be better off deleting orders.sqlite if all the orders are done
  • Really needs cleaning up
  • I think there are race conditions in the orders being dealt with
  • State -1 (error) is not yet implemented.
  • Buy and take-profit types would also be good.

TODO

Issues I really care about

  • Make it take command line arguments to add new orders?
  • Make it more failsafe see note in code.
  • Web monitor?

Dependencies

Usage

Typically trialing stop-loss orders are used when you already have some gains. Add to the sqlite db a new order (status = 2) with the amount, currency pair and ticker symbol etc.

Now the bot should make a stop-loss sell order at the last price - offset and with each run will monitor it.

You must have an API key which allows trading. Duh!. Put this key in kraken.key key on the first line and then the secret on the second line. See the Krakenex library for more details.

Running

This is how I run on my Raspbian:

while true; do
	python3 KrakenTB2.py
	sleep 15
done

I'm pretty sure it could run much more often as the only API call to raise the rate counter is OpenOrders (I think this raises it 1).

License

GPLv3

kraken-trailing-bot's People

Contributors

ali-raheem avatar

Stargazers

 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.