Machine learning in trading: theory, models, practice and algo-trading - page 873

 
Aleksey Vyazmikin:

It looks great! And how do you translate this into code understandable to mortals?

It's just as easy to translate

   Xmin=  0.0;
   Xmax= 10.0;
   Xcp = Xmin + (Xmax-Xmin)/2.0;
   Xcc = Xmax*2.0/3.0;

   Kmin= Xmin/Xcp;
   Kmax= Xmax/Xcp;

   if( x >= Xmax )            k= Kmax; else
   if( x <= Xmin )            k= Kmin; else
   if( (x>Xmin)&&(x<=Xcp) )   k= MathPow(X/Xcp,2.0);    else
   if( (x>Xcp) &&(x<=Xcc) )   k= 1.0+((X-Xcp)/Xcp)/3.0; else
   if( (x>Xcc) &&(x<Xmax) )   k= 1.0+MathPow((X-Xcp)/Xcp,2.0); 

The range of variation of argument X is divided into desired subranges, in which the corresponding variation of function K is specified.

It looks nice, as in the picture above, for a particular range specified in the problem

Xmin= 0.0;

Xmax= 10.0;

If you change these bounds, the beauty is broken.

But you can also do it in a general way, where the range boundaries can be changed, and the output will be the desired value of the function.


Well, I hope the principle of construction is clear and understandable.

Good luck.

 

It's better this way, let's get rid of the extra stuff.

.

   Xmin=  0.0;
   Xmax= 10.0;
   Xcp = Xmin + (Xmax-Xmin)/2.0;

   Kmin= Xmin/Xcp;
   Kmax= Xmax/Xcp;

   if( x >= Xmax )            k= Kmax; else
   if( x <= Xmin )            k= Kmin; else
   if( (x>Xmin)&&(x<=Xcp) )   k= MathPow(X/Xcp,2.0);    else
   if( (x>Xcp) &&(x<Xmax) )   k= 1.0+MathPow((X-Xcp)/Xcp,2.0); 

Good luck.

 

You can enhance the cutoff effect

.

   Xmin=  0.0;
   Xmax= 10.0;
   Xcp = Xmin + (Xmax-Xmin)/2.0;

   Kmin= Xmin/Xcp;
   Kmax= Xmax/Xcp;

   if( x >= Xmax )            k= Kmax; else
   if( x <= Xmin )            k= Kmin; else
   if( (x>Xmin)&&(x<=Xcp) )   k= MathPow(X/Xcp,4.0);    else
   if( (x>Xcp) &&(x<Xmax) )   k= 1.0+MathPow((X-Xcp)/Xcp,4.0); 

I hope everything is clear and understandable.

Good luck.

 
Oleg avtomat:

You can enhance the cutoff effect

.

I hope everything is clear and understandable.

Good luck.

Thank you!

About clear and understandable to talk too early - it will be necessary to reflect on the subject!

 
I ask the moderators to move all the threads on coefficients to this topichttps://www.mql5.com/ru/forum/172114/page2#comment_7267439 , so they do not get lost here.
 
Aleksey Vyazmikin:
I ask moderators to move all topic posts on coefficients in this topichttps://www.mql5.com/ru/forum/172114/page2#comment_7267439 , that they are not lost here.

Here, I have a question, why did your task appear in this thread?

Of course, of course, there's too much flubber here, but it's just interesting. No, I'm not even against it, just interest, nothing more.

 
Yuriy Asaulenko:

Here, I have a question, why did your task appear in this thread?

Of course, of course, there's too much flubber here, but it's just interesting. No, I don't even mind, just interest, nothing more.

Because from my observations, people from this thread rarely post in other threads, which may mean they don't read them.

This problem must be solved for machine learning, as I imagine its solution is necessary for reinforcement learning, so it is relevant to this topic.

 
Aleksey Vyazmikin:

Because from my observations, people in this thread rarely post in other threads, which may mean that they don't read them.

This problem should be solved for machine learning, as I imagine its solution is necessary for reinforcement learning, so it is relevant to this topic.

And regular sigmoids, etc., don't work? There are plenty of them in any textbook.

And what they don't read, they don't. Sometimes, maybe.

 
Yuriy Asaulenko:

And the regular sigmoid, etc. do not fit? There are plenty of them in any textbook.

In which state to look for them and check if they fit? I have no knowledge - I'm a fool, so I ask smart people.

 
Aleksey Vyazmikin:

In which state should I look for them and check if they fit? I have no knowledge - I'm a fool, so I ask smart people.

How do we know if they fit? Do you work with NS (neural networks)?

And if not, what do you do? And this will be closer to the subject of MO).