Add example of options chain usage

This commit is contained in:
moshferatu 2024-02-13 12:19:30 -08:00
parent 97c5bd982f
commit 9b6405dc30

View File

@ -38,4 +38,9 @@ class OptionsChain:
return options.loc[options['Strike Distance'].idxmin()]
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))