def getPlotStyle(sequence, default='#aa0000'): """ getPlotStyle(seq) -> returns sequence.plot_style; builds it if necessary """ try: plotstyle = sequence.plot_style except (AttributeError, ): base.set_plot_style(sequence, default) plotstyle = sequence.plot_style return plotstyle
def build(symbol_table, **kwds): """ build(symbol_table) -> build a ticker supervisor with ticker objects The id+symbol two tuple is used as the key for each ticker object created. The ticker objects have a data series, but no index or strategy objects. """ new_supervisor = TickerSupervisor() for id_sym in symbol_table: tobj = new_supervisor[id_sym] = TechnicalTicker(*id_sym) for series_key in base.PriceSizeTypes: tobj.series[series_key] = ser = series.build() base.set_plot_style(ser, '#0000bb') return new_supervisor