Add example of options chain usage
This commit is contained in:
parent
97c5bd982f
commit
9b6405dc30
@ -38,4 +38,9 @@ class OptionsChain:
|
|||||||
return options.loc[options['Strike Distance'].idxmin()]
|
return options.loc[options['Strike Distance'].idxmin()]
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return str(self.options_chain)
|
return str(self.options_chain)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
options_chain = OptionsChain('$SPXW.X', datetime.now())
|
||||||
|
print(options_chain)
|
||||||
|
print(options_chain.closest_contract_by_credit(5.0, OptionType.PUT))
|
Loading…
Reference in New Issue
Block a user