CyberPunkMetalHead / gateio-crypto-trading-bot-binance-announcements-new-coins

This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio
MIT License
1.22k stars 302 forks source link

order removed from orders.json in test or failure. #27

Open mikeczabator opened 3 years ago

mikeczabator commented 3 years ago

https://github.com/CyberPunkMetalHead/gateio-crypto-trading-bot-binance-announcements-new-coins/blob/02a70145cff773799e5be301fecbda1af5111e7b/main.py#L103

print(f"sold {coin} with {(float(last_price) - stored_price) / float(stored_price)*100}% PNL")

# remove order from json file
order.pop(coin)
store_order('order.json', order)

these lines should only be called if test_mode=False and place_order on line 101 are successful.

I can follow up with a PR as I dig in more.