Bitcoin Forum

Bitcoin => Project Development => Topic started by: deepceleron on November 19, 2013, 10:11:50 AM



Title: btcmon - Multiple exchange price monitor [python, bitcoincharts]
Post by: deepceleron on November 19, 2013, 10:11:50 AM
I whipped up this console python code to watch the fun on exchanges, it gets data from bitcoincharts market API JSON, and then bitcoincharts socket stream, to keep up to date on exchange prices for all exchanges.

No fancy display, just a dump to console of select currencies across exchanges every time a price changes, displaying only exchanges with trades in the last two hours (currency list and how old is too old are command line options).

http://we.lovebitco.in/btcmon.py (python 2.7 source)

Quote from: btcmon.py

btceUSD      price change: -0.37200000 =======
anxhkUSD    :   824.99200000
bitkonanUSD :   800.00000000
bitstampUSD :   647.00000000
btceUSD     :   654.63000000
crytrUSD    :   600.00000000
justUSD     :   750.00000000
localbtcUSD :   732.43000000
mtgoxUSD    :   763.01000000
btcnCNY     :  5665.00000000
mtgoxCNY    :  4838.30029000

btceUSD      price change: +0.37300000 =======
anxhkUSD    :   824.99200000
bitkonanUSD :   800.00000000
bitstampUSD :   647.00000000
btceUSD     :   655.00300000
crytrUSD    :   600.00000000
justUSD     :   750.00000000
localbtcUSD :   732.43000000
mtgoxUSD    :   763.01000000
btcnCNY     :  5665.00000000
mtgoxCNY    :  4838.30029000
..

Command line options
-c, --currency, default=USD,CNY
    Currencies to watch, comma separated, no spaces.
-a --age, default=7200
    Hide tickers with no trades for xx seconds.

Don't restart it more than once every 15 minutes per http://bitcoincharts.com/about/markets-api/ policy.
(I'll make an exe after I make display less "dumpy")

bitcoincharts socket interface code is (from)/(as documented only in) sierrachartfeed (https://bitcointalk.org/index.php?topic=6019.msg3083021#msg3083021).

Maybe this will turn into a gui charting app, but not likely. Maybe I'll make it more useful as a library, but not likely.