tedchou12 / webull

Unofficial APIs for Webull.
MIT License
597 stars 181 forks source link

Retrieving greeks from get_options #383

Open bonsaiheart opened 1 year ago

bonsaiheart commented 1 year ago

webull.get_options(stock="SPY", expireDate="2022-02-17") returns data including the greeks(delta,gamma,rho, etc.)

(webull.get_options("SPY")[0]) returns no greeks:

{'strikePrice': '330', 'call': {'strikePrice': '330', 'volume': '0', 'latestPriceVol': '0', 'expireDate': '2023-02-21', 'tickerId': 1037409846, 'belongTickerId': 913243251, 'activeLevel': 50, 'cycle': 2, 'weekly': 1, 'executionType': 'A', 'direction': 'call', 'derivativeStatus': 0, 'currencyId': 247, 'regionId': 6, 'exchangeId': 189, 'symbol': 'SPY230221C00330000', 'unSymbol': 'SPY', 'quoteMultiplier': 100, 'quoteLotSize': 100}, 'put': {'strikePrice': '330', 'volume': '0', 'latestPriceVol': '0', 'expireDate': '2023-02-21', 'tickerId': 1037409853, 'belongTickerId': 913243251, 'activeLevel': 50, 'cycle': 2, 'weekly': 1, 'executionType': 'A', 'direction': 'put', 'derivativeStatus': 0, 'currencyId': 247, 'regionId': 6, 'exchangeId': 189, 'symbol': 'SPY230221P00330000', 'unSymbol': 'SPY', 'quoteMultiplier': 100, 'quoteLotSize': 100}}

I guess it's not a big problem or anything, in fact maybe I could just help update the wiki so that functionality is more clear. Anyway, thanks for everything my friend.

ICANTFINDAUSERNAMEATALL commented 1 year ago

If you use wb.get_options_by_strike_and_expire_date, it will return the greeks. Heres what you get if you run that command with some info, I did 3/6/23 400c:

[{'strikePrice': '400', 'call': {'open': '2.22', 'high': '4.86', 'low': '1.54', 'strikePrice': '400', 'preClose': '1.26', 'openInterest': 11958, 'volume': '68559', 'latestPriceVol': '4', 'delta': '0.8578', 'vega': '0.0855', 'impVol': '0.1153', 'gamma': '0.0530', 'theta': '-0.1527', 'rho': '0.0280', 'close': '4.61', 'change': '3.35', 'changeRatio': '2.6587', 'expireDate': '2023-03-06', 'tickerId': 1037671138, 'belongTickerId': 913243251, 'openIntChange': 2784, 'activeLevel': 50, 'cycle': 2, 'weekly': 1, 'executionType': 'A', 'direction': 'call', 'derivativeStatus': 0, 'currencyId': 247, 'regionId': 6, 'exchangeId': 189, 'symbol': 'SPY230306C00400000', 'unSymbol': 'SPY', 'askList': [{'price': '4.80', 'volume': '1', 'quoteEx': 'MPRL'}], 'bidList': [{'price': '4.46', 'volume': '230', 'quoteEx': 'XNAS'}], 'quoteMultiplier': 100, 'quoteLotSize': 100}}]

barnix2001 commented 1 year ago

My call it was: wb.get_options_by_strike_and_expire_date(stock='SPY', expireDate="2023-06-30", strike="400", direction='all') And the result it was without greeks: { "strikePrice": "400", "volume": "0", "latestPriceVol": "0", "expireDate": "2023-06-30", "tickerId": 1033593366, "belongTickerId": 913243251, "activeLevel": 18, "cycle": 4, "weekly": 0, "executionType": "A", "direction": "call", "derivativeStatus": 0, "currencyId": 247, "regionId": 6, "exchangeId": 189, "symbol": "SPY230630C00400000", "unSymbol": "SPY", "quoteMultiplier": 100, "quoteLotSize": 100 }