示例#1
0
                print("ERROR MESSAGE : " + str(ORDER["error"]) + "\n")
                print("The system will try to do again this order later on.\n")
                Orders_to_do_again.append(order)
            else:
                order_done["order"] = ORDER
                total = float(order["rate"]) * float(order["amount"])
                total = float("{0:.10f}".format(total))
                order_done["order"]["resultingTrades"] = {}
                order_done["order"]["resultingTrades"]["type"] = order["type"]
                order_done["order"]["resultingTrades"]["amount"] = order[
                    "amount"]
                order_done["order"]["resultingTrades"]["rate"] = order["rate"]
                order_done["order"]["resultingTrades"]["total"] = total
                Orders_done.append(order_done)

    order_server.Add_New_orders(Orders_done)

    clear_terminal()
    print(
        "From Now, the system don't need you anymore. It will run alone. Before to leave, we'll give you some comments :\n"
        +
        "Please make sure that the computer will have always internet connexion\n"
        +
        "Please make sure that the computer have enough power for all the time that you need\n"
        + "An overheat may produce\n" +
        "If an error occurs, it will maybe stop\n" +
        "TO STOP THE PROGRAMME PLEASE PRESS CTRL + C\n\tHave a good day ;-) ")

    time_server.Sleep_Time(5)

    erreur = 0
示例#2
0
from Order import Order

order_identification = {1: {"currencyPair": "BTC_XRP", "amount_buy": 10, "amount_sell": 8, "rate_buy": 0.0023,
                             "rate_sell": 0.0025}}

MY_order = Order(order_identification)

new_orders = [{"identification": 1, "order": {"orderNumber": 10002, "resultingTrades" : [{"amount": 10,
                                                                                           "date": "2018-07-19 21:08",
                                                                                           "rate": 0.0023,
                                                                                           "total": 0.023,
                                                                                           "tradeID": 21029,
                                                                                           "type": "buy"}]}}]
MY_order.Add_New_orders(new_orders)

#MY_order.Order_done([{"orderNumber": 10002}])
#MY_order.Order_done([{"orderNumber": 10003}])

for numero in range(0, 10):
    orders = [{"identification": 1, "order": {"orderNumber": numero, "resultingTrades": [{"amount": 10,
                                                                                "date": "2018-07-19 21:08",
                                                                                "rate": 0.0023,
                                                                                "total": 0.023,
                                                                                "tradeID": 21029,
                                                                                "type": "buy"}]}}]
    MY_order.Add_New_orders(orders)
    MY_order.Order_done([])


order_new = [{"identification": 1, "order": {"orderNumber": 20, "resultingTrades": [{"amount": 10,
                                                                                "date": "2018-07-19 21:08",