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

add other time in force types to order details #34

Merged

Conversation

sullivanj91
Copy link
Contributor

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

@sullivanj91 sullivanj91 marked this pull request as ready for review February 19, 2019 03:22
Copy link
Owner

@boyan-soubachov boyan-soubachov left a 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.

@dataclass
class OrderDetails(object):
type: OrderType = None
time_in_force: str = 'Day'
time_in_force: TimeInForce = TimeInForce.DAY
gtc_date: str = None
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good call, updated.

Copy link
Owner

@boyan-soubachov boyan-soubachov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thank you! 🎉

@boyan-soubachov boyan-soubachov merged commit 1d84f76 into boyan-soubachov:master Feb 20, 2019
@sullivanj91 sullivanj91 deleted the feature/add-time-in-force branch February 22, 2019 03:59
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

Successfully merging this pull request may close these issues.

3 participants