Making R Load libraries at startup

There are sometimes things that I want to do, and have to spend a while figuring out. So I am going to store that knowledge on here.

Loading R libraries at start… (works in Opensuse linux)

Easy, create a file in /usr/lib64/R/etc called ‘Rprofile.site’. Put in that file the libraries you want to load.

library(ggplot2)

When you load R those libraries with be loaded.

Right, next time I reinstall my system I will know where to look if I have forgotten…

Full Trading Platform Built

I have finished building a virtual trading platform. The idea is that this can be used to learn trading algorithms for shares on UK and US markets, and then later be coupled to a real trading platform using an API provided by a company such as Interactive Brokers. For now it just takes virtual positions, so no real money at risk.

The algorithm currently in use is pretty naive and needs to be replace. The question is with what. In many ways I would like the system to learn its own method for trading, and in true complex systems style, perhaps I don’t even have to be able to understand what it is doing. I intend to take an agent based approach by having a population of agents running different algorithms or the same algorithms with different learnt parameters. Successful agents will be allowed to duplicate and persist, unsuccessful with be removed from the population. Essentially a evolutionary approach not a million miles away from a genetic algorithm.

Multiple sources of information will be able to the agents to inform their trading. From sentiment analysis (twitter etc), to a large database of historical share prices  and realtime market data. The intention is that the learning part of the system will learn what subset of the available information is useful for trading share. The system only needs to be able to be slightly better than random chance.