|
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.PaperTrade org.mov.analyser.ANNPaperTrade
public class ANNPaperTrade
This class perform the paper trade analysis for the artificial neural network.
A specific class has been developed, extended from PaperTrade PaperTrade
,
because ANNs have a complete different behaviour compared to other analysis based
on Gondola language.
ANNs need to be trained, and the training session needs to know how the things would
be happened, if different choices have been taken day by day.
For further information about the techniques used, you should find out the Cross Target
technique (@author Prof. Pietro Terna).
That is the technique used here to get the buy/sell signals.
See http://web.econ.unito.it/terna/ct-era/ct-era.html.
The final portfolio will contain a single cash and a single share account. Cross Target method to get buy and sell signal through an ANN. The cross target method works in the following way: we make some guesses about buy and sell signals (actions) and about capital (effect of actions), the guesses are done by artificial neural network (ANN); then we train the ANN comparing what the ANN has guessed with the following values: the buy and sell signals are compared with the buy and sell signals which would be to get a capital equal to the capital guessed plus the percental increment wished; the capital signal is compared with the capital got trading with the guessed buy and sell signals. For the sake of simplicity in Merchant of Venice we've used a simplified version of CT technique. We do not use the capital as output of ANN, but we use only two outputs (the buy and sell signals). We pilot the buy and sell signals according to what happens in the future: we calculate if we gain enough in one of the next days (one from the next day trading until the window forecast day trading). We gain enough if and only if the earning percentage is higher than the user defined one, in one of the window forecast days. The core of the CT method has done in the setANNTrainingParameters method in this class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.mov.analyser.PaperTrade |
---|
PaperTrade.Environment |
Field Summary |
---|
Fields inherited from class org.mov.analyser.PaperTrade |
---|
buyRule, buyValue, CASH_ACCOUNT_NAME, sellRule, sellValue, SHARE_ACCOUNT_NAME, STOCKS_PER_LINES, symbolStock |
Method Summary | |
---|---|
static Portfolio |
paperTrade(java.lang.String portfolioName,
EODQuoteBundle quoteBundle,
Variables variables,
OrderCache orderCache,
TradingDate startDate,
TradingDate endDate,
Money capital,
int numberStocks,
Money tradeCost,
java.lang.String tradeValueBuy,
java.lang.String tradeValueSell,
ProgressDialog progress,
Expression[] inputExpressions,
ArtificialNeuralNetwork artificialNeuralNetwork)
Perform paper trading using a fix number of stocks. |
static Portfolio |
paperTrade(java.lang.String portfolioName,
EODQuoteBundle quoteBundle,
Variables variables,
OrderCache orderCache,
TradingDate startDate,
TradingDate endDate,
Money capital,
Money stockValue,
Money tradeCost,
java.lang.String tradeValueBuy,
java.lang.String tradeValueSell,
ProgressDialog progress,
Expression[] inputExpressions,
ArtificialNeuralNetwork artificialNeuralNetwork)
Perform paper trading using a fixed stock value. |
static void |
paperTraining(java.lang.String portfolioName,
EODQuoteBundle quoteBundle,
Variables variables,
OrderCache orderCache,
TradingDate startDate,
TradingDate endDate,
Money capital,
int numberStocks,
Money tradeCost,
java.lang.String tradeValueBuy,
java.lang.String tradeValueSell,
ProgressDialog progress,
ANNTrainingPage ANNTrainingPage,
Expression[] inputExpressions,
ArtificialNeuralNetwork artificialNeuralNetwork)
Perform training using a fix number of stocks. |
static void |
paperTraining(java.lang.String portfolioName,
EODQuoteBundle quoteBundle,
Variables variables,
OrderCache orderCache,
TradingDate startDate,
TradingDate endDate,
Money capital,
Money stockValue,
Money tradeCost,
java.lang.String tradeValueBuy,
java.lang.String tradeValueSell,
ProgressDialog progress,
ANNTrainingPage ANNTrainingPage,
Expression[] inputExpressions,
ArtificialNeuralNetwork artificialNeuralNetwork)
Perform training using a fixed stock value. |
Methods inherited from class org.mov.analyser.PaperTrade |
---|
buy, getCapital, getHoldingTime, getStockCapital, getTip, paperTrade, paperTrade, sell |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Portfolio paperTrade(java.lang.String portfolioName, EODQuoteBundle quoteBundle, Variables variables, OrderCache orderCache, TradingDate startDate, TradingDate endDate, Money capital, Money stockValue, Money tradeCost, java.lang.String tradeValueBuy, java.lang.String tradeValueSell, ProgressDialog progress, Expression[] inputExpressions, ArtificialNeuralNetwork artificialNeuralNetwork) throws EvaluationException
portfolioName
- name to call portfolioquoteBundle
- historical quote datavariables
- any Gondola variables setorderCache
- cache of ordered symbolsstartDate
- start date of tradingendDate
- last date of tradingcapital
- initial capital in the portfoliostockValue
- the rough value of each stock holdingtradeCost
- the cost of a tradetradeValueBuy
- the value at which we want to buytradeValueSell
- the value at which we want to sellprogress
- the progress bar shown while ANN is runninginputExpressions
- the input expressions of ANNartificialNeuralNetwork
- the ANN object
EvaluationException
public static void paperTraining(java.lang.String portfolioName, EODQuoteBundle quoteBundle, Variables variables, OrderCache orderCache, TradingDate startDate, TradingDate endDate, Money capital, Money stockValue, Money tradeCost, java.lang.String tradeValueBuy, java.lang.String tradeValueSell, ProgressDialog progress, ANNTrainingPage ANNTrainingPage, Expression[] inputExpressions, ArtificialNeuralNetwork artificialNeuralNetwork) throws EvaluationException
portfolioName
- name to call portfolioquoteBundle
- historical quote datavariables
- any Gondola variables setorderCache
- cache of ordered symbolsstartDate
- start date of tradingendDate
- last date of tradingcapital
- initial capital in the portfoliostockValue
- the rough value of each stock holdingtradeCost
- the cost of a tradetradeValueBuy
- the value at which we want to buytradeValueSell
- the value at which we want to sellprogress
- the progress bar shown while ANN is runningANNTrainingPage
- the pointer to the training pageinputExpressions
- the input expressions of ANNartificialNeuralNetwork
- the ANN object
EvaluationException
public static void paperTraining(java.lang.String portfolioName, EODQuoteBundle quoteBundle, Variables variables, OrderCache orderCache, TradingDate startDate, TradingDate endDate, Money capital, int numberStocks, Money tradeCost, java.lang.String tradeValueBuy, java.lang.String tradeValueSell, ProgressDialog progress, ANNTrainingPage ANNTrainingPage, Expression[] inputExpressions, ArtificialNeuralNetwork artificialNeuralNetwork) throws EvaluationException
portfolioName
- name to call portfolioquoteBundle
- historical quote datavariables
- any Gondola variables setorderCache
- cache of ordered symbolsstartDate
- start date of tradingendDate
- last date of tradingcapital
- initial capital in the portfolionumberStocks
- try to keep this number of stocks in the portfoliotradeCost
- the cost of a tradetradeValueBuy
- the value at which we want to buytradeValueSell
- the value at which we want to sellprogress
- the progress bar shown while ANN is runningANNTrainingPage
- the pointer to the training pageinputExpressions
- the input expressions of ANNartificialNeuralNetwork
- the ANN object
EvaluationException
public static Portfolio paperTrade(java.lang.String portfolioName, EODQuoteBundle quoteBundle, Variables variables, OrderCache orderCache, TradingDate startDate, TradingDate endDate, Money capital, int numberStocks, Money tradeCost, java.lang.String tradeValueBuy, java.lang.String tradeValueSell, ProgressDialog progress, Expression[] inputExpressions, ArtificialNeuralNetwork artificialNeuralNetwork) throws EvaluationException
portfolioName
- name to call portfolioquoteBundle
- historical quote datavariables
- any Gondola variables setorderCache
- cache of ordered symbolsstartDate
- start date of tradingendDate
- last date of tradingcapital
- initial capital in the portfolionumberStocks
- try to keep this number of stocks in the portfoliotradeCost
- the cost of a tradetradeValueBuy
- the value at which we want to buytradeValueSell
- the value at which we want to sellprogress
- the progress bar shown while ANN is runninginputExpressions
- the input expressions of ANNartificialNeuralNetwork
- the ANN object
EvaluationException
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |