I have been in the Quantitative Trading/Investment industry for more than 15 years, developing, testing and trading all sorts of investment strategies on all major asset classes. I started this blog to discuss the use of R in the context of  systematic investment strategies.

I also provide consulting services for high net worth individuals and institutions on all topics related to this blog which entails but is not limited to:

  • Quantitative evaluation of investment/trading strategies
  • Factor Modelling & Evaluation
  • Risk Management
  • Portfolio Construction / Optimisation
  • R Training
  • R Quantitative Modelling
  • R Report Generation & Template
  • Shiny Applications Development

Feel free to contact me should you want to learn more or have specific questions: thertrader@gmail.com

Arnaud Amsellem / The R Trader


  1. Bruno says:

    Hi there,

    I just started the Statistical Learning course at Stanford with the aim of getting a part-time master in statistics from there.

    We just learned about decision trees and how to use it in R so your post was quite timely. I’ve also been a keen investor over the years and have gone to Penn/Wharton for finance so am quite familiar (in theory) with the market.

    Would you mind sharing your R code for CART analysis so I can take a look to learn as well as to provide comments.

    Thank you.


    • The R Trader says:

      Hi Bruno and thank you for reaching out.
      I’m afraid I can’t share the code as I might use it professionally at some point. However I can provide you with some advices on how to use CART in R. Please email me privately should you have any question.

  2. Thank you for sharing your wisdom and insight on various topics here… Its always refreshing reading quality information about things I have a passion in.

  3. STEVEN NJUKI says:


    I had a look at your code for using genetic algorithms, and when I tried running it as is I got the error

    Error in fn(par, …) : could not find function “SharpeRatio.annualized”

    According to the packages documentation, this function exists. I am using R version 3.10. Thanks for any help.

    • The R Trader says:

      Hi Steven,

      SharpeRatio.annualized is part of the PerformanceAnalytics package. From the message above it sounds like you didn’t install the package. Install it and run library(PerformanceAnalytics) before running the code.

      Hope this helps

  4. Marc says:

    Hey Steven,

    Great blog! Do you have any experience of routing actual orders using a Shiny-R app? I’d like to use shiny perpetually running on my EC2 server to interact with IB or via Ninjatrader or something similar. Most API’s / SDKs have C++, java or excel/VB in mind but I prefer R.

    Side question: I couldn’t find a comprehensive list of all stocks traded on the US and Canadian exchanges so I built a scraper using the XML package to take the unique names from a bit over a year of the list of daily earnings calendars from yahoo finance. Do you happen to know a better way to go about this?

    Any light you could shed would be appreciated,

    • The R Trader says:

      Hi Marc,

      I just realised I didn’t answer your question…
      I don’t have any experience to use Shiny to route orders and to be honest it sounds a bit awkward. Generally speaking R is excellent at prototyping but probably not the right tool for live trading.

      Regarding your other question. I wouldn’t build a list of names but a list of ISIN codes instead. Putting this differently: ISIN should be the key of your security master.
      Companies change their names sometimes or get acquired which makes names a poor unique identifier. ISIN are unique and constant over time.

      Hope this helps

  5. consuli says:

    Do you already know the new http://www.quantinvestor.net, forum for quantitative investing?


  6. consuli says:

    Hello Arnaud!

    I’d like to coauthor in thertrader.com blog, if you also want to. You are also welcome to my QuantInvestor forum (www.quantinvestor.net). The forum is open to any quantitative programming language. However, as I am also one of the mods in the german R forum (forum-r-statistik.de), the R proportion is pretty high. However, I am also addressing theoretical topics as well.


  7. I tend not to leave a response, however I browsed a
    great dea of comments on this page About The R Trader.

    I do have a couple of questions for you if you ddo not mind.
    Could it be onlly me or do some of the remarks coe across like tthey
    are written bby brain dead folks? 😛 And, if you arre writing at other
    online social sites, I’d like to follow you. Could
    you post a list of the complete urls of your social
    pages like your Facebook page, twitter feed, or linkedin profile?

    Feel free too surf to myy web page Jasa Analisis / Analisa Statistik / Olah Data dan Bimbingan Skripsi

  8. Vinh Luong says:

    How do I subscribe to this blog? Can’t seem to find the subscribe button anywhere.

  9. Helmuth Vollmeier says:

    Arnaud, are you aware that the historical data changes after every dividend, capital distribution stock split etc. ? The updating method you describe in your post ensures that after a few weeks the database is garbage. Unless you programmatically take care of all these issues yourself stay away from daily appends as far as you can and download ALL the data on a daily schedule.

    • The R Trader says:


      I’m well aware of the changes in the historical data. This is why I download both the close price (not adjusted) and the adjusted price. I run almost exclusively short term strategies therefore the close price is the one I use (the data is used as it was). In addition, I avoid trading on ex-div dates given the level of tax I would have to pay. In a nutshell, It doesn’t arm to include the adjusted price in the daily download even if I don’t use it.


  10. Stephen says:

    Hi Arnaud, great blog. Do you know of a way to import historical data from NinjaTrader into R?

Leave a Reply