|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mov.analyser.ga.GeneticAlgorithm
public class GeneticAlgorithm
The Genetic Algorithm creates and breeds random paper trading individuals. This class runs the GA.
Constructor Summary | |
---|---|
GeneticAlgorithm(EODQuoteBundle quoteBundle,
OrderCache orderCache,
Expression buyRule,
Expression sellRule,
TradingDate startDate,
TradingDate endDate,
Money initialCapital,
Money stockValue,
int numberStocks,
Money tradeCost,
int breedingPopulationSize,
java.lang.String tradeValueBuy,
java.lang.String tradeValueSell,
GAIndividual lowest,
GAIndividual highest,
Variables variables)
Get ready to run the GA. |
Method Summary | |
---|---|
GAIndividual |
getBreedingIndividual(int index)
Get one of the current generation's breeding individual. |
int |
getBreedingPopulationSize()
Get the size of the current breeding population. |
Expression |
getBuyRule()
Get the buy rule. |
int |
getNextBreedingPopulationSize()
Get the size of the next generation's breeding population. |
Expression |
getSellRule()
Get the sell rule. |
int |
nextGeneration()
Enter the next generation. |
void |
nextIndividual()
Run one iteration of the GA. |
Portfolio |
paperTrade(EODQuoteBundle quoteBundle,
OrderCache orderCache,
TradingDate startDate,
TradingDate endDate,
Expression buyRule,
Expression sellRule,
Money initialCapital,
Money stockValue,
int numberStocks,
Money tradeCost,
Variables variables,
java.lang.String tradeValueBuy,
java.lang.String tradeValueSell)
Paper trade with the individual's buy and sell rules. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GeneticAlgorithm(EODQuoteBundle quoteBundle, OrderCache orderCache, Expression buyRule, Expression sellRule, TradingDate startDate, TradingDate endDate, Money initialCapital, Money stockValue, int numberStocks, Money tradeCost, int breedingPopulationSize, java.lang.String tradeValueBuy, java.lang.String tradeValueSell, GAIndividual lowest, GAIndividual highest, Variables variables)
quoteBundle
- the historical quote dataorderCache
- cache of ordered symbolsstartDate
- start date of tradingendDate
- last date of tradinginitialCapital
- initial capital in the portfoliostockValue
- the rough value of each stock holdingnumberStocks
- number of stocks in the portfoliotradeCost
- the cost of a tradebreedingPopulationSize
- number of individuals that can breedtradeValueBuy
- value for buying a stocktradeValueSell
- value for selling a stocklowest
- lowest GA individual to know the lowest bound for generating new individualshighest
- highest GA individual to know the highest bound for generating new individualsvariables
- variables containing the parameters of GAMethod Detail |
---|
public void nextIndividual()
public int nextGeneration()
public GAIndividual getBreedingIndividual(int index)
index
- of the breeding individual
public int getBreedingPopulationSize()
public int getNextBreedingPopulationSize()
public Expression getBuyRule()
public Expression getSellRule()
public Portfolio paperTrade(EODQuoteBundle quoteBundle, OrderCache orderCache, TradingDate startDate, TradingDate endDate, Expression buyRule, Expression sellRule, Money initialCapital, Money stockValue, int numberStocks, Money tradeCost, Variables variables, java.lang.String tradeValueBuy, java.lang.String tradeValueSell) throws EvaluationException
stockValue
to null
to trade by number of stocks in the portfolio.
quoteBundle
- the historical quote dataorderCache
- cache of ordered symbolsstartDate
- start date of tradingendDate
- last date of tradingbuyRule
- expression got from buy rule defined by usersellRule
- expression got from sell rule defined by userinitialCapital
- initial capital in the portfoliostockValue
- the rough value of each stock holdingnumberStocks
- number of stocks in the portfoliotradeCost
- the cost of a tradevariables
- variables used by GAtradeValueBuy
- the buy value of a stocktradeValueSell
- the sell value of a stock
EvaluationException
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |