Page 1 of 1

Need C# Genetic Code

Posted: Thu Oct 28, 2010 2:35 pm
by nickka
I have been researching genetic optimization and am looking for C# code that can best describe how all this works in relationship to stock market historical data.

The problem I have run into while downloading and reviewing the code I have found out there on the internet is this:

Either the code ties into another application (NinjaTrader, etc).
or
The code is huge and gives no idea how it would work with stock market historical data.

What I am looking for is stand-alone C# code that describes genetic optimization and how stock market historical data is used as an input and does not work with or tie into another existing trading application.

Can someone provide me with code or a link to such code?

Posted: Thu Oct 28, 2010 3:43 pm
by eudamonia
Its been a couple years since I was looking into this. I found pretty much what you discovered.

Most of the C# code out there for GAs was non-trading specific and you needed to know how to modify it to be appropriate for trading analysis.

Or it was already built into another trading platform/software system.

Good luck.

Posted: Thu Oct 28, 2010 4:07 pm
by nickka
Maybe I can start with the basics and move on from there.

Let's say I have historical data of: ticker, trade date, open price, high price, close price, and volume. What data would I use as an input to a genetic algorithm and what would I get back? Would this be useful for a buy/sell trigger?

Posted: Fri Oct 29, 2010 9:37 pm
by eudamonia
You may want to research how GAs work and optimization in general.

The Evaluation and Optimization of Trading Strategies by Robert Pardo is an excellent reference work that should introduce you to the basics.

At the most basic level with any optimization method you will have variables (which could be the ones you mentioned above), and you will have a fitness function. The purpose of the optimization (whether it be brute force, GA, or something else) is to find the best combination of variables to maximize your fitness function.

Optimization is only as good as the data you put in, the combination of variables you choose, and the fitness function you decide to optimize for.

Posted: Sat Oct 30, 2010 10:10 pm
by nickka
I have bought books on trading and don't care to buy another $50 book. What I am after, at this point, is for someone to describe exactly what historical data I would plug into GA and exactly what I could expect to get back once the optimization is ran.