barfeed – Bar providers

class pyalgotrade.barfeed.BarFeed

Base class for pyalgotrade.bar.Bars 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.

getNextBars()

Returns the next pyalgotrade.bar.Bars in the feed or None if there are no more bars.

getRegisteredInstruments()

Returns a list of registered intstrument names.

class pyalgotrade.barfeed.yahoofeed.Feed

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.
class pyalgotrade.barfeed.ninjatraderfeed.Feed(frequency)

A pyalgotrade.barfeed.BarFeed that loads bars from a CSV file exported from NinjaTrader.

Parameters:frequency – The frequency of the bars.

Note

Valid frequency parameter values are:

  • ninjatraderfeed.Frequency.MINUTE
  • ninjatraderfeed.Frequency.DAILY
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