3
$\begingroup$

I built a strategy in R and I would like to send the orders directly to a broker, instead of creating a CSV file that would be emailed later on.

I was told to use FIX protocole, but I so far do not see any common ground with R. Is there a way to create and send order via FIX in R ? Does anyone has a step-by-step guide on how to set it up ?

There is very little discussion about the subject out there.

Thank you if you have the answer.

$\endgroup$
3
$\begingroup$

It is pretty easy to call C++ from R using Rcpp package. Then you can use QuickFIX for example.

| improve this answer | |
$\endgroup$
0
$\begingroup$

https://en.wikipedia.org/wiki/Financial_Information_eXchange

FIX is a huge protocol for institutional investors really, are you working at a bank.

Do you have a broker/ did your broker tell you to use FIX or something else. FIX is not generally used on the retail side of the market, and generally API calls are used and these differ depending on which broker you use.

R being a stats language you really need a programming language that can interface with API, for example the Requests library in Python is a good example that can send Http requests and process the response.

An example of brokers with API (non exhaustive)

  • Interactive Brokers
  • IG
  • OandA
  • FXCM

and also asked here https://stackoverflow.com/questions/59327/what-online-brokers-offer-apis

I would stay away from FIX if you can as it can cost a lot to actually join the fix protocol as well where as a broker with an API will be free (bar spreads and margin).

| improve this answer | |
$\endgroup$
  • $\begingroup$ Hey, thank you for your answer. I am on the invetsment side, and looking to send orders every day, I am trying to not send a CSV file, but instead a solution that could reach the OMS direct. I appreciate the time you took to reply. $\endgroup$ – Franky Doul Dec 31 '19 at 1:13
  • $\begingroup$ Cool don't give me a negative for the answer it's still and answer, its not an incorrect answer. If you have an OMS then definitively go via the OMS as that will have all the testing of the FIX inside it. Creating your own FIX from scratch is very hard with lots and lots of testing on your half and on the counterparts to confirm that they have received the correct order from you. There is an R package called httr to deal with post requests for an API. $\endgroup$ – nicktids Dec 31 '19 at 2:17
  • $\begingroup$ Wait, I hadn't rated the answer, someone else did :) I am nice! $\endgroup$ – Franky Doul Dec 31 '19 at 3:37
  • $\begingroup$ Cool No problem I'm sure I can make it up in the future. Good luck with you work. I would have a look at python to build the api much more flexible. I chose python over R a long time back for the general purpose that python brings over R. But hey some times I would love to know R more for stats purposes. $\endgroup$ – nicktids Dec 31 '19 at 3:55
  • $\begingroup$ Hey, thanks a lot. I have been working on R 10-12hr a day for the last 4 years. But this is the first time I have to send orders. I usually just use it for statistics. I went for R in 2013, not sure why to be honnest, may be it looked easier than Python :) $\endgroup$ – Franky Doul Dec 31 '19 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.