-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiffscalp.py
More file actions
28 lines (24 loc) · 965 Bytes
/
diffscalp.py
File metadata and controls
28 lines (24 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import time
from mtgoxcore import MtGoxCore
from tradehillcore import TradehillCore
from decimal import Decimal
GOXFEE = Decimal('0.0053')
HILFEE = Decimal('0.0054') # Referral code
gox = MtGoxCore()
hil = TradehillCore()
while True:
goxtick = gox.ticker()['ticker']
hiltick = hil.ticker()['ticker']
goxsell = Decimal(goxtick['buy']) * (1 - GOXFEE)
goxbuy = Decimal(goxtick['sell']) / (1 - GOXFEE)
hilsell = Decimal(hiltick['buy']) * (1 - HILFEE)
hilbuy = Decimal(hiltick['sell']) / (1 - HILFEE)
if hilbuy < goxsell:
print time.ctime(time.time())
print ' Buy on Tradehill for %.3f, sell on MtGox for %.3f --\
make %.2f%% profit!' % (hilbuy, goxsell, 100 * (goxsell - hilbuy) / hilbuy)
if goxbuy < hilsell:
print time.ctime(time.time())
print ' Buy on MtGox for %.3f, sell on Tradehill for %.3f --\
make %.2f%% profit!' % (goxbuy, hilsell, 100 * (hilsell - goxbuy) / goxbuy)
time.sleep(60)