You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
495 B

import collections
from decimal import Decimal as D
import sys
import ast
import datetime
DEMO = "demo" in [*map(str.lower, sys.argv[1:])]
# assumes contract size of 100
Digital = collections.namedtuple("Digital", "low high bids asks exchange market_id")
def cents(m):
return int(D(m)*100)
def updlog(*o):
print("["+datetime.datetime.now().time().isoformat().split('.')[0]+"] ", *o)
def read_auth(name):
with open(name+".auth") as f:
return ast.literal_eval(f.read())