Bitcoin Risk Engine Using Live and Historical Prices

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!



Might want to ping @Mike_Fishy

1 Like

Thanks, Peter. Will get in touch with him.

1 Like

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.



1 Like

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.


1 Like

Check the binance API on Github :

GET /api/v1/klines

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


Name Type Mandatory Description
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.


1 Like

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.


1 Like

Thanks, BTL!

I’ll check it out.


1 Like

💰 YEN · YouTube ·️ YEN.CAMP 🧠