Knibbaz / Trailingbot

Automated open source trading bot by trailing the grid.
1 stars 1 forks source link

It should be possible to see if trades were profitable or not #3

Closed Knibbaz closed 2 years ago

Knibbaz commented 2 years ago

A trade is profitable:

Knibbaz commented 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)})