@Dmitry Fedoseev, I keep testing the script, there are such solutions:
But why isn't there one like this, for example:
Here are all the values of the array:
Because...
Because there is a variant with smaller gaps. Take a segment, from its edge look which segments start from it, if there are no starting exactly from it, then look for the closest one.
The task was to dock, and if there is no docking one, then take the nearest one.
Because there is an option with smaller gaps. We take a segment, from its edge we look at which segments start from it, and if there are no segments starting exactly from it, we look for the nearest one.
The goal was to dock, and if there is no docking, then take the closest one.
Thanks for the clarification!
In the process of implementing an idea, nuances always come up that were difficult to take into account right away.
At the moment, I have chosen the combination purely on the basis of its size - the more segments, the better. It's not ideal, but even it shows that this method can increase the model's profitability by around 30%, which is generally encouraging.
Aleksey Nikolayev: Perhaps it can be solved in terms of graph theory. Vertices of a graph are segments and arrows of the graph connect each vertex with all possible subsequent ones (the nearest allowable segments). Each vertex and arrow is marked with weights and a rule is defined by which the weight of each path is counted. Some algorithm for finding optimal path in the graph is applied. I am not ready to investigate the question in more detail)
Or maybe a multidimensional tree. Or a ray-tracing algorithm. BSP algorithm in projection. Barin sets an interesting task, to rack your brains.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
@Dmitry Fedoseev , I continue to test the script, there are such solutions:
Why isn't there something like this:
Here are all the array values:
@Dmitry Fedoseev, I keep testing the script, there are such solutions:
But why isn't there one like this, for example:
Here are all the values of the array:
Because...
Because there is a variant with smaller gaps. Take a segment, from its edge look which segments start from it, if there are no starting exactly from it, then look for the closest one.
The task was to dock, and if there is no docking one, then take the nearest one.
Because...
Because there is an option with smaller gaps. We take a segment, from its edge we look at which segments start from it, and if there are no segments starting exactly from it, we look for the nearest one.
The goal was to dock, and if there is no docking, then take the closest one.
Thanks for the clarification!
In the process of implementing an idea, nuances always come up that were difficult to take into account right away.
Perhaps it can be solved in terms of graph theory. Vertices of a graph are segments and arrows of the graph connect each vertex with all possible subsequent ones (the nearest allowable segments). Each vertex and arrow is marked with weights and a rule is defined by which the weight of each path is counted. Some algorithm for finding optimal path in the graph is applied. I am not ready to investigate the question in more detail)
Or maybe a multidimensional tree. Or a ray-tracing algorithm. BSP algorithm in projection. Barin sets an interesting task, to rack your brains.