Skip to content

Instantly share code, notes, and snippets.

View pnavarro-algometrics's full-sized avatar

Pablo Navarro Castillo pnavarro-algometrics

  • Algometrics
  • Chile
View GitHub Profile
@pnavarro-algometrics
pnavarro-algometrics / plot-price-time.py
Created May 19, 2011 17:00
Plot prices with time in the x axis
from numpy import *
from matplotlib.pylab import *
import matplotlib.dates as mdates
data = loadtxt('quotes.csv', delimiter=',')
# Epoch time to number (matlab and matplotlib format)
TIMEZONE_CORRECTION = 60.0 * 60 * 5
time = mdates.epoch2num(data[:, 0] / 1000.0 - TIMEZONE_CORRECTION)
bid = data[:, 1]