diff --git a/bfxbot.py b/bfxbot.py index 8f073d1..23c7947 100755 --- a/bfxbot.py +++ b/bfxbot.py @@ -258,7 +258,7 @@ def on_state_min_profit(status: Status): @eh.on_state(State.CRITICAL) async def on_state_critical(status: Status): await status.add_event(Event(EventKind.CLOSE_POSITION, - status.get_current_tick())) + status.get_current_tick())) @eh.on_state(State.PROFIT) @@ -313,10 +313,11 @@ async def calculate_best_closing_price(status: Status): if is_long_pos: closing_price = bid_price * (1 - OFFER_PERC / 100) else: - closing_price = -ask_price * (1 - OFFER_PERC/100) + closing_price = -ask_price * (1 - OFFER_PERC / 100) return closing_price + def net_pl_percentage(perc: float, reference_fee_perc: float): return perc - reference_fee_perc @@ -377,11 +378,11 @@ async def main(screen: Screen): if plfees_percentage > max_perc: max_perc = plfees_percentage await status.add_event(Event(EventKind.NEW_MAXIMUM, - status.get_current_tick())) + status.get_current_tick())) if plfees_percentage < min_perc: min_perc = plfees_percentage await status.add_event(Event(EventKind.NEW_MINIMUM, - status.get_current_tick())) + status.get_current_tick())) min_perc_colored = colored_percentage( min_perc, "red") if min_perc < 0.0 else colored_percentage(min_perc, "green")