JKorf / Bitget.Net

A C# .netstandard client library for the Bitget REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/Bitget.Net/
MIT License
13 stars 10 forks source link

FuturesApiV2.Trading.GetPositionHistoryAsync has no Dates #29

Closed Dosihris closed 3 months ago

Dosihris commented 3 months ago

Describe the bug In the result of FuturesApiV2.Trading.GetPositionHistoryAsync there are two Datetime properties, CreateTime and UpdateTime, both are default(DateTime). In the web surface of bitget i have two properties "Opening Time" and "Closed Time". I am missing these two values...

To Reproduce FuturesApiV2.Trading.GetPositionHistoryAsync

Expected behavior I have two properties with the date and time of opening and closing the position.

JKorf commented 3 months ago

The documentation for the create/update time properties is incorrect. I'll fix it based on the actually returned data. However there is no mention of open/close date times of the position, it seems only one timestamp is returned as the open and close time is the same for the data I checked.

Dosihris commented 3 months ago

Hey Jan, nice to talk to you... i have made two screenshots to make it more clear. The first screenshot shows my visual studio with the debugged return value and the other the bitget web interface with the same demo position... The yellow marked infos are the infos i am missing... If bitget is not returning that, its a pitty... :-| these dates are important to me.

image

image

JKorf commented 3 months ago

Thanks for the update. Here's a screenshot with all the data/fixed parsing of dates: image

As you can see the Create and UpdateTime are the same. I don't know if that's the opening or closing time but only one of those seems to be returned. I'll double check with the Bitget API team

JKorf commented 3 months ago

Ah it looks like I was just confused by testing data; I probably immediately closed the position after opening hence why the timestamps are similar. So it might very well be that the CreateTime is open time, and the UpdateTime the close time. I'll make sure these are fixed in next version

Dosihris commented 3 months ago

Perfect, thank you... You're awesome... I am C# developer since many years and your API-Wrapper is the best of all i have checked... Maybe if there is a way to help sometimes with something, let me know... :-)

JKorf commented 3 months ago

Thanks for the kind words and offer :)

People reporting issues in the library is very helpful to improve the quality, so let me know if you have any other issues 👍

JKorf commented 3 months ago

Release was delayed (on NuGet) due to account issues, but it's available now

Dosihris commented 2 months ago

Hey Jan, i am using this now and i figured out that every historic position should have an Id, like written here: https://www.bitget.com/api-doc/contract/position/Get-History-Position

The response is: { "code": "00000", "msg": "success", "requestTime": 1312312312321, "data": { "list":[{ "positionId": "xxxxxxxxxxx", "marginCoin": "USDT", "symbol": "BTCUSDT", "holdSide": "long", "openAvgPrice": "32000", "closeAvgPrice": "32500", "marginMode": "fixed", "openTotalPos": "0.01", "closeTotalPos": "0.01", "pnl": "14.1", "netProfit": "12.1", "totalFunding": "0.1", "openFee": "0.01", "closeFee": "0.01", "cTime": "1988824171000", "uTime": "1988824171000" }], "endId":"23423432423423234" } }

I need the id of every position to identify everything. If i import the positions into my own database, i need to find out, if i already have this position imported or if its new... I am doing this with an Id.

Do you want a separate ticket for that? Many greetings Nico

JKorf commented 2 months ago

Hi, I've added it in the latest version

Dosihris commented 2 months ago

Indeed, now i have seen it.. Thank you. Now i can continue with my client as well...