INNER CODE UNIT · Python

get_all_ask_size

5ymph0en1x/SyDOM · sydom.py:100

def get_all_ask_size(k):
    size_total = 0
    for i in range(0, k):
        size_total += get_ask_size(i)
    return size_total


def get_bid(k):
    list_buy = []
    data = ws_bmex.market_depth()
    for batch in data:
        if batch['symbol'] == instrument_bmex:
            if batch['side'] == 'Buy':
                list_buy.append(batch)
    list_buy.sort(key=lambda i: i['id'])
    return list_buy[k]['price']


View source record →

📰 Research Paper
Loading…
⏳ Fetching content…