Code Monkey home page Code Monkey logo

blackbird's Introduction

Build Status Blackbird chat license

Blackbird Bitcoin Arbitrage

Introduction

Blackbird Bitcoin Arbitrage is a C++ trading system that does automatic long/short arbitrage between Bitcoin exchanges.

How It Works

Bitcoin is still a new and inefficient market. Several Bitcoin exchanges exist around the world and the bid/ask prices they propose can be briefly different from an exchange to another. The purpose of Blackbird is to automatically profit from these temporary price differences while being market-neutral.

Here is a real example where an arbitrage opportunity exists between Bitstamp (long) and Bitfinex (short):

Spread Example

At the first vertical line, the spread between the exchanges is high so Blackbird buys Bitstamp and short sells Bitfinex. Then, when the spread closes (second vertical line), Blackbird exits the market by selling Bitstamp and buying Bitfinex back.

Advantages

Unlike other Bitcoin arbitrage systems, Blackbird doesn't sell but actually short sells Bitcoin on the short exchange. This feature offers two important advantages:

  1. The strategy is always market-neutral: the Bitcoin market's moves (up or down) don't impact the strategy returns. This removes a huge risk from the strategy. The Bitcoin market could suddenly lose half its value that this won't make any difference in the strategy returns.

  2. The strategy doesn't need to transfer funds (USD or BTC) between Bitcoin exchanges. The buy/sell and sell/buy trading activities are done in parallel on two different exchanges, independently. Advantage: no need to deal with transfer latency issues.

More details about short selling and market neutrality can be found on issue #100.

Disclaimer

USE THE SOFTWARE AT YOUR OWN RISK. YOU ARE RESPONSIBLE FOR YOUR OWN MONEY. PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.

THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.

Code Information

The trade results are stored in CSV files and the detailed activity is stored in log files. New files are created every time Blackbird is started.

It is possible to automatically stop Blackbird after the next trade has closed by creating, at any time, an empty file named stop_after_notrade.

Blackbird uses functions written by René Nyffenegger to encode and decode base64.

How To Test Blackbird

Please make sure that you understand the disclaimer above if you want to test Blackbird with real money, and start with a small amount of money.

IMPORTANT: all your BTC accounts must be empty before starting Blackbird. Make sure that you only have USD on your accounts and no BTC.

It is never entirely safe to just tell Blackbird to use, say, $25 per exchange. You also need to only have $25 available on each of your trading accounts as well as 0 BTC. In this case, you are sure that even with a bug your maximum loss on an exchange won't be greater than $25 no matter what.

Note: on Bitfinex, your money has to be available on the Margin account.

Implemented Exchanges

Exchange Long Short Tested Note
Bitfinex
OKCoin their API now offers short selling: link here
Bitstamp
Gemini
Kraken Validation in progress. Shorting is currently in testing
EXMO New exchange from PR #336. Might be a scam
QuadrigaCX
GDAX Validation in progress. Shorting is not currently supported.

Potential Exchanges

Exchange Long Short Note
Poloniex BTC/USD trading not supported, BTC/USDT margin trading not supported
CEX.IO Implementation in progress
WEX
itBit
Bittrex Implementation in progress, BTC/USD not supported (coming soon.)
Binance Implementation in progress, BTC/USD not supported

If DemoMode=true, all the exchanges are shown in the log file.

If DemoMode=false, only the exchanges for which the credentials exist in blackbird.conf are used.

Credentials

For each of your exchange accounts, you need to create the API authentication keys. This is usually done in the Settings section of your accounts.

Then, you need to add your API keys into the file blackbird.conf. You need at least two exchanges and one of them should allow short selling. Never share this file as it will contain your personal exchange credentials!

Blackbird Parameters

Parameter Default Value Description
DemoMode true The demo mode will show the spreads but won't actually trade anything
Leg1 BTC The first leg of the traded pair. This leg is hedged against market risk
Leg2 USD The second leg of the traded pair. This leg is not hedged against market risk
UseFullExposure false When true, all the Leg2 exposure available on your accounts will be used. Otherwise, the amount defined by TestedExposure will be used. Note: the cash used for a trade will be the minimum of the two exchanges, minus 1.00% as a small margin: if there is $1,000 on the first account and $1,100 on the second one, $990 will be used for each exchange, i.e. $1,000 - (1% * $1,000). The exposure is $1,980
TestedExposure 25 If UseFullExposure is false, that parameter defines the USD amount that will be used. The minimum has to be $10 otherwise some exchanges might reject the orders
MaxExposure 25,000 Maximum exposure per exchange. If the limit is $25,000 then Blackbird won't send any order larger than that on each exchange
MaxLength 5,184,000 The maximum length of a trade in number of iterations. If this value is reached then Blackbird will exit the market regardless of the spread. Warning: with this value, the system can exit with a loss so It's recommended to use a large value. The default is 180 days with GapSec at 3 seconds
DebugMaxIteration 3,200,000 The maximum number of iteration. Once DebugMaxIteration is reached Blackbird is terminated with return=0. Useful for troubleshooting the software
Verbose true Write the bid/ask and then spreads to the log file at every iteration. The log file size will be larger but it will show how Blackbird analyses the spreads
Interval 3 sec. Timelapse in seconds of an iteration. By default, the quotes download and the spreads analysis for all the exchanges are done every 3 seconds
SpreadEntry 0.0080 The spread threshold above which the trailing spreads are generated to capture an arbitrage opportunity
SpreadTarget 0.0050 This is the targeted profit. It represents the net profit and takes the exchange fees into account. If SpreadEntry is at 0.80% and trades are generated at that level on two exchanges with 0.25% fees each, Blackbird will set the exit threshold at -0.70% (0.80% spread entry - 4x0.25% fees - 0.50% target = -0.70%)
PriceDeltaLimit 0.10 The maximum difference between the target limit price and the computed limit price of an order. That is the price generated by looking at the current liquidity in the order books. If the difference is greater than PriceDeltaLimit then no trades will be generated because there is not enough liquidity (risk of slippage)
TrailingSpreadLim 0.0008 The limit under which the trailing spread is generated. If the current spread is above SpreadTarget and at 0.70%, then by default, the trailing spread will be generated at 0.62%
TrailingSpreadCount 1 The number of times the spread must be between SpreadTarget and the trailing spread before sending the orders to the market
OrderBookFactor 3.0 In order to be executed as fast as possible and avoid slippage, Blackbird checks the liquidity in the order books of the exchanges and makes sure there are at least 3.0 times the needed liquidity before executing the order
UseVolatility false If true, display the spreads volatility information in the log file. This is not used for the moment and only displayed as information
VolatilityPeriod 600 The period length of the volatility in number of iterations. This is not used for the moment and only displayed as information
SendEmail false When true, an e-mail will be sent every time an arbitrage trade is completed, with information such as the names of the exchanges and the trade return
DBFile 'blackbird.db' SQLite3 database file to use for storing the bid/ask information of the exchanges for reference. Blackbird will create this file if it doesn't already exist

Getting and building the software

You need the following libraries: OpenSSL, Jansson (v2.7 minimum), cURL, SQLite3 and sendEmail. Usually this is what you need to install:

libssl-dev
libjansson-dev
libcurl4-openssl-dev
libsqlite3-dev (available as a Blackbird submodule)
build-essential
cmake
sendemail

Download the source from GitHub with:

mkdir blackbird
cd blackbird
git clone --recursive  git://github.com/butor/blackbird.git .

Alternatively, if you already have the existing source tree use:

git submodule update --init

to sync the submodules.

Once you have downloaded the source code, build Blackbird by typing:

cmake -B./build -H. -DCMAKE_BUILD_TYPE=Debug

or

cmake -B./build -H. -DCMAKE_BUILD_TYPE=Release

then

cmake --build ./build -- install

If all goes well this produces a Blackbird executable in the project directory.

Ubuntu (Amazon EC2 compatible)

  1. Run the following commands:
sudo apt-get install libssl-dev libjansson-dev libcurl4-openssl-dev libsqlite3-dev sendemail make gcc g++ build-essential cmake
mkdir blackbird
cd blackbird
git clone --recursive  git://github.com/butor/blackbird.git .
cmake -B./build -H. -DCMAKE_BUILD_TYPE=Release
cmake --build ./build -- install
  1. Run the software, by typing:
./blackbird

Docker

  1. Download and install Docker (with Docker Compose) here.

  2. Download the source from GitHub with

mkdir blackbird
cd blackbird
git clone --recursive  git://github.com/butor/blackbird.git .

Alternatively, if you already have the existing source tree use:

git submodule update --init
  1. Build the container:
docker build -t blackbird .
  1. Spin up the entire stack with docker-compose (OSX/Linux):
docker-compose up

Mac OS X

  1. Install Homebrew

  2. Run the following commands:

xcode-select --install
brew install cmake openssl jansson curl sqlite3 sendemail
mkdir blackbird
cd blackbird
git clone --recursive  git://github.com/butor/blackbird.git .
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -B./build -H. -DCMAKE_BUILD_TYPE=Release
cmake --build ./build -- install
  1. Run the software, by typing:
./blackbird

Understanding and debugging the software

Step-through debugging is a helpful method to understand how any software application works. Various scripts and metadata files are included alongside the source code to facilitate building the application so you can use GDB and VisualStudio Code to debug the application while it executes in a Docker container.

Once you have successfully launched Blackbird following the instructions in the "Docker" section, you need to do the following:

  1. Download and install Visual Studio Code

  2. Setup the C/C++ extension for Visual Studio Code

  3. You need to have GDB installed on your machine (this is described in the "Debugging" section of Setup the C/C++ extension for Visual Studio Code).

  4. From VS Code, File > Open Workspace... and select the "blackbird" workspace (this is in the root directory of your blackbird clone; the one you created this during "Download source code" step)

  5. Press F5 to start the debugger. This will build and launch the Docker container, Blackbird w/ debug symbols, and a GDB Server running Blackbird on the Docker container. Since there is a delay between when the Docker container gets launched and the GDB Server is running, you may need to start the debugger a few times before it attaches to the GDB server. (If you can figure out how to create a "pause" between when the container launches and VS Code attempts to attach to GDB Server, that will fix it).

Contact

  • If you found a bug, please open a new issue with the label bug
  • If you have a general question or have troubles running Blackbird, you can open a new issue with the label question or help wanted
  • For anything else you can contact the author at [email protected]

Log Output Example

This is what the log file looks like when Blackbird is started:

Blackbird Bitcoin Arbitrage
DISCLAIMER: USE THE SOFTWARE AT YOUR OWN RISK.

[ Targets ]
   Spread Entry:  0.80%
   Spread Target: 0.30%

[ Current balances ]
   Bitfinex:    1,857.79 USD    0.000000 BTC
   OKCoin:      1,801.38 USD    0.000436 BTC
   Bitstamp:    1,694.15 USD    0.000000 BTC
   Gemini:      1,720.38 USD    0.000000 BTC

[ Cash exposure ]
   FULL cash used!

[ 10/31/2015 08:32:45 ]
   Bitfinex:    325.21 / 325.58
   OKCoin:      326.04 / 326.10
   Bitstamp:    325.37 / 325.82
   Gemini:      325.50 / 328.74
   ----------------------------
   OKCoin/Bitfinex:     -0.27% [target  0.80%, min -0.27%, max -0.27%]
   Bitstamp/Bitfinex:   -0.19% [target  0.80%, min -0.19%, max -0.19%]
   Gemini/Bitfinex:     -1.07% [target  0.80%, min -1.07%, max -1.07%]

[ 10/31/2015 08:32:48 ]
   Bitfinex:    325.21 / 325.58
   OKCoin:      326.04 / 326.10
   Bitstamp:    325.39 / 325.68
   Gemini:      325.50 / 328.67
   ----------------------------
   OKCoin/Bitfinex:     -0.27% [target  0.80%, min -0.27%, max -0.27%]
   Bitstamp/Bitfinex:   -0.14% [target  0.80%, min -0.19%, max -0.14%]
   Gemini/Bitfinex:     -1.05% [target  0.80%, min -1.07%, max -1.05%]

blackbird's People

Contributors

1ace avatar ajimi avatar brasky avatar butor avatar cckrk avatar dragonsnapx avatar elsehow avatar ezillinger avatar gasp0deaz avatar gitter-badger avatar greatwolf avatar jebbgrenham avatar julianmi avatar khonkhortisan avatar macedd avatar nabinkhadka avatar natebrune avatar newar417 avatar nikhiljha avatar sdrelton avatar seanbow avatar setar avatar sharkbeard avatar stepanstipl avatar theryee avatar venky-bommireddy avatar vitalisator avatar vpfautz avatar wwarlock avatar xgdgsc avatar

Stargazers

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

Watchers

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

blackbird's Issues

Bitfinex Error With JSON

<Bitfinex> Error with JSON: {"message": "Could not find a key matching the given X-BFX-APIKEY."}. Retrying...

Blackbird stopping without reason and error

After several hours program just stops without error. I have it running in screen session on vps server, console looks like this:
/
jarek@xxx:~/blackbird$ ./blackbird
Blackbird Bitcoin Arbitrage
DISCLAIMER: USE THE SOFTWARE AT YOUR OWN RISK

Log file generated: blackbird_log_20160111_161002.log
Blackbird is running... (pid 16177)

jarek@xxx:~/blackbird$
/

end of log file:
[ 01/11/2016 22:39:39 ]
Bitfinex: 448,97 / 448,99
OKCoin: 447,00 / 447,10
Kraken: 450,01 / 451,49

OKCoin/Bitfinex: 0.42% [target 0.80%, min -0.03%, max 0.71%]
Kraken/Bitfinex: -0.56% [target 0.80%, min -0.87%, max 0.01%]

[ 01/11/2016 22:39:42 ]

I had this problem 4 times already. On my home virtual machine it does the same.

Error with cURL

Hello,

In Demo mode, in log file, i have error : Error with cURL

It's on raspbian.

Thank

Automatically adjust the spread parameters depending on the market conditions

Instead of having fixed values for SpreadEntry, SpreadTarget and TrailingSpreadLim it would be better to adjust these three parameters based on the Bitcoin market conditions: if the current volatility is high then SpreadEntry, SpreadTarget and TrailingSpreadLim should be set higher to maximize the profit on high spreads. This is due to the fact that when the volatility is high the discrepancies between exchanges tends to increase due to all the fast changes in the Bitcoin prices. The more the volatility the less the exchanges are in sync.

In the other hand, we should try to minimize these three parameters when the volatility is low to still try to capture small profits even though the general spread between the exchanges will be small. Small profits are still better than nothing.

We see two possible options to implement that enhancement:

  • Short-term volatility: when Blackbird starts, it doesn't trade for x hours (x to be defined) but starts to collect bid/ask information from the exchanges and computes the volatility with it. Then, after x hours, Blackbird adjusts SpreadEntry, SpreadTarget and TrailingSpreadLim, based on that computed short-term volatility.
    While Blackbird continues to run after x hours, the short-term volatility is still calculated and the parameters are dynamically modified accordingly.

  • Use of an existing API: we can use an API that gives us the x-day Bitcoin volatility. For instance, the website The Bitcoin Volatility Index proposes a free API to get the 30-day and 60-day Bitcoin volatility as JSON data. The direct link to the API is here: https://btcvol.info/lates.
    Here is an example of response:

    {"Date":"2015-09-07","Volatility":3.922454012881,"Volatility60":3.339607392881}

In summary the parameters should be adapted as follow:

  • High volatility: higher SpreadEntry, higher SpreadTarget, higher TrailingSpreadLim.
  • Low volatility: lower SpreadEntry, lower SpreadTarget, lower TrailingSpreadLim.

OKCoin sends order at 0$

Hi,

There is a problem using OKCoin:

Looking for a limit price to fill 1.50 BTC...
order book: 0.67@$439.94
order book: 0.04@$439.95
order book: 0.44@$439.97
order book: 0.01@$439.99
order book: 3.56@$0.00
Trying to send a "buy" limit order: 1.50@$0.00...
Done (order ID: 0)

As a consequence, the order is not fulfilled.

Christian

Warning: WARNING: 2 second(s) too late at...

I'm about to try out blackbird, but I'm hesitant as in the logs I keep seeing messages like:

WARNING: 2 second(s) too late at 01/18/2016 01:16:33

On every iteration I get a warning message like this.Sometimes it's 1 second, sometimes it's 18. What exactly does this mean and how can I make sure the process moves faster?

  • I'm not on a slow internet connection
  • I'm not on a slow computer
  • I'm located in Belgium
  • (I'm currently still in demo mode)

Thanks for any input!

Segfault on Kraken::getAvail

First of all, thank you @beckel for your interest and the implementation of the Kraken exchange.
I have tried with different API keys but I always get a segmentation fault right at the start of Blackbird (on Kraken::getAvail). Does anybody else get errors on accessing Kraken?

Debugger output:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff69e754c in __GI_____strtod_l_internal (nptr=0x0, endptr=0x0, group=<optimized out>, loc=0x7ffff6d65060 <_nl_global_locale>) at strtod_l.c:608
608 strtod_l.c: No such file or directory.
Backtrace:
#0 0x00007ffff69e754c in __GI_____strtod_l_internal (nptr=0x0, endptr=0x0, group=<optimized out>, loc=0x7ffff6d65060 <_nl_global_locale>) at strtod_l.c:608
#1 0x000000000041372c in atof (__nptr=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/stdlib-float.h:28
#2 Kraken::getAvail (params=..., currency=...) at src/kraken.cpp:52
#3 0x00000000004043aa in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:222

Error with JSON when executing Bitfinex trade

Hey, I'm having a bit of trouble getting Blackbird up and running. Everything runs smoothly until I'm executing a trade at which point I get the following error in my log file.

............
[ 02/21/2016 11:20:00 ]
Bitfinex: 449.07 / 449.10
OKCoin: 447.36 / 447.44
Kraken: 440.31 / 442.32


OKCoin/Bitfinex: 0.36% [target 0.80%, min 0.36%, max 0.39%]
Kraken/Bitfinex: 1.53% [target 0.80%, min 1.53%, max 1.53%] trailing 1.53% 0/2
[ 02/21/2016 11:20:03 ]
Bitfinex: 449.07 / 449.10
OKCoin: 447.36 / 447.43
Kraken: 440.31 / 442.32


OKCoin/Bitfinex: 0.37% [target 0.80%, min 0.36%, max 0.39%]
Kraken/Bitfinex: 1.53% [target 0.80%, min 1.53%, max 1.53%] trailing 1.53% 1/2
[ 02/21/2016 11:20:06 ]
Bitfinex: 449.07 / 449.10
OKCoin: 447.36 / 447.43
Kraken: 440.33 / 442.32


OKCoin/Bitfinex: 0.37% [target 0.80%, min 0.36%, max 0.39%]
Kraken/Bitfinex: 1.53% [target 0.80%, min 1.53%, max 1.53%] trailing 1.53% 2/2
Error with JSON:
'[' or '{' expected near '<'
Buffer:

<title>Bitfinex - Error 404: Page not found</title> ............

It then continues retrying to send the trade, obtaining error 404 each time.

Any help you could provide would be much appreciated!

Thanks.

Hangs while downloading Bitstamp prices

I am experiencing an issue that I have never faced before. When Blackbird is analyzing the market, it sometimes hangs after a few days, usually after between 1 to 6 days. The blackbird process doesn't crash and still runs but the output just hangs without any error or warning. It always happens at the same moment: when Blackbird downloads the prices from Bitstamp.

Here is the output file after the last hang:

[ 10/21/2015 01:54:40 ]
    Bitfinex:    271.67 / 272.00
    OKCoin:      272.30 / 272.31
    Bitstamp:    270.60 / 271.00
    Kraken:      265.13 / 271.28
    ItBit:       271.12 / 271.28
    ----------------------------
    Bitfinex/Kraken:     -2.53% [target  100.00%, min -2.69%, max -0.23%]
    OKCoin/Bitfinex:     -0.24% [target  100.00%, min -0.53%, max  0.47%]
    OKCoin/Kraken:       -2.64% [target  100.00%, min -2.73%, max -0.21%]
    Bitstamp/Bitfinex:    0.25% [target  100.00%, min -0.26%, max  1.01%]
    Bitstamp/Kraken:     -2.17% [target  100.00%, min -2.75%, max  0.48%]
    Kraken/Bitfinex:      0.14% [target  100.00%, min -0.15%, max  1.39%]
    ItBit/Bitfinex:       0.14% [target  100.00%, min -0.46%, max  0.31%]
    ItBit/Kraken:        -2.27% [target  100.00%, min -2.68%, max  0.00%]

[ 10/21/2015 01:54:45 ]
    Bitfinex:    271.67 / 272.00
    OKCoin:      272.22 / 272.23

And then nothing.

Does anybody experience this issue? I use the version currently on GitHub. Maybe a timeout on the cURL calls would be necessary?

Thanks,
Butor

Problem when calling "make"

Hello, i was going step by step through the instructions but when i enter "make" in terminal i get this error message:

src/bitfinex.cpp: In function ‘bool Bitfinex::isOrderComplete(CURL*, Parameters, int)’:
src/bitfinex.cpp:91:73: error: ‘json_boolean_value’ was not declared in this scope
   bool isComplete = !json_boolean_value(json_object_get(root, "is_live"));

Am i missing some package or did i miss something else?
Running on Ubuntu 14.04 LTS

Trailing stop to let the opportunities run

As for now, SPREAD_ENTRY and SPREAD_EXIT are fixed values: if the spread ratio between two exchanges reaches the SPREAD_ENTRY value then an opportunity is found and the buy/sell orders are immediately generated. Same for SPREAD_EXIT. But what if the spread ratio continues to increase after the orders are generated? We would have actually missed a better trading opportunity. We can wait for a better trading opportunity by using a trailing stop: the trailing stop will put a dynamic limit that will increase if the spread ratio increases, so that the limit "follows" the spread ratio. When the spread ratio starts to decrease then the limit is reached and the orders are generated.

Let's take an example:
Let''s say that the actual SPREAD_ENTRY is at 1.10% (0.30% defined by the user plus 0.80% trading fees).
The TRAILING_STOP limit is defined as: spread ratio - 0.05%.

  • Events without trailing stop (as Blackbird works for now):
Spread Ratio Action Comments
0.84% N/A
0.96% N/A
1.08% N/A
1.16% Enter market buy/sell orders are generated
1.20% N/A in market
1.32% N/A in market
1.24% N/A in market
  • Events with a trailing stop:
Spread Ratio Trailing Stop Action Comments
0.84% N/A N/A
0.96% N/A N/A
1.08% N/A N/A
1.16% 1.11% N/A 1.16% - 0.05% = 1.11%
1.20% 1.15% N/A 1.20% - 0.05% = 1.15%
1.32% 1.27% N/A 1.32% - 0.05% = 1.27%
1.25% 1.27% 1.25 < 1.27: Enter market buy/sell orders are generated

In the first example, we entered with a spread ratio at 1.16%. In the second example we waited and entered with a better spread ratio (1.25%), thanks to the trailing stop.

The mechanic would be the same with SPREAD_EXIT.

Help~How to remove or add more exchanges?

Hi,
@butor
Your project ideas really inspired me a lot, This idea can also be used for other commodities.thank you!
So,If I don't need an exchange, can i remove it by edit the source code? can i edit blackbird.conf to complete this.
And how to add more exchange?
Thanks for your reply!

Email config question #question

When configuring email from blackbird... I have SMTP setup on the localhost, so blackbird does not need a login/password to send an email. Do I configure that just by leaving password blank?

Blackbird show's balances incorrectly

The images pretty much explain it all.

Okcoin is accurate, but bitfinex isnt displaying my actual USD balance and is reversing the USD and Bitcoin balances. I hope this makes sense.

compile error

When tried compile a file im getting this error:

tradedesk@tradedesk-All-Series:/Documents/blackbird2/blackbird-master$ make
g++ -c -g -Wall -O2 src/bitfinex.cpp -o src/bitfinex.o
src/bitfinex.cpp: In function ‘bool Bitfinex::isOrderComplete(CURL_, Parameters, int)’:
src/bitfinex.cpp:92:68: error: ‘json_boolean_value’ was not declared in this scope
isComplete = !json_boolean_value(json_object_get(root, "is_live"));
^
make: *_* [src/bitfinex.o] Error 1
tradedesk@tradedesk-All-Series:
/Documents/blackbird2/blackbird-master$ make
g++ -c -g -Wall -O2 src/bitfinex.cpp -o src/bitfinex.o
src/bitfinex.cpp: In function ‘bool Bitfinex::isOrderComplete(CURL_, Parameters, int)’:
src/bitfinex.cpp:92:68: error: ‘json_boolean_value’ was not declared in this scope
isComplete = !json_boolean_value(json_object_get(root, "is_live"));
^
make: *_* [src/bitfinex.o] Error 1

Do you have any reference to solve this problem?

Bug with the JSON response structure

When Blackbird sends a request to any exchange to get information, the answer comes back as a JSON structure. However, for some reason the full JSON response needs to be completely decomposed into all the variables otherwise the individual variables are not recognized. Instead of diretly accessing individual JSON variables (e.g. "bid", "ask", "volume") the full structure needs to be decomposed. The variables that we don't need are affected to a temporary const char variable "r".

Here is how that workaround works. In order to get the current Ask, Bid and Last Trade on Bitfinex we need to do:

const char *r = "x";    // variable where we affect the JSON variables we don't need
const char *tmpBid = "0.0";
const char *tmpAsk = "0.0";
const char *tmpLastTrade = "0.0";

json_unpack(root, "{ssssssssss}", "last_price", &tmpLastTrade, "mid", &r, "bid", &tmpBid, "ask", &tmpAsk, "low", &r, "high", &r, "volume", &r, "timestamp", &r);

The goal is to fix this issue in order to directly acccess the variables without having to decompose the full structure. We could also try another JSON library like RapidJSON or JsonCpp.

Exchanges request

*btcchina
*Huobi
*okcoin CNY
*okcoin.cn
*okcoin futures (short selling)
*BTCchina futures (short selling)

Build error - multiple definition

Hi @sdrelton,

When I tried to build Blackbird with #52 on my Google Cloud server I get an error with:

multiple definition of `krakenGotLimPrice'
multiple definition of `krakenLimPrice'
multiple definition of `krakenGotTicker'
multiple definition of `krakenTicker'

I guess the issue is with the following declarations in kraken.h:

json_t* krakenTicker;
bool krakenGotTicker = false;
json_t* krakenLimPrice;
bool krakenGotLimPrice = false;

Any idea what's going on? Should I move the declarations to kraken.cpp instead?
Thanks!

Full error:

$ make
g++ src/parameters.o src/base64.o src/itbit.o src/time_fun.o src/bitstamp.o src/curl_fun.o src/bitcoin.o src/poloniex.o src/check_entry_exit.o src/btce.o src/result.o src/db_fun.o src/send_email.o src/kraken.o src/gemini.o src/main.o src/okcoin.o src/sevennintysix.o src/bitfinex.o -o blackbird -lcrypto -ljansson -lcurl -lmysqlclient -g
src/main.o:(.bss+0x0): multiple definition of `krakenGotLimPrice'
src/kraken.o:(.bss+0x0): first defined here
src/main.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned long)':
/usr/include/c++/5/ostream:561: multiple definition of `krakenLimPrice'
src/kraken.o:/usr/include/c++/5/bits/basic_string.tcc:210: first defined here
src/main.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/c++/5/ostream:561: multiple definition of `krakenGotTicker'
src/kraken.o:/usr/include/c++/5/bits/basic_string.tcc:210: first defined here
src/main.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/c++/5/ostream:561: multiple definition of `krakenTicker'
src/kraken.o:/usr/include/c++/5/bits/basic_string.tcc:210: first defined here
collect2: error: ld returned 1 exit status
Makefile:13: recipe for target 'EXEC' failed
make: *** [EXEC] Error 1

Kraken/Bitfinex error

I have added a kraken and bitfinex account to blackbird.conf, using the following trading parameters:

Program parameters
DemoMode=false
UseFullCash=false
UntouchedCash=0.01
CashForTesting=15.00
MaxExposure=25000.00
MaxLength=5184000
DebugMaxIteration=3200000
Verbose=true

Strategy parameters
GapSec=3.0
SpreadEntry=0.0070
SpreadTarget=0.0030
PriceDeltaLimit=0.10
TrailingSpreadLim=0.0010
TrailingSpreadCount=2
OrderBookFactor=1.5

After some time the following error appears in the log (looks like it is not getting JSON back?):

[ 01/24/2016 10:34:00 ]
Bitfinex: 399.10 / 399.17
Kraken: 393.13 / 394.46


Kraken/Bitfinex: 1.18% [target 0.70%, min -2.19%, max 1.51%] trailing 1.41% 1/2

[ 01/24/2016 10:34:03 ]
Bitfinex: 399.10 / 399.17
Kraken: 393.13 / 394.46


Kraken/Bitfinex: 1.18% [target 0.70%, min -2.19%, max 1.51%] trailing 1.41% 2/2
Error with JSON:
'[' or '{' expected near '<'
Buffer:

<title>Bitfinex - Error 404: Page not found</title>

For more log see attached file.
kraken_bitfinex.txt

Is there any more info you need?

specify log file in config.json

Instead of writing to standard out, write to a file specified in the config file. Furthermore, catch SIGTERM and respond by closing and re-opening log file. That allows a sysadmin (or cron job) to rename the log file, and then signal the process, thus doing a log rotate.

Check the validity of the exchanges credentials

As for now, when the credentials of a Bitcoin exchange are incorrectly set by the user (e..g wrong API key, etc) Blackbird crashes on a segmentation fault.

A validation function should be added that will test the credentials and, if applicable, will tell the user that the credentials are incorrect. Example when Blackbird is started with an invalid credential:

butor@blackbird$ ./blackbird
Blackbird Bitcoin Arbitrage
Version 0.0.2
DISCLAIMER: USE THE SOFTWARE AT YOUR OWN RISK.

ERROR: connection to Bitfinex invalid. Please check your credentials and try again.

butor@blackbird$

Kraken SSL Connect Error

When doing some testing I ran into an issue with Kraken.

My log file (modified to print the URL of every request) looks like this:

[ 02/23/2016 22:01:06 IN MARKET: Long Kraken / Short Bitfinex ]
URL: https://api.bitfinex.com/v1/ticker/btcusd
URL: https://api.bitfinex.com/v1/ticker/btcusd
Bitfinex: 422.28 / 422.31
URL: https://api.kraken.com/0/public/Ticker
URL: https://api.kraken.com/0/public/Ticker
Kraken: 418.17 / 420.90


Kraken/Bitfinex: 0.99% [target -0.72%, min 0.26%, max 1.04%]
[ 02/23/2016 22:01:12 IN MARKET: Long Kraken / Short Bitfinex ]
URL: https://api.bitfinex.com/v1/ticker/btcusd
URL: https://api.bitfinex.com/v1/ticker/btcusd
Bitfinex: 422.28 / 422.31
URL: https://api.kraken.com/0/public/Ticker
URL: https://api.kraken.com/0/public/Ticker
Error with cURL: SSL connect error
URL: https://api.kraken.com/0/public/Ticker
Retry in 2 sec...
Error with cURL: SSL connect error
URL: https://api.kraken.com/0/public/Ticker
Retry in 2 sec...

The program attempts to retry for about 30 minutes and then it runs fine again. Using GapSec = 6.0 this occurred approximately every 1hr 20mins.

I believe the reason for this is that I was hitting the Kraken API call limit (see excerpt below). You can clearly see from my log file that every time we are making two requests to "kraken.com/0/public/Ticker", one for the bid and ask prices respectively. I propose that these be merged into one call where both pieces of data are extracted at the same time. This would make it much harder to hit the API call limit, leading to maximized uptime of the program. It would also decrease the number of HTTP requests, which would minimize the bandwidth usage and speed up the time to analyze each tick.

Excerpt from Kraken API FAQ (https://www.kraken.com/help/api):

Every user of our API has a "call counter" which starts at 0.

Ledger/trade history calls increase the counter by 2.

Place/cancel order calls do not affect the counter.

All other API calls increase the counter by 1.

The user's counter is reduced every couple of seconds, and if the counter exceeds the user's maximum API access is suspended for 15 minutes. Tier 2 users have a maximum of 15 and their count gets reduced by 1 every 3 seconds. Tier 3 and 4 users have a maximum of 20; the count is reduced by 1 every 2 seconds for tier 3 users, and is reduced by 1 every 1 second for tier 4 users.

src/parameters.h > #include <mysql/mysql.h> //terminates compile missing

I'm guessing this is because I needed a cpp dependency? I tried adding c++ connector but it says I need to use bzr and from there I get this directory called trunk ...but the cmake command doesnt work in there which I presume would give me the mysql/mysql.h dependencies

This is on a linux machine I have everything else setup including using the apt-get dependencies

logfile

Blackbird Shuts off after entering position...can I see a type of stack trace or troubleshoot it?

I've been pretty busy but have the bot running 24-7 on some dedicated hardware. I see it attempted to enter a position, but that it seems to have died for no reason or cause after placing orders on the exchanges:

Bitstamp/Bitfinex: 1.24% [target 0.80%, min -0.81%, max 1.29%] trailing 1.19% 0/2
Kraken/Bitfinex: 1.06% [target 0.80%, min -1.61%, max 1.07%] trailing 0.97% 0/2
BTC-e/Bitfinex: 0.21% [target 0.80%, min -2.29%, max 1.13%] info only

[ 02/04/2016 06:06:00 ]
Bitfinex: 382.01 / 382.02
Bitstamp: 377.80 / 378.00
Kraken: 377.95 / 377.99
BTC-e: 381.50 / 381.20


Bitstamp/Bitfinex: 1.06% [target 0.80%, min -0.81%, max 1.29%] trailing 1.19% 0/2
Kraken/Bitfinex: 1.06% [target 0.80%, min -1.61%, max 1.07%] trailing 0.97% 0/2
BTC-e/Bitfinex: 0.21% [target 0.80%, min -2.29%, max 1.13%] info only

[ 02/04/2016 06:06:05 ]
Bitfinex: 382.01 / 382.02
Bitstamp: 377.80 / 378.00
Kraken: 377.95 / 377.99
BTC-e: 381.71 / 381.27


Bitstamp/Bitfinex: 1.06% [target 0.80%, min -0.81%, max 1.29%] trailing 1.19% 1/2
Kraken/Bitfinex: 1.06% [target 0.80%, min -1.61%, max 1.07%] trailing 0.97% 0/2
BTC-e/Bitfinex: 0.19% [target 0.80%, min -2.29%, max 1.13%] info only

[ 02/04/2016 06:06:10 ]
Bitfinex: 382.04 / 382.45
Bitstamp: 378.39 / 378.98
Kraken: 377.95 / 377.99
BTC-e: 381.71 / 381.27


Bitstamp/Bitfinex: 0.81% [target 0.80%, min -0.81%, max 1.29%] trailing 1.19% 2/2
Looking for a limit price to fill 0.14 BTC...
order book: 22.88@$378.00
Looking for a limit price to fill 0.14 BTC...
order book: 12.58@$382.03

[ ENTRY FOUND ]
Date & Time: 02/04/2016 06:06:10
Exchange Long: Bitstamp (id 1)
Exchange Short: Bitfinex (id 0)
Fees: 0.25% / 0.20%
Price Long: $378.00 (target)
Price Short: $382.03 (target)
Spread: 0.81%
Cash used: $53.46 on each exchange
Exit Target: -0.29%

Looking for a limit price to fill 0.14 BTC...
order book: 22.88@$378.00
Trying to send a "buy" limit order: 0.14@$378.00...
Done (order ID: 109,742,308)

Looking for a limit price to fill 0.14 BTC...
order book: 24.43@$382.04
Trying to send a "sell" limit order: 0.14@$382.04...
Done (order ID: 608,557,553)

Waiting for the two orders to be filled...

Read the exchanges' order book to adjust the limit orders

Firstly, arbitrage trading implies that for every market opportunity two orders are generated and executed at the same time. These orders (one long and one short) have to be immediately and fully executed to make sure we are market neutral all the time.
Secondly, as with many automatic trading strategies we don't use market orders to avoid being executed during sudden market drops or peaks. We use limit orders where a limit is set: E.g. buy 1.00 BTC but if and only if the price is below $250.00.

With these two points in mind, how can we be sure that our limit orders are immediately executed? What Blackbird does so far is set a limit below the current market bid for a sell limit order or above the market ask for a buy limit order to be sure to get what the market offers. The current limit is ±$0.30 the current bid or ask.

Example 1:

An arbitrage opportunity is detected and we need to buy BTC. Current ask is $250.00. Blackbird will propose a buy limit order at $250.30, which means that Blackbird is ready to buy at a higher price to be sure to be executed.
Inversely, we also need to sell BTC. Current buy is $250.00. Blackbird will propose a sell limit order at $249.70, which means that Blackbird is ready to sell at a lower price to be sure to be executed.

This ±$0.30 delta is empirical and temporary because it has two drawbacks:

  1. if the market is very liquid we will pay an extra $0.30 per BTC that might not be necessary.
  2. if the market is not liquid an extra $0.30 might be not enough to be sure to be executed. This is especially true if we trade with a high amount of cash.

To be able to adjust that delta depending on market conditions, Blackbird needs to be able to read the order book (Level 2 data) of the exchange it is trading on to analyze what the current bids and asks are. Then it will set the limit that covers the desired volume.

Example 2:

We need to buy 5.0 BTC and we have to be executed immediately. Here is the order book of the exchange (Ask only):

Ask       Volume
$250.12   1.0    
$250.36   3.0
$250.44   3.0
$250.78   6.0
$251.14   4.0

To be executed immediately we need to take the first three Asks ($250.12, $250.36 and $250.44) that will cover the 5.0 BTC that we want to buy. So in this example Blackbird should place a buy limit order at at least $250.44.

All the exchanges offer requests to get their order book in JSON structure. Once an opportunity is found the task here is to:

  1. Read the exhange's order book
  2. Compute the limit that will cover the volume that will be traded
  3. Send a limit order using that computed limit.

Blackbird doesn't work on CentOS

I have it running in on vps server. I used Cent OS 6.5 32bit on My linux server
console looks like this:

Blackbird started on 01/15/2016 23:56:52

[ Targets ]
Spread Entry: 0.80%
Spread Target: 0.30%

[ Current balances ]
Error with JSON:
'[' or '{' expected near '<'. Retrying...
Error with JSON:
'[' or '{' expected near '<'. Retrying...
Error with JSON:
'[' or '{' expected near '<'. Retrying...
Error with JSON:

How Can I troubleshoot this problem ?

Alway show "nonce is too small"

I check the code,
I think it's better to use unsigned long long here.
long nonce = (tv.tv_sec * 100.0) + (tv.tv_usec * 0.001) + 0.5;
unsigned long long nonce = (tv.tv_sec * 100.0) + (tv.tv_usec * 0.001) + 0.5;

Nonce is too small

Hello,
@butor

After i change Demo to "false" and add api in blackbird.conf , it shows:

Blackbird Bitcoin Arbitrage Log File
Blackbird started on 01/16/2016 12:12:10

[ Targets ]
Spread Entry: 0.80%
Spread Target: 0.20%

[ Current balances ]
Error with JSON: {"message": "Nonce is too small."}. Retrying...
Error with JSON: {"message": "Nonce is too small."}. Retrying...

Using a configuration file instead of preprocessor directives

All the strategy and control parameters are currently stored as preprocessor directives (#define keyword) in the main.cpp file.

For example:

#define SPREAD_ENTRY  0.0025
#define SPREAD_EXIT  -0.0045

#define USE_FULL_CASH     true
#define UNTOUCHED_CASH    0.03
#define CASH_FOR_TESTING  5.0

A better approach would be to store them in a configuration file, for example:

# Blackbird configuration file

SPREAD_ENTRY=0.0025
SPREAD_EXIT=-0.0045

USE_FULL_CASH=true
UNTOUCHED_CASH=0.03
CASH_FOR_TESTING=5.0

Add new Bitcoin exchanges

How to add a new exchange connection

Adding new Bitcoin exchange connections (BTC-e, LakeBTC, etc) will increase the number of arbitrage opportunities. This is what we have so far:

  • Fully implemented and tested: Bitfinex, OKCoin, Bitstamp and Gemini
  • Implemented as a beta version and hasn't been tested: Kraken and 796
  • Hasn't been implemented yet: BTC-e

Here is the procedure to add a new exchange, let's say an exchange called BTCExchange:

  1. Add the exchange parameters to the config file, blackbird.conf:
# BTCExchange
BTCExchangeApiKey=
BTCExchangeSecretKey=
BTCExchangeFees=0.0020
  1. Edit parameter.h and parameter.cpp to add the new exchange variables:
  btcExchangeApi = getParameter("BTCExchangeApiKey", configFile);
  btcExchangeSecret = getParameter("BTCExchangeSecretKey", configFile);
  btcExchangeFees = getDouble(getParameter("BTCExchangeFees", configFile));
  1. Edit main.cpp to add the new exchange:
params.addExchange("BTCExchange", params.btcExchangeFees, false, true);

The addExchange(std::string n, double f, bool h, bool m) parameters are:

  • Name of the exchange
  • Fees
  • Does the exchange provide an API to short sell?
  • Has the exchange been fully implemented (in other words, is it possible for Blackbird to trade on that exchange?)
  1. Finally, for each exchange the basic functions have to be implemented (e.g. send orders, check balance) in files named after the exchange's name (in our example: btcexchange.h and btcexchange.cpp).

Here is the list of functions that have to be developed to connect the new exchange. Note the namespace BTCExchange:

namespace BTCExchange {

// get quote
double getQuote(Parameters& params, bool isBid);

// get the current availability for usd or btc
double getAvail(Parameters& params, std::string currency);

// send order to the exchange and return order ID
int sendOrder(Parameters& params, std::string direction, double quantity, double price);

// check the status of the order
bool isOrderComplete(Parameters& params, int orderId);

// get the Bitcoin exposition
double getActivePos(Parameters& params);

// get the limit price according to the requested volume
double getLimitPrice(Parameters& params, double volume, bool isBid);

// send a request to the exchange and return a JSON object
json_t* authRequest(Parameters& params, std::string url, std::string request, std::string options);

}

Read the status of an order and wait until the order is fully executed

As of today, when the system sends two limit orders to two exchanges it just waits five minutes for the orders to be executed and doesn't verify the status of the orders. This is not optimal at all and it's a temporary solution. This solution works well when the orders are small but needs to be improved.

The task is to implement the following:

  1. Send two limit orders, one long and one short, to two exchanges
  2. Read the status of both orders
  3. Loop and wait until the orders are both fully executed

For instance here is the list of possible order status on OKCoin that we should use:

  • -1: cancelled
  • 0: unfilled
  • 1: partially filled
  • 2: fully filled

Segmentation fault

The ./blackbird command returns this:

Blackbird Bitcoin Arbitrage
Version 0.0.2
DISCLAIMER: USE THE SOFTWARE AT YOUR OWN RISK.

[ Targets ]
Spread to enter: 0.30%
Spread to exit: -0.40%

[ Current balances ]
Segmentation fault

What may be causing this fault?

Porting Blackbird to C

After consulting with @butor I began porting Blackbird to C for having a small and clean code base. Moreover, Blackbird does not make use of many OO features so porting should be straight forward. See the current working branch at https://github.com/julianmi/blackbird/tree/Cversion. Please feel free to make any suggestions or contributions to the port.

Additionally, what do you think about unit testing the core of Blackbird? Does anyone of you have experience with a unit testing framework for C?

Compiling issue for me.

Hello all, i was wondering if someone can help me resolve my issue. During make i get this error. How can i fix it? I don't know cpp well. Thanks in advance!.

rmak@V400:~/bb/blackbird-master$ make
g++ -c -g -Wall -O2 src/bitfinex.cpp -o src/bitfinex.o
src/bitfinex.cpp: In function ‘bool Bitfinex::isOrderComplete(CURL_, Parameters, int)’:
src/bitfinex.cpp:92:73: error: ‘json_boolean_value’ was not declared in this scope
bool isComplete = !json_boolean_value(json_object_get(root, "is_live"));
^
make: *_* [src/bitfinex.o] Error 1

BTC-e connection implementation

Many people requested the implementation of the connection to BTC-e as it's a very popular Bitcoin exchange. The API is described on this page.

Note:

At the beginning of this project I didn't implement BTC-e because the bid/ask prices on BTC-e were almost always below the other exchanges. Therefore, BTC-e wouldn't have been a good candidate for arbitrage since the bid/ask prices must "swing" between the exchanges (otherwise the trades would never close).

This is not the case anymore (thanks @kokomoji) so it does make sense to get BTC-e implemented.

Help wanted - Trades are not being placed

After starting blackbird, the arbitrage opportunities get logged, but no trade gets placed:

--------------------------------------------
|   Blackbird Bitcoin Arbitrage Log File   |
--------------------------------------------

Blackbird started on 05/26/2016 16:53:44

[ Targets ]
   Spread Entry:  0.80%
   Spread Target: 0.30%

[ Current balances ]
   Bitfinex:  9.95 USD  0.000000 BTC
   OKCoin:    8.81 USD  0.000960 BTC

[ Cash exposure ]
   TEST cash used
   Value: $5.00

[ 05/26/2016 16:53:48 ]
   Bitfinex:   453.03 / 453.35
   OKCoin:     453.88 / 453.98
   ----------------------------
   OKCoin/Bitfinex: -0.21% [target  0.80%, min -0.21%, max -0.21%]

[ 05/26/2016 16:53:51 ]
   Bitfinex:   453.03 / 453.27
   OKCoin:     453.88 / 453.98
   ----------------------------
   OKCoin/Bitfinex: -0.21% [target  0.80%, min -0.21%, max -0.21%]

[...]

[ 05/26/2016 17:38:24 ]
   Bitfinex:   452.25 / 452.26
   OKCoin:     453.18 / 453.19
   ----------------------------
   OKCoin/Bitfinex: -0.21% [target  0.80%, min -0.30%, max -0.04%]

[ 05/26/2016 17:38:27 ]
   Bitfinex:   452.25 / 452.26
   OKCoin:     453.18 / 453.19
   ----------------------------
   OKCoin/Bitfinex: -0.21% [target  0.80%, min -0.30%, max -0.04%]

Blackbird not making trades

My config:
/# Program parameters
DemoMode=false
UseFullCash=false
UntouchedCash=0.01
CashForTesting=40.00
MaxExposure=100.00
MaxLength=5184000
DebugMaxIteration=3200000
Verbose=true

/# Strategy parameters
GapSec=3.0
SpreadEntry=0.0080
SpreadTarget=0.0030
PriceDeltaLimit=0.10
AggressiveVolume=true
TrailingSpreadLim=0.0010
OrderBookFactor=1.5

Few log entries:
Bitfinex/Kraken: 0.10% [target 0.80%, min -0.70%, max 0.83%]
OKCoin/Bitfinex: 0.35% [target 0.80%, min -0.51%, max 0.56%]
OKCoin/Kraken: 0.46% [target 0.80%, min -0.80%, max 1.12%]
Kraken/Bitfinex: -0.87% [target 0.80%, min -1.15%, max 0.34%]

...

Bitfinex/Kraken: -0.06% [target 0.80%, min -1.73%, max 0.22%]
OKCoin/Bitfinex: 0.05% [target 0.80%, min -0.47%, max 0.59%]
OKCoin/Kraken: -0.01% [target 0.80%, min -1.66%, max 0.23%]
Kraken/Bitfinex: -0.16% [target 0.80%, min -0.66%, max 1.34%]

Why it did not make a single trade?
I have $50 on each exchange.

BTC-E issue

Hello,
I've setup API keys at btc-e, have a USD balance there but blackbird is showing 0 balance and there is 'info only' note in log file.
I did not found any other USD balance beside their Meta trader account at btc-e.
What am I doing wrong?

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.