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

Wrong sale date with limited order #16

Closed
RaNo99 opened this issue Mar 15, 2020 · 3 comments
Closed

Wrong sale date with limited order #16

RaNo99 opened this issue Mar 15, 2020 · 3 comments

Comments

@RaNo99
Copy link
Contributor

RaNo99 commented Mar 15, 2020

When a sale originates from a limited order, a wrong date is used for the sale. The date when the order was placed is used. The actual sale date should be used instead.

@ncortines
Copy link
Owner

@RaNo99, unfortunately I don't have access to this sort of data. I'd need you to help me by providing some JSON files.

@RaNo99
Copy link
Contributor Author

RaNo99 commented Apr 29, 2020

Here you go:

endpoint: /sw-ptpapi/v1/withdrawals/realtimeTransactions/*

Response part of interest:

{
//...
"order" : {
"exchangeFriendlyTzShortName" : "EST",
"fillsIfNotTooMany" : [ {
"fillDateTime" : "2019-11-25T11:11:09",
"fillPrice" : {
"amount" : "CENSORED",
"currency" : "USD"
},
"fillQuantity" : "CENSORED"
}, {
"fillDateTime" : "2019-11-25T11:11:09",
"fillPrice" : {
"amount" : "CENSORED",
"currency" : "USD"
},
"fillQuantity" : "CENSORED"
}, {
"fillDateTime" : "2019-11-25T11:11:09",
"fillPrice" : {
"amount" : "CENSORED",
"currency" : "USD"
},
"fillQuantity" : "CENSORED"
} ],
"formattedSymbolAndExchange" : "CENSORED",
"goodTillCancel" : true,
"limitOrder" : true,
"limitPrice" : {
"amount" : "CENSORED",
"currency" : "USD"
},
"orderDate" : "2019-11-12",
"orderQuantity" : "CENSORED",
"orderStatusDescription" : "Order is done",
"totalFillQuantity" : "CENSORED",
"uniqueFillDate" : "2019-11-25",
"weightedAverageFillPrice" : {
"amount" : "CENSORED",
"currency" : "USD"
}
},
//...
}

The order was placed on 2019-11-12. Then it waited until 2019-11-25 when the stock price finally grew high enough to match the ordered price. Then, in this particular case, it was sold in three parts (because not immediately there were enough buyers to buy all the stock units at the price I ordered). It's possible that a sale like this could extend over a few days (fortunately in my case all parts were sold on the same day), and that's where I think uniqueFillDate becomes helpful.

@RaNo99
Copy link
Contributor Author

RaNo99 commented Mar 8, 2021

It works fine for me now. Thanks @ncortines .

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

No branches or pull requests

2 participants