tfukaza / harvest

Simple and intuitive Python framework for algorithmic trading. Easily create bots to live and paper trade stocks, crypto, and options!
https://tfukaza.github.io/harvest-website
MIT License
124 stars 26 forks source link

Add new brokers #104

Closed tfukaza closed 3 years ago

tfukaza commented 3 years ago

Using documentation in _base.py and the example of robinhood.py, implement

This issue is marked as a good first issue, because it is supposed to be a litmus test of how easy it is to add a new broker support to Harvest, which is one of its selling point.

shershah010 commented 3 years ago

Working on Alpaca

shershah010 commented 3 years ago

For alpaca there are a lot of extra configurations that it supports so I was wondering if I should try to provide all of those or just stick to what has currently been defined. For example Alpaca supports stop and limit stop in addition to limit. And it also return a lot of other information that is not defined in the _base.py. Should those be kept or removed? Also FYI, Alpaca does not support options.

tfukaza commented 3 years ago

I'd say stick with what is already defined. Adding too much functions can make compatibility with other brokers difficult.

shershah010 commented 3 years ago

Working on Kraken, but will probably won't have too much time this week.

shershah010 commented 3 years ago

Hey Tommy, kraken does not have normal asset codes they have these: https://support.kraken.com/hc/en-us/articles/360001185506-How-to-interpret-asset-codes

Also there is no typical buying and selling, there are exchanging from one crypto to another or to various currencies. For example XXDGUSD is used to go from XXDG to USD and back. How should this be handled?

tfukaza commented 3 years ago

Asset codes can be converted. E.g. YahooBroker converts BTC to BTCUSD, which is the convention Yahoo Finance website uses for cryptocurrencies. Something similar can be done for Kraken.

As for buying/selling, I think "converting" from US Dollars to, say, BTC is the same thing as buying BTC. I just checked by buying Bitcoins on Kraken myself, and the platform definitely supports buying crypto with US dollars in the traditional sense.

shershah010 commented 3 years ago

Kraken supports other currencies such as Yen and Pounds. Should we prompt users to select what currency they want to use because that changes the prices I think.

tfukaza commented 3 years ago

For now I think we can hard-code USD but it might be interesting to support foreign currency in the future.

tfukaza commented 3 years ago

Closing this for now, since we need to focus on updating existing brokers.