def __init__(self, candles): Bucket.__init__(self, candles) if isinstance(candles, Currency.AUD_Five_Min_Candle_Container): self.candle_container = Currency.AUD_One_Min_Candle_Container() elif isinstance(candles, Currency.CAD_Five_Min_Candle_Container): self.candle_container = Currency.CAD_One_Min_Candle_Container() elif isinstance(candles, Currency.CHF_Five_Min_Candle_Container): self.candle_container = Currency.CHF_One_Min_Candle_Container() elif isinstance(candles, Currency.GBP_Five_Min_Candle_Container): self.candle_container = Currency.GBP_One_Min_Candle_Container() elif isinstance(candles, Currency.EUR_Five_Min_Candle_Container): self.candle_container = Currency.EUR_One_Min_Candle_Container() else: self.candle_container = Currency.JPY_One_Min_Candle_Container() self.init() # 中枢容器的实现具有差异化,所以没有放入init() self.hubs = Hunter.One_Min_Hub_Container(self.pens, self)
def __init__(self, candles): Bucket.__init__(self, candles) if isinstance(candles, Currency.AUD_Ten_Min_Candle_Container): self.candle_container = Currency.AUD_One_Min_Candle_Container() elif isinstance(candles, Currency.CAD_Ten_Min_Candle_Container): self.candle_container = Currency.CAD_One_Min_Candle_Container() elif isinstance(candles, Currency.CHF_Ten_Min_Candle_Container): self.candle_container = Currency.CHF_One_Min_Candle_Container() elif isinstance(candles, Currency.GBP_Ten_Min_Candle_Container): self.candle_container = Currency.GBP_One_Min_Candle_Container() elif isinstance(candles, Currency.EUR_Ten_Min_Candle_Container): self.candle_container = Currency.EUR_One_Min_Candle_Container() elif isinstance(candles, Currency.JPY_Ten_Min_Candle_Container): self.candle_container = Currency.JPY_One_Min_Candle_Container() self.init() self.hubs = Hunter.One_Min_Hub_Container(self.pens, self)