Venice is able to use Artificial Neural Network (ANN) for technical analysis. Venice can be used standalone, but the best performance is achieved using it together with Joone, you can download Joone from http://www.jooneworld.com/. You can use the ANN in two ways. You can use the default ANN, that is to say you use Venice standalone: a default ANN will be created with a Linear Layer as input, and a Sigmoid Layer as hidden and another Sigmoid Layer as output. You can use a custom ANN, that is to say you use Venice together with Joone; the custom ANN can be imported from the file system. All accepted files are .snet and .xml formats, which can be obtained by exporting any ANN from Joone. When you export an ANN from Joone, make sure the ANN has the right number of input and output neurons. The number of input neurons must be equal to the input expressions defined in ANN I/O Params section, the number of output neurons must be equal to two (buy and sell signals). If you import an ANN which have a different number of input/output neurons, before running or training it, the system will ask you to resize automatically the input/output neurons to the correct number. The ANN is not saved in the preferences. So when you open the ANN window, you have no ANN in memory. The only choice available is to build a new one using the default model or to load an existing one from the file system. When you close the ANN window, be sure to save the ANN, because the ANN is not automatically saved in the preferences. If the ANN has not been saved, the system will ask you to save it.
Another interesting point is how we can get the output buy and sell signals from the ANN. The theory (Cross Target technique, by Prof. Pietro Terna) that resolves this problem can be seen Alat the following internet site: http://web.econ.unito.it/terna/ct-era/ct-era.html You must think about the above technique in the following way: the actions are buy and sell signals; the effect of the actions is the capital. For the sake of simplicity we have not put the capital as output of the ANN, so the ANN has only two outputs: buy and sell signals; one buy and one sell used for all stocks, as usual in Venice. We train the buy and sell signals according to cross target parameters. We train a buy signal if in one of the days from the trading day to the last window forecast day we can gain an amount equal to or higher than the earning percentage. For example if we have window forecast = 7 and earning percentage = 2.0, we look for the next 7 days trading. If in at least one of those days, gain equal to or greater than 2% is made, the ANN will be trained with a buy signal. If the gain is less than 2%, the ANN will be trained with a sell signal.
This is the same as the range page in the Paper Trade Module.
This is the same as the portfolio page in the Paper Trade Module.
This is the same as the trade value page in the Paper Trade Module.
Here you can add/modify/delete input expressions. At least one expression must be added. These expressions must be valid Gondola expressions where an integer or double value is returned; do not add equations (where a boolean value is returned).
The input expressions will be the input values for ANN during running and training. The order of input expressions
will be the same as the order of Joone input neurons.
Pay attention to what kind of input you put, because if the inputs are wrong the CT method will not work well.
For example if you want to trade with 20 stocks (instead of one), you have to take into consideration that
an input expression of this kind: ema(close, 30)
. This has the following problems:
It depends on very different values due to stock diversity, so normalization has to occur somehow;
The default network must have large positive and negative numbers, so that
tiny differences in the historical data can be easily learned by the ANN.
Therefore, a better input expression
might be the following one: 1000*((ema(close,50)-close)/close)
.
You can define also the thresholds for buy and sell signals. The threshold is the value that defines the firing of
output neurons, so for example if the ANN has a output buy signal of 0.7, and a threshold for buy signal of 0.5,
the ANN will buy, but if we have a threshold of 0.8 and the same output buy signal (0.7), the ANN won't buy.
If one wants to have more or less transactions, the threshold values can be changed. With high value thresholds
ANN will buy and sell rarely, with low value thresholds ANN will buy and sell more often.
Some example values:
Here you can define all the training and cross target parameters. The learning rate and momentum are parameters of ANN, (further details are availble in the Joone documentation). Both values must be between 0.0 and 1.0. The pre learning patterns are the patterns which are not considered while training. For example we train the ANN with 10 stocks for 20 days (10 patterns per day), if we want to skip 3 days of training, we set pre learning to 30 ( 3 days x 10 stocks = 30). The default pre learning is zero, so all the periods selected in the Venice GUI are taken into consideration. The 'tot cycles' are the number of training cycles. Having many training cycles slows the training session, but the ANN will have better performance once trained. The earning percentage and the window forecast are the Cross Target parameters, as described above in the Artificial Neural Network introduction.
Some example values:
Here you can load/save ANN from/to file system. You can also decide to use a default ANN or a custom one. If you decide to use a custom ANN, you will have to load it from the file system.
Almost all the parameters have default values, so we'll give you just an example of input values for the input expressions of the ANN. Another important thing is to consider the stocks, because the trend can vary a lot from one stock to another. Training one neural network for one stock only is the way to achieve the best performance. If you want to train and run the ANN with more than one stock in the stock text box, choose the bundle of stocks carefully, because the system manages only one neural network with two output signals for all the stocks in the bundle.
Example of input values of input expressions of the ANN:
(1000*(close-lag(close,-1)))/close
(1000*(lag(close,-1)-lag(close,-2)))/close
(1000*(lag(close,-2)-lag(close,-3)))/close
...
(1000*(lag(close,-(n-1))-lag(close,-n)))/close
Merchant of Venice 0.7 is based on Joone 1.2.1