Esempio n. 1
0
 def test_not_implemented_get_value(self):
     past_prices = transforms.get_past_prices(
         refresh_period=10,
         window_length=20,
         compute_only_full=True
     )
     past_prices.get_value()
Esempio n. 2
0
 def test_intialize_get_past_prices(self):
     past_prices = transforms.get_past_prices(refresh_period=10,
                                              window_length=20,
                                              compute_only_full=True)
     self._check_intialized_transform(past_prices)
     eq_(past_prices.compute_transform_value({'price': 5.32}), 5.32)
     eq_(past_prices.refresh_period, 10)
     eq_(past_prices.window_length, 20)
Esempio n. 3
0
 def test_intialize_get_past_prices(self):
     past_prices = transforms.get_past_prices(
         refresh_period=10,
         window_length=20,
         compute_only_full=True
     )
     self._check_intialized_transform(past_prices)
     eq_(past_prices.compute_transform_value({'price': 5.32}), 5.32)
     eq_(past_prices.refresh_period, 10)
     eq_(past_prices.window_length, 20)
Esempio n. 4
0
    def initialize(self, configuration):
        # window gives the number of data points that are extracted
        # from historical data
        # to estimate the expected returns and covariance matrix.
        self.window = configuration.get('window', trading_days_per_year)
        self.refresh_rate = configuration.get('refresh', 10)
        #TODO Automatically find out
        # Apple, Google, GE, Microsoft, Amazon
        self.market_cap = [479.51, 377.58, 272.76, 300.86, 180.96]
        self.cap_wts = \
            np.array(self.market_cap) / sum(np.array(self.market_cap))

        self.only_full = configuration.get('only_full', True)
        self.price_transform = transforms.get_past_prices(
            refresh_period=self.refresh_rate,
            window_length=self.window,
            compute_only_full=self.only_full)
Esempio n. 5
0
    def initialize(self, configuration):
        # window gives the number of data points that are extracted
        # from historical data
        # to estimate the expected returns and covariance matrix.
        self.window = configuration.get('window', trading_days_per_year)
        self.refresh_rate = configuration.get('refresh', 10)
        #TODO Automatically find out
        # Apple, Google, GE, Microsoft, Amazon
        self.market_cap = [479.51, 377.58, 272.76, 300.86, 180.96]
        self.cap_wts = \
            np.array(self.market_cap) / sum(np.array(self.market_cap))

        self.only_full = configuration.get('only_full', True)
        self.price_transform = transforms.get_past_prices(
            refresh_period=self.refresh_rate,
            window_length=self.window,
            compute_only_full=self.only_full)
Esempio n. 6
0
    def initialize(self, properties):
        # Interactive, mobile, hipchat, database and commission middlewares
        for middleware in common_middlewares(properties, self.identity):
            self.use(middleware)

        report_mails = properties.get('reports')
        if report_mails:
            self.use(mail.Report(report_mails).send_briefing)

        self.buy_trigger = properties.get('buy_trigger', 30)
        self.sell_trigger = properties.get('sell_trigger', 70)
        self.period = properties.get('period', 14)

        # RSI Signal
        self.rsi = ta.RSI(timeperiod=self.period)

        # Quotes loopback for managers
        self.prices_transform = transforms.get_past_prices(
            #refresh_period=10,
            window_length=properties.get('window', 40),
            compute_only_full=properties.get('only_full'))
Esempio n. 7
0
    def initialize(self, properties):
        # Interactive, mobile, hipchat, database and commission middlewares
        for middleware in common_middlewares(properties, self.identity):
            self.use(middleware)

        report_mails = properties.get('reports')
        if report_mails:
            self.use(mail.Report(report_mails).send_briefing)

        self.buy_trigger = properties.get('buy_trigger', 30)
        self.sell_trigger = properties.get('sell_trigger', 70)
        self.period = properties.get('period', 14)

        # RSI Signal
        self.rsi = ta.RSI(timeperiod=self.period)

        # Quotes loopback for managers
        self.prices_transform = transforms.get_past_prices(
            #refresh_period=10,
            window_length=properties.get('window', 40),
            compute_only_full=properties.get('only_full'))
Esempio n. 8
0
    def initialize(self, config):

        self.price_transform = transforms.get_past_prices(
            #refresh_period=10,
            window_length=config.get('window', 40),
            compute_only_full=config.get('only_full', True))
Esempio n. 9
0
 def test_not_implemented_get_value(self):
     past_prices = transforms.get_past_prices(refresh_period=10,
                                              window_length=20,
                                              compute_only_full=True)
     past_prices.get_value()