diff --git a/main.py b/main.py index c77f8ab..4fc22d5 100755 --- a/main.py +++ b/main.py @@ -87,6 +87,11 @@ def on_connect(): # Bot callbacks ################################### +@btc_eh.on_event(EventKind.CLOSE_POSITION) +def on_close_position(event: Event, _): + loop.run_until_complete(bot.close_position(event.metadata.position_id)) + + @btc_eh.on_event(EventKind.NEW_TICK) def on_new_tick(event: Event, status: SymbolStatus): tick = event.tick