import time from api import buy, sell, get_quote, get_order, cancel_order venue = 'EFTEX' symbol = 'UOZP' account = 'IDS5292091 ' qty = 0 position = 0 while(True): q = get_quote(venue, symbol) bid = 1 bought = False sold = False if(q.bidSize > 0): bid = q.bid + 1 ask = 9999999 if(q.askSize > 0): ask = q.ask - 1 if(qty < 900): b = buy(account, venue, symbol, bid, 100) bought = True if(qty > -900): s = sell(account, venue, symbol, ask, 100) sold = True
def check_api(): pprint(api.get_heartbeat()) pprint(api.get_venue_heartbeat(VENUE)) pprint(api.get_stocks(VENUE)) pprint(api.get_stocks(VENUE)["symbols"][0]["symbol"]) pprint(api.get_quote(VENUE, STOCK))
async def _quote(ctx): try: await ctx.send(api.get_quote()) except Exception as e: await ctx.send(e)