Skip to content

vhcandido/forex-genetic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Forex Genetic Algorithm

Genetic Algorithm for optimization of trading rules

This is a simple Genetic Algorithm developed to optimize parameters of trading rules based on Technical Analysis.

It's built using the R package Systematic Investor Tookit available here: SIT. Many thanks to Michael Kapler.

###Dependencies To run this program you should have some R packages installed:

  • zoo
  • xts
  • TTR
  • quantmod

Also some Python 2.7 libraries

  • pandas
  • matplotlib

###Running First, run the R server passing the currency pairs as parameters (the associated data file must be located in the data directory, see more details in strategy.r:read_data):

Rscript server.r 'GBPUSD'

Then, run the Python GA client:

python client.py

There will be an image with the evolution of the fitness function (Sharpe ratio, currently).

Using the generated rule string (separated by commas) run the strategy test to see the metrics computed over it.

Rscript test_strategy '<strategy_string>'

Note to myself: I need to learn how to use markdown tags.

About

Genetic Algorithm for optimization of trading rules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published