Site icon R-bloggers

Genetic optimization for Trading Strategies using Rapidminer and R

[This article was first published on a Physicist in Wall Street, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
That is the second tutorial of Rapidminer and R extension for Trading and the first in Video. In the last example the ROC obtained is not as good as it should be to make money in this business, To improve the strategy we will try to optimize the trading strategy. Different methods of optimization and objective functions for trading can be studied in the literature, Finally we will use a genetic non-multiobjetive to optimize our simple strategy.

The simple strategy defined is the following:
For the optimization of the strategy it is used a genetic algorithm. The genetic algorithm will modify the input data by removing any entries (for example indicators) in order to maximize the ROC of the strategy . You can watch in the video the model generated:

< embed src="https://www.youtube.com/v/dKpx4FCn2XQ?hl=en&hd=1" type="application/x-shockwave-flash" width="448" height="252">


The results are: Initial ROC of the past tutorial

 


 The trading % win in the past strategy:

 

 Evolving feature selection in 40 generation, the final ROC performance is improved.  


The ROC funtion improved is the following:
 

 The % win trades is also improved

 

It is possible to select other kind of optimization algorithm and to maximize or minimize other value like drawdown or other type of ratios like Kelly or sharpen ratio. In the next tutorial, I will improve the trading operation in order to make as real as possible and to incorporate as XML configuration files the symbols.

DOWNLOAD FILES  2$ < TO IMPROVE THE BLOG



To leave a comment for the author, please follow the link and comment on their blog: a Physicist in Wall Street.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.