Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing close time from Order Structure #22230

Open
Nomad-Soul opened this issue Apr 21, 2024 · 2 comments
Open

Missing close time from Order Structure #22230

Nomad-Soul opened this issue Apr 21, 2024 · 2 comments
Assignees

Comments

@Nomad-Soul
Copy link

Nomad-Soul commented Apr 21, 2024

Operating System

Windows 11

Programming Languages

JavaScript

CCXT Version

4.3.1

Description

The data returned from ccxt does not provide a unified property for the closing time (i.e. in case of a limit order, the opening time and the moment in which it would be filled will differ).

E.g. see this slightly edited order structure from Coinbase. A kraken order also had an undefined "lastTradeTimestamp" (if that is meant to be the closing time)

{
  "info": { ... },
  "id": "...",
  "clientOrderId": "...",
  "timestamp": 1705100494781,
  "datetime": "2024-01-12T23:01:34.781057Z",
  "lastTradeTimestamp": "undefined",
  "symbol": "ETH/EUR",
  "type": "limit",
  "timeInForce": "GTC",
  "postOnly": false,
  "side": "buy",
  "price": 2286.78,
  "stopPrice": "undefined",
  "triggerPrice": "undefined",
  "amount": 0.00867595,
  "filled": 0.00867595,
  "remaining": 0,
  "cost": 19.839988941,
  "average": 2286.78,
  "status": "closed",
  "fee": { "cost": "0.119039933646", "currency": "EUR" },
  "trades": [],
  "fees": [ { "cost": 0.119039933646, "currency": "EUR" } ],
  "lastUpdateTimestamp": "undefined",
  "reduceOnly": "undefined",
  "takeProfitPrice": "undefined",
  "stopLossPrice": "undefined"
}

Timestamp provides the opening time. The closing time is not present in the returned structure and needs to be found in the raw "info" object on a per exchange basis.

Code

  

@carlosmiei carlosmiei self-assigned this Apr 21, 2024
@carlosmiei
Copy link
Collaborator

Hello @Nomad-Soul, thanks for your suggestion we will take it into consideration and analyze if we can add it to the Order structure.

@Nomad-Soul
Copy link
Author

No worries. If you can agree on the name and location of the property I can try to add its initialisation for Coinbase and Kraken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants