Skip to main content

trading bot framework for zaif exchange

Project description

chart_with_upwards_trend:algorithmic trading bot for zaif exchange

Python version PyPI version License: MIT

ZaifBot is a Pythonic algorithmic trading library that run on Zaif Exchange.
It is developed by using Python 3.5.3 and tested in Python 3.4, 3.5, 3.6.


  • Easy to use: Zaifbot is library for trading beginners, so designed simple.
  • Support all currency pairs dealt with Zaif Exchange
  • Technical indicators like SMA, EMA, Bollinger Bands, RSI, ADX
  • You don’t have to prepare market data. Zaifbot internal get data from zaif API
To get started with Zaifbot take a look at the tutorial and the full documentation.

Note: ZaifBot is unofficial library of Tech Bureau, Inc. Please use it at your own risk.


instaling with pip

After activating an isolated Python environment, run

$ pip install zaifbot

currently supported platforms includes:

  • Linux 64-bits
  • OSX 64-bits
  • Windows 64-bits

Note: if you use OSX, we assume homebrew is installed.


After installing Zaifbot, run

$ install_ta_lib
TA-Lib is open-source library of technical analysis indicators that ZaifBot is depending on.
This command install TA-Lib in your operating system.


$ init_database
When init_database command is executed,
db/zaifbot.db is created for SQLite and schema is migrated.
Your Trade records will be saved in this file.

Quick Start

See our getting started tutorial

The following code implements a simple trading algorithm using zaifbot

from import Strategy
from zaifbot.rules import Entry, Exit
from zaifbot.config import set_keys
from import last_price

# setting your Zaif API key
set_keys(key='your_key', secret='your_secret')

# creating rule to buy
class BuyWhenCheap(Entry):
    def can_entry(self):
        if last_price( < 25000:
            return True
        return False

# creating rule to exit
class ExitWhenPriceGoUp(Exit):
    def can_exit(self, trade):
        # 'trade' has the entry information
        current_price = last_price(
        if current_price > trade.entry_price + 5000:
            return True
        return False

my_entry = BuyWhenCheap(currency_pair='btc_jpy',
my_exit = ExitWhenPriceGoUp()

# strategy is an unite of automated trading
my_strategy = Strategy(entry_rule=my_entry,



If you have a question, or find a bug, feel free to open an issue.


Any kind of contributions are welcome.
Please contribute by following the steps below.
  1. Fork and clone this repository to your computer
  2. Run docker build -t zaifbot . to create development environment
  3. Edit source code and make pull request to depelop branch

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for zaifbot, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size zaifbot-0.0.8.tar.gz (6.3 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page