Example #1
0
    def __init__(self, settings=None, name=None):
        self.name = name
        ExitManager.__init__(self, settings)
        bb_period = self._getintsetting("BollingerBreakoutExitManager", "bbPeriod")
        bb_stdevs = self._getfloatsetting("BollingerBreakoutExitManager", "bbStdevs")
        self.close = AdjustedClose()
        self.bb = BollingerBands(metric=self.close, period=bb_period, stdev=bb_stdevs)

        self._addMetrics(self.close, self.bb)
Example #2
0
    def __init__(self, settings):
        ExitManager.__init__(self)

        fastma = settings.getfloat("MACrossoverExitManager", "fastma")
        slowma = settings.getfloat("MACrossoverExitManager", "slowma")
        self.close = AdjustedClose()
        self.fastma = SimpleMovingAverage(metric=self.close, period=fastma)
        self.slowma = SimpleMovingAverage(metric=self.close, period=slowma)

        # add the metrics to the entry manager, this will cause them
        # to automatically handle the stream of bar data
        self._addMetric(self.close)
        self._addMetric(self.fastma)
        self._addMetric(self.slowma)