def on_message(ws, message): print("hit") python_dict = json.loads(message) if python_dict['event'] == 'trade': output_str = [ python_dict['data']['microtimestamp'], python_dict['data']['amount_str'], python_dict['data']['price_str'], python_dict['data']['type'] ] fh.FileAdder(output_str, '/pricedata.csv') gt.Funk(output_str)
def Funk(b): bids, asks = getOrders() sdf = SupplyDemandFactor(bids, asks) d = getTransactions("day") ind = PreslavIndicator(d) fh.FileAdder([sdf, ind, time.time(), b[2]], '/indictors.csv')