def bid_order_array(market,p,q,reference_price):
    """ make array of orders from array of percents, quantities and reference price """
    i = 0
    orders = list()
    print ("bid order array. ref: " + str(reference_price))
    print (str(p))
    for px in p:
        submit_price = reference_price * (1-px)
        orders.append([market,"BUY",submit_price,q[i]])
        i+=1
    return orders