Using Neural Networks in Trading.

 

Dear traders! Recently the passions around the use of neural networks in

forecasting in the financial markets. I think that the audience is divided into those who have tried it, but when faced with

Questions and got disappointed (it's easier to use hands) or retired temporarily, and those who have some (and maybe very good) results.

results and are quietly working and improving their system... However, new sufferers emerge with

eager to succeed and questions. Much has already been discussed, but maybe experienced neuro-traders have

new thoughts?

I am interested in non-growths recently and have accumulated some questions. I would like to hear the opinions of people who are good at it.

I understand that when using neural networks in trading many details are important... In order.

1. What is the task to set for NS? I think that the problem of classification (i.e. division of market moments into classes

"Buy", "Sell", "Stay out of the market") is the most promising in terms of getting good results in trading.

2. How to formulate this task? I see two ways.

а. The first is to teach the network to independently determine the most favourable

Enter the market when it is most probable that you will have a profit trade.

In this case the network will constantly analyze the market (for example, at opening of each new bar) and determine

What, then, should be the training sample? Obviously it should contain

Input values (price or indicator values) from each bar of the sample

the desired output value. HOW? This is a question of questions! So in the Neural Networks 4 program from STATISTICA it is desirable

that each bar should be assigned a fixed value indicating which class it belongs to...

to a certain class... like 1, 0 or -1... or even with text "sell" "out of market" "buy"

On the other hand, I've read that output values of a training sample should not be discrete

and should be distributed in a range from (for example) -1, which means 100% sell! to 1, which means 100% buy, and 0 would then be

"don't know" or "out of the market". That is, each bar should have a set of inputs and an output value of (for example) 0.8745

which would mean that there is 87 out of 100 chances to buy.

And of course, how to find such output values? Do I use a Zig-Zag? And between the peaks of the Zig-Zag

calculate its "chances"?

б. The second way is to filter signals of some system... a good system by itself that generates

and neuronics only "allows" or not to trade on them.

or may I ask whether we should use all the bars we have received the signal for trading?

And again, should the output (disaer) be discrete or with interim values?

3. Input values. They suggest not to take indicator values as such. I think this is a misconception.

Indicators "look" into the history, each at its own depth and angle, and based on this they give the

If we take a set of indicator values, the incoming vector reminds a certain "bar code" of the market

and the NS will recognize and summarize market situations using these bar codes. It is proposed to take as a variant the difference

of indicator values (to provide the network with information about the direction of price movement). What other variants are there?

WHAT IS THE RIGHT WAY? I tried to take Phi angle of a complex number (Phi angle is a geometric

interpretation of a complex number) by Cloth, but in my experiments with NeuroSolution compared to a set of

of indicator values came out much worse. What does the expert community have to say? ;-)

4. Normalization of input values. The meaning of the procedure is clear. What is not clear is how to properly implement it. Let me explain. Normalization -

is bringing values into a single range. To do this we must find the maximum value in the sample and the minimum value.

That's fine. To what depth shall we search? Let's say we have 100 indicator values in the sample. We need to normalize

75th value. Where shall we look for the minimum and maximum? At 74 previous? Or at 50 previous? Or at all 100 (i.e.

There is a need for certainty... because in the classification each bar should be calculated independently and according to

or else it's all nonsense... I think it should be based only on values from the past and take

I think it is necessary to give only past values and to take a strictly defined unit depth (for example always 100 bars ago or 500 or the value of a training sample).

5. Random resampling of the incoming sample. B or ort tu b! Opinions differ... The theory states that the case for

of classification is useful. But how is it in reality? Who has tried it? Any opinions?

6. And finally a final question about network training. Does anyone use C.V. (cross validation) sampling?

Is it necessary? Does it really help prevent network overtraining? And in general, how do you deal with this

sneaky overtraining? It spoils everything! As on training samples everything is beautiful! And on Out of

Sample - nonsense.

Personally I use NeuroSolution 5 DE to study the usefulness of NS in trading. It's a good flexible program.

It allows to generate results as DLL.

Quite smart. (but it is not clear how after training and optimization to find which values from the input selection are useful and which values are excluded.

The only thing I want to find out is which values are useful and which are excluded by the program as harmful or unnecessary.

Please do not pass by. Critique! Suggestions! Share your thoughts!

 
Of course it's a lot of gibberish, but at least look at the links below your post, it's not a new topic after all.
 
читайте================================>хайкина=========================> :О)
 
PraVedNiK >> :
читайте================================>хайкина=========================> :О)

Already found it! Will definitely read it.

 
sayfuji >> :
Of course it's a lot of words, but at least look at the links below your post, it's not a new topic after all.

I don't have a problem with a lot of words. It's all there... it's all there... you think it's over, don't you?

 

полагаете что тема исчерпана полность?

No way. On the contrary, digging and digging, a bigger shovel and a bag of time.


 
alexish писал(а) >>

4. Normalise the input values. The meaning of the procedure is clear. What is not clear is how to implement it correctly. Let me explain. Normalization -

is bringing values into a single range. To do this we need to find the maximum value in the sample and the minimum value.

That's fine. To what depth shall we search? Let's say we have 100 indicator values in the sample. We need to normalize

75th value. Where shall we look for the minimum and maximum? At 74 previous? Or at 50 previous? Or at all 100 (i.e.

There is a need for certainty... because in the classification each bar has to be calculated independently and according to

or else it's all nonsense... I think it should be based only on values from the past and take

I think we should use only past values and take the same depth (for example always 100 bars ago or 500 or the same value as a training sample). - Look for a universal method and read articles on special sites on neural networks.

5. Random re-sorting of the incoming sample. - not an essential point

6. And finally the last question about network training. Does anyone use C.V. (cross validation) sampling?

Is it really necessary? Does it really help to prevent network overtraining? And in general, how do you deal with this

sneaky overtraining? It spoils everything! As on training samples everything is beautiful! And on Out of

Sample - nonsense... - In any case, the test sample decides everything.

Nonsense on OOS: 1. Not a representative sample 2. Not stationary data 3. Incorrect preprocessing, possibly some other things...

Personally I use NeuroSolution 5 DE to study the usefulness of NS in trading. It's a good and flexible program.

It's possible to generate results as a DLL at .

Quite smart. (but it is not clear how after training and optimization to find which values from the input selection are useful and which values are excluded.

The only thing I want to find out is which values are useful and which are excluded by the program as harmful or unnecessary.)

Please do not pass by. Critique! Suggestions! Share your ideas!

In a good way I'll have to write everything myself, at least to understand better what happens and why...

 
alexish писал(а) >>

1. What is the task of the NS? I think that the task of classification (i.e. dividing moments in the market into classes

"buy", "sell", "stay out of the market") is the most promising in terms of getting good trading results.

Yes, it is. And, the state "out of the market" as a rule is connected with spread widening, all the rest NS traces and should exploit to its advantage. That is why the classification only on the basis of "buy" or "sell" is crucial for NS, and in the TS itself we set "allowance-ban" for trade depending on the current value of brokerage companies commission.

2. How to formulate this task? I see two ways.

а. The first one is to teach the network to determine the most profitable moments of the market.

б. The second way - in theory, the training sample should be drawn only on the bars where there is a signal from the system to trade... or on all the bars anyway?

And again... the output sample (disaer) should be discrete or with intermediate values?

Right - to maximally facilitate the task to be solved by the NS, for this purpose we should determine the optimal TS (for specific conditions) independently and feed it with already dissected time series as input data, i.e. not each bar, but probable key points, and only after that we can expect the NS to make an adequate entry-exit decision. And it will decide if the critical point that you've suggested is such or not.

As for the answer to the question about discreteness of NS output values, it's not obvious and depends first of all on the law of distribution of amplitudes of increments of quotient "sliced" by input signal of the NS. If the distribution is close to symmetric, then we can limit ourselves to a discrete output +/-1 (buy/sell), but if the distribution is not symmetric, then we must consider its amplitude (probability) in addition to the sign.

3. Input values.

Answered above.

4. Normalization of input values.

Normalisation is necessary for the NS to work correctly.

The correct way to carry out this procedure is to achieve mapping of the entire range of received values at the input/inputs of the NS in the region of +/-1 with uniform (hollow) distribution. This can be done by acting on the input vector with a hyperbolic tangent and then smoothing out the distribution by some means (optional).

5. Random resorting of the incoming sample. Bi or ort tu bi! Opinions differ.

The procedure is useless!

The point is that using the Reverse Error Propagation method, we sum up the errors over the whole training sample and it makes no difference to us in which order we sum up the individual outliers - rearranging the places of the syllables does not change the sum.

6. And how do you deal with this sneaky overtraining anyway?

There is an unambiguous relation between the minimum length of training sample P, the number of weights W in the NS and dimension of input d: P>4*(W^2)/d

If this condition is met, obviously overtraining will never occur. Learning process must be stopped when the parameter characterizing the learning error reaches the asymptotic.

Personally I use NeuroSolution 5 DE to study the usefulness of NS in trading. It's a good and flexible program.

Quite tricky.

Too bad!

You should write the code of the NS directly in MQL. This is the only way to avoid the sea of pitfalls and save time and effort.

 
Neutron >> :


1.

The right thing is to make it as easy as possible for the NS to solve the problem, for this you need to determine the optimal TS (for specific conditions) by yourself and send as input data already dissected time series, i.e. not every bar, but likely key points, and only after that you can expect the NS to make an adequate entry-exit decision from the market. It will decide whether the critical point that you suggest is such or not.


2.

Bad!

You should write the NS code directly in MQL. This is the only way to avoid the sea of pitfalls and save time and effort.


1. by making it easy, do not lose data. The most important thing is not to feed the network with essentially the same data. Better think outside the box what can influence the price and how to present it as data for the neural network.


2. Do NOT write the NS code for MQL. You will spend a lot of time and nerves and everything will work very slowly. Better learn how to connect your dll with MT4 and write your own neural network in C for example with the FANN package. This will help to avoid many problems including porting the code to the new MQL5 terminal.

 
Neutron писал(а) >>

The correct way to do this is to get the whole range of input/input values of the NS to appear in the +/-1 area with a uniform (hollow) distribution. This can be done by acting on the input vector with a hyperbolic tangent and then smoothing out the distribution (optional) in one way or another.

There is an unambiguous relation between the minimum training sample length P, the number of weights W adjustable in the NS and dimension of the input d: P>4*(W^2)/d

If this condition is met, obviously overtraining will never occur. The learning process must be stopped when the parameter characterizing the learning error reaches the asymptotic.

Bad!

It's necessary to write the NS code for MQL at once. This is the only way to avoid the sea of pitfalls and save time and effort.

A sigmoidal function by itself does not equalize the distribution... In my opinion, it's more important to solve the problem of stationarity of data in preprocessing.

By the way, the formula you cited, I get W=420, d=14, so P>50400 - doesn't it seem to you that the sample is a bit too large?

In my experience the number of examples in sample doesn't depend on what you suggest...

 
alexish писал(а) >> I personally use NeuroSolution 5 DE to study the usefulness of NS in trading.

Generally speaking, before applying such specific and quite complex programs, it is advisable to consult the developers of this software on the appropriateness of its use in this area, namely in the financial markets. So, if you do consult them, they will tell you that NeuroSolution is not intended for the use in financial markets, and recommend another program. NeuroSolution is designed to solve general problems, while the use of neural networks in financial markets has some specific features that are not taken into account in this software. Maybe NeuroSolution can be somehow attached to financial markets, but it is quite complicated and is under the power of big specialists in the field of neural networks + traders in one person, who clearly understand what result and most importantly how to get it from neural networks. Hence you have all the problems you listed above - problem setting, data normalization, overtraining and so on.....

Reason: