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

 

Please help, I think a lot of people here have done the tricky weights/coefficients assignment - I need to solve this problem:

Forum on trading, automated trading systems and testing trading strategies

Constructing Ratios

Aleksey Vyazmikin, 2018.04.29 00:16

I am not going to create a new topic, I will ask here, maybe there will be smart people willing to help.

I have this problem - given the maximum, minimum and average value of the coefficient and need to make a function (code), which will calculate the coefficient in the range from minimum to maximum with a change in acceleration from center to minimum - with slowdown, and from center to maximum with acceleration, with maximum and minimum values are the two limits of the coefficient value beyond this range or equal to the limit of one side or coefficient changing very slowly (if the first option is more complicated).

Graphically it looks like this



How to draw this case into the code, and first, to express it in a function?


 
Aleksey Vyazmikin:

Please help, I think a lot of people here have done some tricky weights/coefficients assignment - I need to solve this problem:


Depending on the requirements for the behavior of this coefficient, it can be done in any form.

For example like this :

.

or like this :

.

or like this :

.

In addition, you can enter an offset (up/down). Compress or stretch. Bend it to the specified limits. Or, for example, at the inflection point, change its behavior. etc.

These are illustrative simple examples.

More complex dependencies can be applied.

 
Aleksey Vyazmikin:

Please help, I think a lot of people here have been assigning tricky weights/coefficients - I need to solve this problem:



.

this is the solution to your problem.

 
Oleg avtomat:


is the solution to your problem.

Thanks for the formulas, but I have no idea how this can be coded.

And, the last picture is not the solution, I want the curve to change more strongly closer to the center when moving from the lower limit, then change weakly to about 2/3 and then change strongly again to the upper limit, i.e. that it was not linear.

 
Aleksey Vyazmikin:

Thanks for the formulas, but I have no idea how this can be coded.


Please.

It can be coded very easily and simply :

   
   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
                     k= X/Xcp;



And, the last picture is not the solution, I want the curve to change more strongly closer to the center when moving from the lower limit, then change weakly to about 2/3 and then change strongly again to the upper limit, i.e. it should not be linear.

In this case we need to specify the necessary law of change k(x).

 
Oleg avtomat:

Please.

It can be encoded very easily and simply :


Thanks for the code example.

Oleg avtomat:


In this case we need to specify the necessary law of change of k(x).

That's what I mean, I don't know how to make it, such a function with such characteristics. Its point is that the center - the most stable system, and the rest is generally acceptable error up to limits, and beyond - garbage, which is not good.

 
Aleksey Vyazmikin:

Thanks for the code example.

That's what I mean, I don't know how to make it, such a function with such characteristics. The point of it is that the center is the most stable system, and the rest is generally acceptable error up to the limits, and further - garbage, which is not good.

This can be described in many different ways.

For example, like this :


.

you should only look at this as an example of thinking

in the final version, the necessary simplifications/abbreviations are made and formulas are reduced to a relatively simple form as much as possible.

 
Oleg avtomat:

This can be described in many different ways.

For example, like this :

.

That looks great! But how to translate it into code understandable for mortals?

 
Hi)

Is the bot ready yet?
Let me play 😂😂😂😂
 
Alexander Ivanov:
Hi)

Is the bot ready yet?
Let me play 😂😂😂

Pick any one, play - Bots

Reason: