8000 How to use different source for NOPE · Issue #39 · ajhpark/ib_nope · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
How to use different source for NOPE #39
Open
@ajhpark

Description

@ajhpark

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:

  1. Remove these two lines in NopeStrategy.__init__:
    self.qt = QuestradeClient(token_yaml=self.QT_ACCESS_TOKEN)
    self.run_qt_tasks()
  2. Change NopeStrategy.set_nope_value to use the client you want. For example if using TDA, import the TDAClient from tda/tda_client.py and replace self.qt.get_nope() with self.tda.get_nope(). If using neither TDA or Questrade, you will need to write your own client for your NOPE source.
  3. Add an asyncio task to run NopeStrategy.set_nope_value every minute (see NopeStrategy.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0