def createHighLow(index): MARKET = Market() CONFIG = config._Config(index) portfolio.delete(CONFIG, index) portfolio.create(CONFIG, index, 10000, '{%s: $0}' % index) file_name = './quant/highLow/peak%s.h5' % index.split('.')[0] simulate(MARKET, CONFIG, 'highlow', index, '2014-01-06', '2014-10-21', file_name, '{short: 18, long: 47, during: 2, win: 0.07, loss: 0.03}') return index
def test_setting_complex(self): conf = {'foo': {'bar': 'baz'}} with patch.object(config, '_load', return_value=conf): c = config._Config() c.foo.bar = 'other' self.assertEqual(c.foo.bar, 'other')
def test_setting_simple(self): conf = {'foo': 'bar'} with patch.object(config, '_load', return_value=conf): c = config._Config() c. foo = 'other' self.assertEqual(c.foo, 'other')
def test_setting_simple(self): conf = {'foo': 'bar'} with patch.object(config, '_load', return_value=conf): c = config._Config() c.foo = 'other' self.assertEqual(c.foo, 'other')