How to form the input values for the NS correctly. - page 5

 
StatBars писал (а) >>
At what values does the hyperbolic tangent enter into saturation?

more than +-1...

If hypertangent is used as a compressing function, the inputs must be scaled in this range.

you can use partial arctagens, and the inputs must be scaled to +-1.57

the sigmoid is classical [0-1]

for classifying networks, scaling is not necessary...

 
sergeev писал (а) >>

2 Sart - if you are a beginner, you might be interested in the code from my post from https://forum.mql4.com/ru/12474/page9.

Alexey, thank you for your attention, but it's too early for me to look at the code. I'll study the theory for two-three-four months.

 
klot писал (а) >>

"Fat tails" are visible when we analyse quotes over 100 years and more... (exaggerated). If we look at a certain area, for example at the last 300 bars, then there are no "fat tails" there...

Do you teach your NS also using the area of 300 bars?

 

Read the articles from StatBars. They are very informative. For those who don't know, they discuss the nature of dependence of repeatability and inconsistency of a training sample on the complexity of images to be classified. In the branch "Neural network as a script" and https://forum.mql4.com/ru/8835/page2 peeple organize the outputs according to discrete-binary principle, which depending on the "teacher's" direction a vector is formed. (For example for three outputs 1-0-0 up, 0-1-0 flat, 0-0-1 down). Another variant proposed one output, but it was broken down into discrete values according to the following signs
1.0 - more than 70 pips up and less than 30 pips down within a day.
0.9 - 60 points up 25 points down
0.8 - 40 pips up 20 pips down
0.75 - flat
0.7 - 40 pips down 20 pips up
0.6 - 60 down 25 up
0.5 - 70 down 30 up

But, taking into account what was stated in the articles, probably the best interpretation of the output would be the formula
Target=(Up-Dn)/(Up+Dn), where Up is the up movement height on the "teacher" period, Dn is the down movement height. The output range in this case will be continuous and will be in the range [-1,+1], Boundary conditions +1 - strong up movement, -1 - strong down movement, 0 - flat. In such a case, if we introduce some variable Z, we can split the output into three sections as follows. -1<-Z<+Z<+1 and maximize the profit relative to variable Z.
That is, we will try to construct a relationship between the input vector and further trend relations. By this continuous output, we will obtain satisfactory non-repeatability and consistency of the training sample.

On the other hand, we would still like to know not only the relations between the trend parameters but also the relative value of the future price. For this purpose we introduce variables TP, SL. On the grid we will calculate four outputs according to the formula Up-TP, Dn-TP, Up-SL, Dn-SL, i.e. Up-TP>0, Dn-SL<0 for buying and Dn-TP>0, Up-SL<0 for selling. Profit maximization is relative to these variables TP and SL.

The third network determines the speed of achieving price maximums. If teacher period = X bars and bars to reach Up=BU, Dn=BD, then the network output must be equal to the ratio BU-BD, with (BU-BD)/X>0 when reaching the bottom before the top and <0 when reaching the top before the bottom. The profit maximisation in this case is relative to zero.


 

StatBars писал (а) >>
при каких значениях гиперболический тангенс входит в насыщение?

As you can see from the graph starting at a value of 5-6.

But I have another question. Which function calculates faster, sigmoid or hypertangent?


Files:
zvntx1.rar  6 kb
 
sergeev писал (а) >>

...

On the other hand, we would still like to know not only relations between trend parameters, but also the relative value of the future price. For this purpose we introduce variables TP, SL

...

There you go. You've ruined everything. :)

`

See the yoghurt thread + I highly doubt that even `therelative value of the future price' can be predicted !!! with a high probability, i.e. a small margin of error.

And why???? - after all, have already got the "further trend ratios" - i.e. to taste - either close when "flat" or flip when the signal changes".

`

Although, for a start - implement the first part, i.e. go back to "How to form input values correctly" (everything else - trifles) :(

 
SergNF писал (а) >>

First, though, implement the first part, i.e. go back to "How to form input values correctly" (everything else is trivial) :(

I completely agree.

I'm not going off topic. Just a thought out loud. The ratio =0.25 may be both 40/100 and 10/40, but we'll take profit in the first case, and not in the second one. Generally, is it possible as an option to build a network on the principle of cascades (I don't know how to call it properly): that is, several networks, but the input of the next one is the output of the previous one. Some wild mixture of committees and convolution maps turns out :)). Although, we will know the intermediate outputs (as if there is a chitel).

Here is the scheme

For example the outputs are those described in my previous post. First we determine direction, then its strength, then speed.

Will the network be able to function properly at all? Or is it better not to make a mess and go for simple steps?

 
sergeev писал (а) >> But I have another question. Which function is faster to calculate - sigmoid or hypertangent?

These functions are easily expressed through each other - linearly. So there is not much difference. Formula:

tanh(x) = 2*sigmoid(2*x) - 1 = sigmoid(2*x) - sigmoid(-2*x)

In general, with intensive calculations, probably, the calculation of sigmoid itself must be somehow optimized. There are libraries of fast and exact calculations available on the Net.

 
sergeev писал (а) >>

As you can see from the graph starting at a value of 5-6.

But I have another question. Which function is faster to calculate, sigmoid or hypertangent?

I think klot has the right answer and you can see it even in the picture. The sigmoid can have input values in a wider range. I would say from 3 to -3, but probably from pi to -pi.

Concerning the Target - the question appears about the number of bars ahead of the movement... I understood that the height of the movement will be selected on a certain number of bars. A suggestion to search for an interval of 100 bars, start from the entry point and the search stops when 2 extrema are found, each of which is at least X points away from the entry point. X points will be selected depending on the pair and time frame.

 

Tomorrow I'll post the opening inductor with a glimpse into the future. It clearly shows that trades with TP=80...100 pt last about 1500 minutes, from that we can draw appropriate conclusions for different TFs. But as for finding two extrema for X pips up and X pips down, I don't think so. If we go down and reach X points, we may not reach them upwards. Do I understand you correctly?

Reason: