Search
× Search
Friday, December 20, 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.

Easy algo trading strategies to implement using R ?

photo

 Nitin Agrawal, .

 Saturday, November 29, 2014

Hi all, I have been able to connect my Interactive Brokers paper trading account to R API IBrokers. I have also been able to put market and limit orders using R API. Can you guys tell me any easy algo trading strategy which I can implement to test? Even if you have used that with any other language ( Java/ C# etc) or it is not much useful now a days then that would also work for me as I have to test something. Thank you. Nitin


Print

9 comments on article "Easy algo trading strategies to implement using R ?"

photo

 Salah Elmorry, Founding Partner at Systemathics

 Sunday, November 30, 2014



HI Nitin, try Pair Trading or Turtle Trading models.


photo

 Jacob Umflat, Quantitative Researcher at WhiteBayTech

 Sunday, November 30, 2014



Why not use moving averages crossover?

Very easy to implement..


photo

 Anton Pastoriza, Senior Manager at BBVA

 Sunday, November 30, 2014



Try Pair Trading. For the first implementations, consider the usage of liquid assets that are highly correlated (rho>=0.9) intraday. It is easy to backtest.


photo

 Franck Bardol, Data Scientist & data intelligence evangelist

 Sunday, November 30, 2014



to finish to set up / test everything is ok, start with this "hello word" strategy :

moving average cross (mavg)

(very) simplified pseudo-code :

if fast mavg (7 periods) cross above slow (20 periods) mavg then buy at market

if fast mavg (7 periods) cross below slow (20 periods) mavg then sellshort at market


photo

 Pablo Torre, Data Solutions Manager @FractalSoft Data Analysis

 Sunday, November 30, 2014



if (price==low):

buy;

elif (price==high):

sell;


photo

 Vasily Nekrasov, Risk analyst and model developer at Total Energie Gas GmbH

 Monday, December 1, 2014



>Why not use moving averages crossover?


>Very easy to implement..


Yes! They even work(ed) on the German market.


Have a look how I have implemented it in R with help of quantmod:


http://www.yetanotherquant.com/rcode.zip (file 4_3.r)


photo

 Aatos Heikkinen, Hired gun, data scientist, comp.physics PhD. R&D consulting: BI,econophysics, R, Haskell, C++, JS, NoSQL, AI,innovation.

 Monday, December 1, 2014



Do you think quantmod would work for you? http://www.quantmod.com/examples/charting/


photo

 Tad Slaff, Co-founder/CEO at Inovance

 Thursday, December 4, 2014



If you are interested in leveraging R's machine-learning capabilities to trade as well, I've done a couple posts that walk you through the process.



Here's a basic example on using a decision tree to help find the parameters: https://www.inovancetech.com/blogML3.html and be sure to check out the backtesting post as well.



Hope that's helpful!


photo

 Eliad Hochshteadt, Electronic Trading at Bank of America Merrill Lynch

 Thursday, December 4, 2014



Hi Nitin,

What granularity of data do you have in your possession ? intra day, close, tick by tick ?

Assuming you can see tick data, consider something real simple:

- calculate average volatility on a minute by minute of say 21 days --> that would give you a rough estimation for how the spread changes throughout the day (take moving average if the data seems too spiky)

- based on vol estimations, identify high and low points through the day (say on average, low vol is seen around 08:05, as well as 15:26, daily).

- as a start, position the following trades at the points of high volatility:

**passive (say couple of ticks than near touch) buy order.

**passive (say couple of ticks than near touch) sell order

You'll have a good probability for the price to shift twice in your favour; once upwards so someone cross your passive sell order, and another time when the price shift downwards to lift your passive bid.

if you're working on minutely estimations, the IB latency won't kill you.

if you're prices are within the calculated vol spead, there is a good change for the strategy to work.

Keep us update with your preferred choice and best of luck.

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