Report open interest window min and max in get_derivatives
This commit is contained in:
1 parent
3e5db79d4e
commit
5b7490ac48
1 file changed
+2
@@ -271,6 +271,8 @@ async def open_interest_part(symbol: str, period: str, limit: int) -> dict:
|
||||
|
||||
return {
|
||||
"latest_contracts": float(last["sumOpenInterest"]), "latest_value_usdt": round(float(last["sumOpenInterestValue"])),
|
||||
"window_min_contracts": min(float(r["sumOpenInterest"]) for r in rows),
|
||||
"window_max_contracts": max(float(r["sumOpenInterest"]) for r in rows),
|
||||
"window_change_pct": pct(float(last["sumOpenInterest"]) / float(first["sumOpenInterest"]) - 1),
|
||||
# 由持仓价值 / 持仓量推算的同窗口价格变化,用于对照持仓量与价格的方向
|
||||
"window_price_change_pct": pct(price(last) / price(first) - 1),
|
||||
|
||||
Reference in new issue
Block a user