def bondSellExec(prices): price = prices.getStockBuy('BOND') if price[0] > 1000: order = Order('add', 0, 'BOND', 'SELL', price[0], price[1]) print(order.getOrderString(), file=prices.exchange) print(order.getOrderString())
def bondBuyExec(prices): price = prices.getStockSell('BOND') if price[0] < 1000: order = Order('add', 0, 'BOND', 'BUY', price[0], price[1]) print(order.getOrderString(), file=prices.exchange) print(order.getOrderString())