bar – Instrument prices

class pyalgotrade.bar.Bar

Bases: object

A Bar is a summary of the trading activity for a security in a given period.

Note

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

getDateTime()

Returns the datetime.datetime.

getOpen()

Returns the opening price.

getHigh()

Returns the highest price.

getLow()

Returns the lowest price.

getClose()

Returns the closing price.

getVolume()

Returns the volume.

getAdjClose()

Returns the adjusted closing price.

getTypicalPrice()

Returns the typical price.

__weakref__

list of weak references to the object (if defined)

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.

__getitem__(instrument)

Returns the pyalgotrade.bar.Bar for the given instrument. If the instrument is not found an exception is raised.

__contains__(instrument)

Returns True if a pyalgotrade.bar.Bar for the given instrument is available.

getInstruments()

Returns the instrument symbols.

getDateTime()

Returns the datetime.datetime for this set of bars.

getBar(instrument)

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

Previous topic

Documentation for the code

Next topic

dataseries – Basic dataseries classes

This Page