Zarathustra2 / TradeRepublicApi

Unofficial trade republic API
MIT License
277 stars 68 forks source link

How to buy/sale ? #9

Open GordonTraveler opened 3 years ago

GordonTraveler commented 3 years ago

Hi.

First of all, great work! Love it. But 2 things are needed for algo trading... to buy and sale stocks, etc. :-)

Can you give me an example of how to buy and sale stocks with the API? Or maybe you can make a example file for it. I don't get it from the documentation.

Thanks.

Zarathustra2 commented 3 years ago

Currently not being supported, will add to my todo list, trying to add over the weekend!

GordonTraveler commented 3 years ago

That would be awesome. Thank you!

GordonTraveler commented 3 years ago

Any news about it? How do you catch the API call of TR? Maybe I can help?

Zarathustra2 commented 3 years ago

@GordonTraveler Please take a look here: https://github.com/Zarathustra2/TradeRepublicApi/commit/a391f87ccdd951416068468ea3d7f73d146e7ea5

GordonTraveler commented 3 years ago

@Zarathustra2 Thank you very much Dario. Can you give a short documentation or example? I don't understand all parameter.

self = object itself, nothing to enter. Right? order_id = ?? Is it just a random number or shall I leave it empty? isin = clear, ISIN of the stock order_type = clear... buy or sell size = The amount? Like "3.45"? limit = The limit price I want to buy/sell at. Is there also a market order possible? TR offers 3 options: market order, limit order and stop order. The market order is the default. Usually I use the market order. Also, the TR app it is showing me the "ask price". From where do I get this price? expiry = ?? Don't know. exchange="LSX", = ?? Don't know. callback=print, = Nothing to do here, I guess.

Thank you for your great work!

Jolg42 commented 2 years ago

Note it's now possible to buy/sell from the web app

Zarathustra2 commented 2 years ago

@GordonTraveler

order_id is set by you. Choose something there.

amount = size => The amount of shares you want to buy

I will try to market as well but I am not using TradeRepublic so might take time until I do it.

Expiry needs to be one of ["gfd", "gtd", "gtc"]

Expiry is the exchange you want; just leave it as it is.