TradeRepublicApi icon indicating copy to clipboard operation
TradeRepublicApi copied to clipboard

How to buy/sale ?

Open GordonTraveler opened this issue 3 years ago • 7 comments

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.

GordonTraveler avatar Jul 30 '21 11:07 GordonTraveler

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

Zarathustra2 avatar Jul 30 '21 11:07 Zarathustra2

That would be awesome. Thank you!

GordonTraveler avatar Jul 30 '21 12:07 GordonTraveler

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

GordonTraveler avatar Aug 10 '21 12:08 GordonTraveler

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

Zarathustra2 avatar Aug 13 '21 09:08 Zarathustra2

@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!

GordonTraveler avatar Aug 15 '21 20:08 GordonTraveler

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

Jolg42 avatar Oct 19 '21 20:10 Jolg42

@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"]

  • gfd => Good for day
  • gtd => good till date
  • gtc => Good till cancel

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

Zarathustra2 avatar Oct 19 '21 20:10 Zarathustra2