Closed Knibbaz closed 2 years ago
The bot will look back in to the price of the previous trade.
When the last trade was a BOUGHT the previous (sell) trade price will be divided by the currentOrder price.
if len(trades) > 0: profit = trades[-1]['price'] / currentOrder * 100
When the last trade was a SOLD the currentOrder price will be divided by the previous (bought) trade price .
if len(trades) > 0: profit = currentOrder / trades[-1]['price'] * 100
At the end the trade will be added to the trades array with a if it was a profitable trade (as bool) trades.append(..., "profitable": bool(profit > 100)})
A trade is profitable: