Need C# Genetic Code

trading strategy optimization using genetic algorithms

Moderator: moderators

nickka
rank: <50 posts
rank: <50 posts
Posts: 4
Joined: Mon Oct 25, 2010 7:56 pm
Reputation: 0
Gender: Male

Need C# Genetic Code

Postby nickka » Thu Oct 28, 2010 2:35 pm

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?

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
eudamonia
rank: 500+ posts
rank: 500+ posts
Posts: 536
Joined: Thu Jun 15, 2006 9:50 pm
Reputation: 0
Location: Rocklin, CA
Real name: Edward Heming
Gender: Male
Contact:

Postby eudamonia » Thu Oct 28, 2010 3:43 pm

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.
Eudaimonia (pron.: you-die-moan-e-a) (Greek: εὐδαιμονία) is a classical Greek word commonly translated as 'happiness'. The less subjective "human flourishing" is often preferred as a translation.

nickka
rank: <50 posts
rank: <50 posts
Posts: 4
Joined: Mon Oct 25, 2010 7:56 pm
Reputation: 0
Gender: Male

Postby nickka » Thu Oct 28, 2010 4:07 pm

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?

User avatar
eudamonia
rank: 500+ posts
rank: 500+ posts
Posts: 536
Joined: Thu Jun 15, 2006 9:50 pm
Reputation: 0
Location: Rocklin, CA
Real name: Edward Heming
Gender: Male
Contact:

Postby eudamonia » Fri Oct 29, 2010 9:37 pm

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.
Eudaimonia (pron.: you-die-moan-e-a) (Greek: εὐδαιμονία) is a classical Greek word commonly translated as 'happiness'. The less subjective "human flourishing" is often preferred as a translation.

nickka
rank: <50 posts
rank: <50 posts
Posts: 4
Joined: Mon Oct 25, 2010 7:56 pm
Reputation: 0
Gender: Male

Postby nickka » Sat Oct 30, 2010 10:10 pm

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.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “genetic optimization”