Bitcoin Risk Engine Using Live and Historical Prices

trading

#1

Hello All,

Apologies if this is in the wrong section, but I wasn’t sure where to post it.

I am developing a risk engine for bitcoin trading in Google Sheets but I can’t seem to find the data I need and hope someone here would know how.

I trade on very short time frames (most of my trades are no longer than 10mins in duration) and as such I would need the last 100-500 opening prices, closing prices and volume of the candles from the refresh point.

For example, with 100 data points, the most recent would be the previous minute, and the least recent would be from 100 minutes previously.

I have looked up a few of the exchange’s APIs but they seem to be only hourly, and it wouldn’t be an accurate calculation of risk when trading on such short time lines.

If anyone could help that would be great, of course I will be more than happy to share the finally spreadsheet when I finally get it finished!

Thanks,
Alex.


#2

Might want to ping @Mike_Fishy


#3

Thanks, Peter. Will get in touch with him.


#4

Hey Alex,

You are able to collect data from say binance every 1.2 seconds. If you look into the Bot trading Thread made by @Mike_Fishy there is php scripts that can be easily modified to collect data from one ticker on binance. once you have it in a txt file you can covert to an excel spreadsheet.

Better yet, I can have a crack at writing it for you. Please list down exactly what you are looking for. I should be able to modify the php code to get what you are looking for.

I will be even optimistic in my ability to code to say I will have a crack at doing this in python too.

Crash

Crash


#5

Also on Github, there is a site that has candle information going back to 2013 every minute. I cant post the link as I am at work at the moment, but will do later.

Crash.


#6

Check the binance API on Github : https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#klinecandlestick-data

GET /api/v1/klines

Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

Parameters:

Name Type Mandatory Description
symbol STRING YES
interval ENUM YES
startTime LONG NO
endTime LONG NO
limit INT NO Default 500; max 1000.

symbol : BTC-USDT
interval : 1m ( one minute)
limit : 100

And with that you’ll get what you want.

BTL


#7

Hey Crash,

Thanks a lot, I have been reading through that thread but there is a lot there!

So firstly I mostly use Bitmex to trade, but Binance should be fine as the price of BTC is reasonably consistent over the exchanges.

Ideally, I need a process which pulls the BTC price every minute, and stores the previous data it has pulled too, and import this into google sheets (I use this as I have multiple computers in multiple locations and need to be able to access everywhere and sometimes simultaneously).

So effectively I need real time price data into google sheets, so my calculations can run in real time too.

Thanks,
Alex.


#8

Thanks, BTL!

I’ll check it out.

Thanks,
Alex.