added on_close event handler
This commit is contained in:
parent
7bbd99ba97
commit
912c4db2e2
5
main.py
5
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
|
||||
|
Loading…
Reference in New Issue
Block a user