Bitcoin Forum

Economy => Trading Discussion => Topic started by: chriswen on May 11, 2015, 09:57:38 PM



Title: Bitfinex OHLC 5 min data
Post by: chriswen on May 11, 2015, 09:57:38 PM
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?


Title: Re: Bitfinex OHLC 5 min data
Post by: Juvenal on May 14, 2015, 07:24:12 AM
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);
}


Title: Re: Bitfinex OHLC 5 min data
Post by: chriswen on May 18, 2015, 10:18:26 AM
Thank you very much.