Search
× Search
Sunday, December 22, 2024

Archived Discussions

Recent member discussions

The Algorithmic Traders' Association prides itself on providing a forum for the publication and dissemination of its members' white papers, research, reflections, works in progress, and other contributions. Please Note that archive searches and some of our members' publications are reserved for members only, so please log in or sign up to gain the most from our members' contributions.

How to connect Software R with the broker?

photo

 Victor A. Rico, Operador en Mercados Financieros . Creador de carteras de inversión.

 Wednesday, August 16, 2017

Hello friends !!! I would like to connect the software R with the broker to enter the trades automatically. I do the analysis in R and determine the positions that I will introduce in the broker and I would like to be able to connect it so I do not have to do it manually since in the short term it is a very tedious job. Can you help me ? . Know some tutorial or book where you can look how to do it ? Thank you very much


Print

16 comments on article "How to connect Software R with the broker?"

photo

 private private,

 Wednesday, August 16, 2017



So you only want to send buy/sell orders to your broker? To which broker do you want to connect and what kind of orders (market, limit, stop)?

You can look for R packages that solves this (i'm not familiar with), or use an approach where you bridge R to your broker via Java or Python. A simple solution would be to define your own simple protocol that writes lines to a file from R (containing time, order, type, instrument, size, lmt price). Then your bridge program scans this file for new lines (checks the time stamp to prevent sending old orders) and uses the broker API's to send the orders. But if you need a more tight integration this is perhaps not the way to go.


photo

 Victor A. Rico, Operador en Mercados Financieros . Creador de carteras de inversión.

 Thursday, August 17, 2017



Hellos Hans-Peter Smit, thanks. I am using the broker of ayondo markets.For ayondo there are no packages in R. I will investigate how to do it since I have seen people who introduce many operations at the same time so that in some way it will be able to connect. With respect to the type of order I use orders to market and stop. Thank you.


photo

 private private,

 Friday, August 18, 2017



Victor I looked up Ayondo and it seems there is no API for automating orders. I don't think this broker is suitable for what you want. Ayondo is more about following other traders, called TopTraders, but it seems those traders can only order manually.


photo

 Miguel Duarte, Engineering Manager at Weatherford

 Friday, August 18, 2017



I'm also interested. I wonder if MT4 or MT5 (MetaTrader) allows this level of integration with R. I know for a fact that R can communicate with any Visual Study language, there are libraries available online for that matter.


photo

 private private,

 Saturday, August 19, 2017



Well at this point it seems that no integration is possible with ayondo. Perhaps they support FIX protocol, but this you need to ask your contact at ayondo.


photo

 Victor A. Rico, Operador en Mercados Financieros . Creador de carteras de inversión.

 Saturday, August 19, 2017



Hello, supposedly you can not in Ayondo yet, but I've seen some top traders who introduce many trades in the same minute, so I've thought there's some way to automate the trades. Anyway I will ask ayondo again. Thank you for your help.


photo

 Miguel Fernández Águila, Optimización y Mejora de Departamentos de Administración en PYMES.

 Sunday, August 20, 2017



Do you know Visual Chart with Esfera Broker ?


photo

 Ryan Kauffman, MBA, Team Leader at Northern Trust Corporation

 Sunday, August 20, 2017



Ok, random thought here, but if your broker doesn't have an API you can connect with, what about using the PyAutoGui module in Python to fill out trades orders? That may be a possible solution to your issue.


photo

 Fredrik Daveus, Managing Partner at Kidbrooke Advisory Aktiebolag

 Sunday, August 20, 2017



Seems you should get a broker with an API e.g. Interactive Brokers. When it comes to the actual implementation on your side. Don't underestimate the complexity of managing order flow programmatically in a safe way (partial fills, cancelled orders, asynchronous api messages etc etc)


photo

 Maggie C., Director, Technology Services and Operations

 Sunday, August 20, 2017



I completely agree with Fredrik Daveus. Consider this - not only will other applications allow integration through their API, but you may be surprised by their strategy building tools that negate the need for what you are trying to accomplish. Hope you find the best solution.


photo

 Pablo Bañados Norero, en BR ARQ Ltda.

 Sunday, August 20, 2017



I've used the ib api for R, works perfectly; although our automatic trading is done with a rather big program we did in java, better performance in day trading ops.


photo

 Liza Marchenko, PhD, OTC Financials Clearing, VP at SGX

 Sunday, August 20, 2017



there is API in R to Interactive Brokers. see the link below. I used it, it works perfectly. However R is not ideal in terms of speed, it all depends on your strategy though. https://cran.r-project.org/web/packages/IBrokers/index.html


photo

 Johann Christian Lotter, Programmer

 Monday, August 21, 2017



As long as it's not HFT, R is normally fast enough for live trading, but not fast enough for backtests. Better use a trading software that has both a connection to brokers and a connection to R.


photo

 Victor A. Rico, Operador en Mercados Financieros . Creador de carteras de inversión.

 Monday, August 21, 2017



Hello Johann Christian Lotter. I do not do HFT, my strategies are intradiaries but with few operations. I want to connect R with the broker mainly to save time and not have to be all day in front of the computer.


photo

 private private,

 Monday, August 21, 2017



So the question is how easy you can switch brokers and use a decent API or offer FIX connectivity to integrate it.


photo

 Konstantinos Tsardounis, MPhil, MSc, BSc

 Tuesday, August 22, 2017



Obviously, the best and fastest solution is to use a broker with an API. However, if you are stuck with something else, you could also simulate human activity (say in a virtual machine) with say https://www.autoitscript.com/site/autoit/ in Windows or xautomation tools in linux/unix systems. Workflow could seem like this: text file produced by R and parsing/execution through AutoIt/shell script.

Please login or register to post comments.

TRADING FUTURES AND OPTIONS INVOLVES SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS
Terms Of UsePrivacy StatementCopyright 2018 Algorithmic Traders Association