Пример #1
0
def main():
    arbitrer = arbitrage.Arbitrer()
    depths = arbitrer.depths = json.load(open("speed-test.json"))
    start_time = time.time()
    testobs = TestObserver()
    arbitrer.observers = [testobs]
    arbitrer.arbitrage_opportunity("BitstampUSD", depths["BitstampUSD"]["asks"][0],
                                   "KrakenEUR", depths["KrakenEUR"]["asks"][0])
    # FIXME: add asserts (from Maxme)
    elapsed = time.time() - start_time
    print("Time: %.3f" % elapsed)
Пример #2
0
def main():
    comment('initiate arbitrer')
    arbitrer = arbitrage.Arbitrer()
    comment('load depths')
    depths = arbitrer.depths = json.load(open("speed-test.json"))
    start_time = time.time()
    comment('initiate obs')
    testobs = TestObserver()
    arbitrer.observers = [testobs]
    comment('arbitrer.arbitrage_opportunity')
    arbitrer.tick()
    elapsed = time.time() - start_time
    comment("Time: %.3f" % elapsed)
    arbitrer.arbitrage_opportunity("BitstampUSD",
                                   depths["BitstampUSD"]["asks"][0],
                                   "MtGoxEUR", depths["MtGoxEUR"]["asks"][0])
    # FIXME: add asserts
    elapsed = time.time() - start_time - elapsed
    comment("Time: %.3f" % elapsed)
Пример #3
0
 def setUp(self):
     self.arbitrer = arbitrage.Arbitrer()