Implement a string representation of the options chain
This commit is contained in:
parent
7119af4e34
commit
a0f4b62f65
@ -36,3 +36,6 @@ class OptionsChain:
|
|||||||
options = self.options_by_type(option_type)
|
options = self.options_by_type(option_type)
|
||||||
options['Strike Distance'] = abs(options['Strike'] - target_strike)
|
options['Strike Distance'] = abs(options['Strike'] - target_strike)
|
||||||
return options.loc[options['Strike Distance'].idxmin()]
|
return options.loc[options['Strike Distance'].idxmin()]
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return str(self.options_chain)
|
Loading…
Reference in New Issue
Block a user