implemented get/put_profit_loss api with frontend
This commit is contained in:
parent
270619a316
commit
e37e492439
12
main.py
12
main.py
@ -87,6 +87,18 @@ def on_connect():
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@socketio.on('get_profit_loss')
|
||||||
|
def on_get_profit_loss(message):
|
||||||
|
start = message['start']
|
||||||
|
end = message['end']
|
||||||
|
|
||||||
|
profit_loss = loop.run_until_complete(bot.get_profit_loss(start, end))
|
||||||
|
|
||||||
|
socketio.emit("put_profit_loss", {
|
||||||
|
"pl" : profit_loss[0],
|
||||||
|
"pl_perc": profit_loss[1]
|
||||||
|
})
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
# Bot callbacks
|
# Bot callbacks
|
||||||
###################################
|
###################################
|
||||||
|
Loading…
Reference in New Issue
Block a user