How to use different source for NOPE
ajhpark opened this issue · comments
Reason for using Questrade for NOPE data is because there's no efficient way to use IB API to get NOPE, especially since we need to update frequently. Click here see how to get option chain data using the IB API. You need to send a separate request for each contract in the chain which is too slow and there is no endpoint to get it all at once.
Why Questrade? Because I happened to have a Questrade account and their API is good for NOPE, that's about it. Good news is this project can very easily be modified to use a different source for NOPE such as TDA or ORATS if you don't have a Questrade account.
How:
- Remove these two lines in
NopeStrategy.__init__
:
self.qt = QuestradeClient(token_yaml=self.QT_ACCESS_TOKEN)
self.run_qt_tasks()
- Change
NopeStrategy.set_nope_value
to use the client you want. For example if using TDA, import theTDAClient
fromtda/tda_client.py
and replaceself.qt.get_nope()
withself.tda.get_nope()
. If using neither TDA or Questrade, you will need to write your own client for your NOPE source. - Add an
asyncio
task to runNopeStrategy.set_nope_value
every minute (seeNopeStrategy.run_qt_tasks
to see how it's done)
The rest of NopeStrategy
doesn't care how the NOPE value is set and should work fine.