def testGetValue(self): calendar_util = MockCalendarUtil() instrument = MockInstrument() er = EfficientRatio.get_value(instrument, 15, 5, calendar_util) self.assertEqual(er, 1./6., 'good efficient ratio')
def _get_alpha(self, date, depth): er = EfficientRatio.get_value(self.instrument, date, depth, self.calendar_util) return (er*(self.fast_ratio-self.slow_ratio)+self.slow_ratio)**2