using ticker price to calculate final closing
This commit is contained in:
parent
e13e0eea2e
commit
a775317658
@ -307,13 +307,12 @@ async def calculate_best_closing_price(status: Status):
|
|||||||
is_long_pos = p.amount < 0
|
is_long_pos = p.amount < 0
|
||||||
|
|
||||||
pub_tick = await bfx.get_public_ticker(status.symbol)
|
pub_tick = await bfx.get_public_ticker(status.symbol)
|
||||||
bid_price = pub_tick[0]
|
ticker_price = pub_tick[6]
|
||||||
ask_price = pub_tick[2]
|
|
||||||
|
|
||||||
if is_long_pos:
|
if is_long_pos:
|
||||||
closing_price = bid_price * (1 - OFFER_PERC / 100)
|
closing_price = ticker_price * (1 - OFFER_PERC / 100)
|
||||||
else:
|
else:
|
||||||
closing_price = -ask_price * (1 - OFFER_PERC / 100)
|
closing_price = -ticker_price * (1 - OFFER_PERC / 100)
|
||||||
|
|
||||||
return closing_price
|
return closing_price
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user