コード例 #1
0
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
コード例 #2
0
 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')
コード例 #3
0
 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')
コード例 #4
0
 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')
コード例 #5
0
 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')