bar – Instrument prices

class pyalgotrade.bar.Bar(dateTime, open_, high, low, close, volume, adjClose)

An instrument’s prices at a given time.

Parameters:
  • dateTime (datetime.datetime) – The date time.
  • open (float) – The opening price.
  • high (float) – The highest price.
  • low (float) – The lowest price.
  • close (float) – The closing price.
  • volume (float) – The volume.
  • close – The adjusted closing price.
getAdjClose()

Returns the adjusted closing price.

getClose()

Returns the closing price.

getDateTime()

Returns the datetime.datetime.

getHigh()

Returns the highest price.

getLow()

Returns the lowest price.

getOpen()

Returns the opening price.

getSessionClose()

Returns True if this is the last bar for the session, or False otherwise.

getVolume()

Returns the volume.

class pyalgotrade.bar.Bars(barDict)

A group of Bar objects.

Parameters:barDict (map.) – A map of instrument to Bar objects.

Note

All bars must have the same datetime.

getBar(instrument)

Returns the pyalgotrade.bar.Bar for the given instrument or None if the instrument is not found.

getDateTime()

Returns the datetime.datetime for this set of bars.

getInstruments()

Returns the instrument symbols.

Previous topic

Documentation for the code

Next topic

dataseries – Basic dataseries classes

This Page