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

feat: add exercise_options_position #414

Merged
merged 9 commits into from
Mar 5, 2024
Merged

Conversation

hiohiohio
Copy link
Contributor

@hiohiohio hiohiohio commented Mar 1, 2024

Context:

Changes:

  • add exercise_options_position

@@ -317,6 +321,28 @@ def close_position(

return Order(**response)

def exercise_option_contract(
Copy link
Member

Choose a reason for hiding this comment

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

exercise_options_position perhaps?

Copy link
Member

Choose a reason for hiding this comment

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

or maybe not as this is what we call it in the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! agreed to rename!

Co-authored-by: Neal Patel <[email protected]>
None
"""
symbol_or_contract_id = validate_symbol_or_contract_id(symbol_or_contract_id)
response = self.post(
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe response is unused. Not sure if you wanted to log or something.

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 catch! Please let me remove it.

if isinstance(symbol_or_contract_id, (UUID, str)):
return symbol_or_contract_id
raise ValueError(
f"symbol_or_contract_id must be a UUID of an contract id or a string of a symbol."
Copy link
Contributor

Choose a reason for hiding this comment

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

f-string, but there are no interpolated variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! Removed.

"""
A helper function to eliminate duplicate checks of symbols or contract id.

If the argument given is a string, assumed to be a symbol name. If a UUID object, assumed to be an contract id.
Copy link
Contributor

Choose a reason for hiding this comment

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

minor -> "a contract id'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! Fixed!

@hiohiohio hiohiohio changed the title feat: add exercise_option_contract feat: add exercise_options_position Mar 1, 2024
@hiohiohio hiohiohio merged commit f588e3d into master Mar 5, 2024
12 checks passed
@hiohiohio hiohiohio deleted the add-exercise_option_contract branch March 5, 2024 05:43
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