barfeed – Bar providers

class pyalgotrade.barfeed.BarFeed

Base class for pyalgotrade.bar.Bar providing feeds.

Note

This is a base class and should not be used directly.

getDataSeries(instrument=None)

Returns the pyalgotrade.dataseries.BarDataSeries for a given instrument.

Parameters:instrument (string.) – Instrument identifier. If None, the default instrument is returned.
Return type:pyalgotrade.dataseries.BarDataSeries.
getDefaultInstrument()

Returns the default instrument.

getRegisteredInstruments()

Returns a list of registered intstrument names.

next()

Returns the next pyalgotrade.bar.Bars in the feed. If there are not more values StopIteration is raised.

class pyalgotrade.barfeed.csvfeed.YahooFeed

A pyalgotrade.barfeed.BarFeed that loads bars from a CSV file downloaded from Yahoo! Finance.

addBarsFromCSV(instrument, path, timeZone=0)

Loads bars for a given instrument from a CSV formatted file. The instrument gets registered in the bar feed.

Parameters:
  • instrument (string.) – Instrument identifier.
  • path (string.) – The path to the file.
  • timeZone (int.) – The timezone for bars. 0 if bar dates are in UTC.

Previous topic

dataseries – Basic dataseries classes

Next topic

technical – Technical indicators

This Page