Bitcoin Forum
November 06, 2024, 03:37:29 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitfinex OHLC 5 min data  (Read 679 times)
chriswen (OP)
Hero Member
*****
Offline Offline

Activity: 756
Merit: 500


View Profile
May 11, 2015, 09:57:38 PM
 #1

Hello,

I'm looking for Bitfinex OHLC 5 min data.

Actually all I care about is just the close data or just open data for 5 minutes Bitfinex.

Anyone know how I can get that?
Juvenal
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
May 14, 2015, 07:24:12 AM
 #2

Hello,

I'm looking for Bitfinex OHLC 5 min data.

Actually all I care about is just the close data or just open data for 5 minutes Bitfinex.

Anyone know how I can get that?

I don't see any way to attach files to replies here so I uploaded
a bitfinex five minute bar file to MegaUpload at this address:

http://www.megafileupload.com/15lS/BitFinex_5Min_Bars_BTCUSD.rar

You can download the trade-by-trade data here:

http://api.bitcoincharts.com/v1/csv/

I use a simple awk script to parse it into five minute bars:

Quote
BEGIN{
  prevIncr = 99999;
  minutesInBar = 5;
}
{ nowTemp = $1%1000000;
  nowDay = int($1/1000000);
  nowHour = int(nowTemp/10000);
  nowMinute = int((nowTemp%10000)/100);
  nowIncr =  int((nowMinute+nowHour*60)/minutesInBar);
 
  if(nowIncr!=prevIncr)
  { if(prevIncr!=999999)
    { prevTemp = prevIncr*minutesInBar;
      prevHour = int(prevTemp/60)*100;
      prevMinute = prevTemp%60;
      prevTemp = prevHour+prevMinute;
      printf("%d, %4d,%7.2f,%7.2f,%7.2f,%7.2f,%11.5f,%5d\n",prevDay,prevTemp,openBar,highBar,lowBar,lastBar,sizeBar,tickCount);
    }
    openBar = $2;
    highBar = $2;
    lowBar = $2;
    sizeBar = 0;
    tickCount = 0;
  }
  if($2>highBar){ highBar=$2;}
  if($2<lowBar){ lowBar=$2;}
  lastBar = $2;
  sizeBar += $3;
  prevDay = nowDay;
  prevIncr = nowIncr;
  prevBar = $0;
  tickCount += 1;
}
END{
  prevTemp = prevIncr*minutesInBar;
  prevHour = int(prevTemp/60)*100;
  prevMinute = prevTemp%60;
  prevTemp = prevHour+prevMinute;
  printf("%d, %4d,%7.2f,%7.2f,%7.2f,%7.2f,%11.5f,%5d\n",prevDay,prevTemp,openBar,highBar,lowBar,lastBar,sizeBar,tickCount);
}
chriswen (OP)
Hero Member
*****
Offline Offline

Activity: 756
Merit: 500


View Profile
May 18, 2015, 10:18:26 AM
 #3

Thank you very much.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!