3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machines

Krzysiaczek99

Active member
Jan 3, 2009
430
1
28
#1
The purpouse of this thread would be to verify if the deep belief nets trained for Restricted Boltzmann Machines can predict or classify FOREX strategies results. The comparative analysis with results obtained using Support Vector Machines with different kernels can be also done.

Deep belief nets seems to be quite new thing based on analysis of human brain way to work. Links to video tutorials are below

http://videolectures.net/icml09_bengio_lecun_tldar/
http://videolectures.net/mlss09uk_hinton_dbn/
http://videolectures.net/jul09_hinton_deeplearn/

The most research seems to be done by Mr. Hinton from Uni of Toronto and Mr Yann and Mr. Taylor from Uni of NY see links

http://www.cs.toronto.edu/~hinton/
http://www.cs.toronto.edu/~hinton/MatlabForSciencePaper.html

http://www.cs.nyu.edu/~gwtaylor/
http://www.cs.nyu.edu/~yann/

To achieve our goals we can use already existing FOREX system TradeFX which is using MATLAB + MT4 and using Support Vector Machines for classification

http://www.columbia.edu/~xv2103/finance/TradeFX/index.htm
http://www.columbia.edu/~xv2103/finance/TradeFX/Report.htm


For people interested in SVM theory here is very good video course

http://videolectures.net/epsrcws08_campbell_isvm/

So our tasks would be:


1) double check if all scripts of TradeFX are correct (already bugs found in three of them) and eventually expand this design by adding e.g. Buy Orders

2) Adapt the MATLAB code of Hintons autoencoder to be usable with TradeFX

3) Adapt the MATLAB code related to Phd Thesis of Taylor to be usable with TradeFX

4) Try to change standard MATLAB SVM kernel to different one (e.g. Wavelet)

Than back test and OOS test for systems from 2,3,4 can be done and results compared.

All code is dowloadable from links above

Questions are welcome

Krzysztof
 
Last edited:

Pat494

Well-known member
Mar 27, 2004
13,036
1,221
223
#4
From someone who has tried the usual neural nets and found they didn't seem very good, I would be interested to know if these new nets give better results ?
 

Dommo

Active member
Jan 13, 2009
364
37
38
#5
From someone who has tried the usual neural nets and found they didn't seem very good, I would be interested to know if these new nets give better results ?
Indeed...that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles
...etc (thanks, Bard)

This a very thought provoking (yes, computer, pun intended), and somewhat intimidating exercise. A little too late to do anything today, so

To sleep: perchance to dream

and then, maybe tomorrow, we will think on

The undiscover'd country from whose bourn
No traveller returns, puzzles...


Dude, this poetry is a rush, you can read anything you like into it
 

Dommo

Active member
Jan 13, 2009
364
37
38
#6
In all seriousness, thanks to Krzysiaczek for this very thought provoking post. I dread to think what you are like at chess.
 

Prawnsandwich

Active member
Nov 22, 2008
339
30
38
#7
Listened to the first few minutes of one of these out of curiosity..and I have to say it sounds like a pile of sh1t..... deliberately vague and pseudo -complicated ..maybe it gets better further on in...anyone else have more patience ?
 

Dommo

Active member
Jan 13, 2009
364
37
38
#8
Listened to the first few minutes of one of these out of curiosity..and I have to say it sounds like a pile of sh1t..... deliberately vague and pseudo -complicated ..maybe it gets better further on in...anyone else have more patience ?
Oddly, that is a very precise description of my response to technical analysis.
 

Pat494

Well-known member
Mar 27, 2004
13,036
1,221
223
#12
Or to take arms against a sea of bubbles
...etc (thanks, Bard)


err thx
haven't a clue what he's on about
 
Aug 18, 2008
47
2
18
#13
You should not waist your time on this kind on nets. I have implemented several kinds and realized that the reasons they work so well at classifying stuffs are the very reasons they don’t work when applied to markets:

They are very sensitive to the number and the size of layers which make them impractical in market environments.

For the training stage to converge properly they need many thousands input occurrences:
- Even in optimized C++ training takes several hours,
- Even with feature extraction, it is hard or even impossible to find such high number of input occurrences from market data.

These networks have several hundred million neurons the majority on them placed on the first layer. The reason Deep networks work so well in classification is that they encode each possible solution to the problem in the first layer. It is then just a matter to pick the most appropriate one from higher level representations just as it happens in the brain. Deep networks fit the problem at hand very well though raising the question of generalization. Neural nets do not adapt but I was expecting them to pick recurrent market states so that I could trade the deviation. Well, it was quite a disappointment for me to realize that they don’t. It was argued that deep networks infer new solutions after learning but I did not see it.

My conclusion after 3 years investigating deep architectures. They are not appropriate to trading at the moment. To address the generalization issue we need incremental versions with online learning. I am currently looking into dynamic factored structures which use similar RBM building blocks. I believe they are more promising but still in a very early stage of development.

My advice: carry out due diligence before spending time on this.

My 2 pips.
 

fralo

Active member
Jan 12, 2007
104
0
26
#14
Krzystof has noticed several bugs in the TradeFX programs instantpip.m, instantpipexit.m, and explosivepip.m. These all involve future leaks in which a future price is used to make a current calculation. I assume that he will eventually propose fixes for these bugs.. in fact he has below.

I am concerned with future leaks caused by the use of open prices as entry and exit prices when the conditions causing entry and exit depend on closing prices. This is a massive future leak, and means that all of the TradeFX conclusions about the performance of the strategies must be re-tested. This can be fixed by using closing prices instead of open prices for entry and exit.

This post is intended to warn members that the code in TradeFX should be examined very carefully before it is used.(n)

As these bugs are removed we can begin testing the hypotheses in the TradeFX papers.

Welcome to you thread-poets. Hope that you contribute comments or code as well as poetry. :)
 
Last edited:

Krzysiaczek99

Active member
Jan 3, 2009
430
1
28
#15
TradeFX bugs

Here are three bugs what i found in TradeFX scripts

1) Future leak from InstandtPip line 64

Code:
64        cond(2) = high(t+1) < high(t) && low(t+1) > low(t);
index t+1 is used what is not allowed


2) code in instantPipExit lines 50-71

Here index t+2 is used. So limit and stop vars are based on this index


Code:
stop = price(t+2);
    if high(t) > stop
        stop = high(t);
    end
    limit = price(t+2) - LIMIT;
   
    cond = zeros(1,3);
    exitTime = 0;
    status = -1;
    for i = t+1:length <------ !!!!! but here it start from t+1
        cond(1) = pSAR(i) < close(i); % parabolic SAR below
        cond(2) = within(lwBol(i),price(i));
        cond(3) = (price(i) > stop) || (price(i) < limit);
        if sum(cond) >= 1
            exitTime = i;
            break;
        end
    end
so you can not compare data t+1 with data t+2 (stop and limit) because t+2 is in the future and you don't know it !!!!! it is future leak

in this code cond(3) = (price(i) > stop) || (price(i) < limit); loop is running over all prices but stop/limit don't adjust to new prices because of fixed t at this moment


3) Future leak from explosivePip line 72.

Code:
72   cond(3) = open(t+1) < close(t); % price breaks
index t+1 is used what is not allowed

Comments are welcome. Maybe somebody will find another bug so please post it

Krzysztof