-
Notifications
You must be signed in to change notification settings - Fork 79
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
add other time in force types to order details #34
add other time in force types to order details #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this. Very much appreciated.
I'm happy to merge but could you just address the comment about the time_in_force
property and also just add an entry in the CHANGELOG
.
tastyworks/models/order.py
Outdated
@dataclass | ||
class OrderDetails(object): | ||
type: OrderType = None | ||
time_in_force: str = 'Day' | ||
time_in_force: TimeInForce = TimeInForce.DAY | ||
gtc_date: str = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we store this as a datetime
? I think it would make a lot more sense to API users if they don't have to parse the string themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Good call, updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. Thank you! 🎉
Problem addressed
The problem/issue addressed by this PR is #8. Adding more time in force options like GTC and GTD.
Solution
Added a time-in-force Enum property to the OrderDetails object. Also add a gtc-date which is only relevant when using the GTD option. Made sure to check the payload the tastyworks api send when using this time in force option.
Checklist