Closed tfukaza closed 3 years ago
How will we organize this? The dummy broker is based off the Robinhood broker which does both fetching data and buying and selling stocks. I don't think that the robinhood broker should be split and I though that each broker should follow its template..
E.g. if someone tries to use the Papertrader as a streamer it will give an error like "this broker only works as a brokerage, please use another broker or specify a streamer" I feel like we'll need this organization anyways since there are lot of apis out there that only work as a streamer like Polygon.Io
So Robinhoodbroker stays the way it is. I'm also working on a yahoo broker which is a streamer only broker so that'll be a good example
See #74 for an example of a streamer-only broker class
Since the broker and streamer have different functions to support would it be best to create a base streamer and a base broker and for brokers such as robinhood, it will inherit both broker and streamer?
I think we can do what I did for YahooStreamer
, which is to just raise an Exception when an unsupported endpoint is called. We can also use the mode
attribute to warn the user, for example when YahooStreamer
is set as a broker.
Currently the functionality of DummyBroker is a little confusing - when used as a streamer, it generates dummy data as its name implies, but when used as a broker, it paper trades. Now that brokers have the
mode
attribute, DummyBroker should be split into separate brokers as described in the title.Also, the following name convention is suggested for brokers:
[Name]
for classes that function as streamers && brokers[Name]Streamer
for classes that only work as streamers[Name]Broker
for classes that only work as brokers