henrydatei / wikifolio-api

A Python API-Wrapper for the unofficial wikifolio API
GNU General Public License v3.0
17 stars 4 forks source link

I can buy, but I cant sell #7

Closed jan85141 closed 1 year ago

jan85141 commented 1 year ago

Hello, buying works nice with: wf = Wikifolio.Wikifolio(user, passwd, wiki_id) order = wf.buy_quote(1, isin) it counts up to around 5...10 and opens the trade properly. order.success is True and wikifolio shows me the trade But selling with order = wf.sell_quote(1, isin) does not work it counts endless without error message can anyone tell me how to close the trade?

greetings

henrydatei commented 1 year ago

Quote Sell (and quote Buy) are always a bit problematic. I have no idea why, but it's implemented exactly the same way as in the website but on the website it's reliable.

The best solution for you now is to use Limit Orders

jan85141 commented 1 year ago

Thanks, with limit orders it works. Can you tell me how I can get the ask/bid price? I didnt find a method for this.

henrydatei commented 1 year ago

There is no method for this. Depending on how precise you data has to be you could use Yahoo Finance and the Python Package yfinance or try to get the data directly from Lang & Schwarz (the exchange that Wikifolio works with).

jan85141 commented 1 year ago

Thanks for the quick answers. It works now. I take the current price directly from wikifolio by webscraping.

henrydatei commented 1 year ago

If you want to share your code for getting the current price then feel free to make a pull request 😊