josi wrote: ↑
Tue Dec 28, 2021 9:16 pm
Toward the end of the book, the supercomputer Deep Thought reveals that the answer to the “Great Question” of “Life, the Universe and Everything” is “forty-two.”
Deep Thought takes 7.5 million years to calculate the answer to the ultimate question. The characters tasked with getting that answer are disappointed because it is not very useful. Yet, as the computer points out, the question itself was vaguely formulated. To find the correct statement of the query whose answer is 42, the computer will have to build a new version of itself. That, too, will take time. The new version of the computer is Earth. To find out what happens next, you’ll have to read Adams’s books.
The video, that our new friend Ziggy showed us, actually has a grain of reason. I understand that you are skeptical about predicting price levels, as the vast majority of traders, prefer to use tried and tested methods of work. That is, entering the market after fulfilling a number of conditions, thereby we confirm the intention of the price to change its direction. But, such signals will always be lagging. I am currently trading using the same algorithm, using the so-called traditional approaches of technical analysis.
But ..... no one canceled math! This is the oldest and therefore the most studied and developed science, unlike the rest (for example, physics or chemistry).
What do we have in terms of mathematics? We have a kind of two-dimensional function y = f (x), where Y is the price, and X is the time during which the price undergoes certain changes. Our goal is to calculate as accurately as possible the extremums of this function at specified time intervals, for example, inside a trading day.
From the point of view of mathematics, this is a completely solvable problem. But, there are a number of difficulties (without them, unfortunately, nowhere).
In one of my early posts, I shared a link to the work of a russian mathematician-programmer who solved a similar problem by means of genetic algorithms (that is, by enumerating and crossing various mathematical functions, followed by culling and raising offspring with a set of necessary dominant traits). These are very complex algorithms, to work with which you need to have a higher mathematical education, to have at least one of the lowest degrees in the field of theoretical and applied mathematics. I think that there are few people here, who have such knowledge. I also know that other scientists have solved this problem many times. That is, the thought and idea are not new, but with the advent of powerful computers, the development and implementation of such algorithms has become a reality.
So, what we have ... We have a reliably confirmed statement that .... no matter how complex a function is, it can be calculated from a set of its discrete values. In simpler words ... Let's say we have the values of the daily highs and lows of the EURUSD price for the previous year. Having given these series of values as initial data, we will use this program to calculate an approximate function, on the chart of which all the entered values will fall. Knowing the function, we can find, with a certain accuracy (n + 1) value of the maximum and minimum for the current day, that is, we can assume at what price levels the extremes will be located for today.
And everything seems to be simple, but ...... The calculated values will differ from the real ones obtained in your terminals. Sometimes these differences will be insignificant (within the margin of error), and sometimes very significant. By calculating the price function for each new day, taking into account the values of the previous day, you will see that each newly obtained function is different from the previous one (yesterday). The point here is that all these calculations are valid for static functions, and the price chart is a dynamic function. That is, the function changes itself over time. And it turns out that during the trading day, the original function at the beginning of the day somehow (according to certain laws, and maybe chaotically) changes. And the further your calculated extremum will be in time from the beginning of the day (the moment of ideal calculation), the less accurately it will fall into the calculated value. In other words, for an absolutely accurate calculation of price extremums, it is not enough to find a mathematical function based on a set of values; the next step is to look for the regularity of changes in the equations of this function, using the equations of the function obtained at the beginning of each trading day as the initial data. This is very hard mathematics !!! And besides .... who said that the function is modified inside the day according to a linear law?
Based on the above, we can summarize ...
1 - this is very difficult and unbearable for a person without deep mathematical knowledge and special software (like Mathcad, but there are also specialized programs, as I said earlier)
2 - it is impossible to calculate the exact values of the extremums, only approximate values
3 - the calculated values will be closest to the real ones if the calculated function does not change much inside the current trading day.
In fact, we have about the same state of affairs as using a certain set of indicators that work very well on one trading day and work disgustingly the next day.
Going back to the video that Ziggy presented ... This is a mathematical and fundamentally different approach compared to what I just described. Having not seen this video before, this algorithm has been spinning in my head for several years. For myself, I call it the adaptive zigzag algorithm. I know that there are similar indicators, which are called that, but they are based on completely different algorithms.
What do we get from the price chart?
1 - price range for each candle (max - min)
2 - speed of price change for each candle ((max - min) / candle time).
For a zigzag of any given period, we can calculate the same values for each candle as well as for each leg of the zigzag.
But we need one more thing ... We need the total path that the price makes inside each candle. What is the total path ... We know that even for the M1 minimum timeframe, inside each candle, the price fluctuates in a certain way, either rising or falling. These are the so-called tick prices. And if the range of a minute candle is, for example, 5 pips, then the path taken by the price inside the candle can be, for example, 17 pips. Summing up the price path inside each candle of the zigzag leg, we get the total price path for the leg. For an upward leg, the price change in bullish candlesticks is subject to addition, in bearish candlesticks subtraction. Thus, we get a set of statistics for each leg of the zigzag.
Having analyzed the N-number of previous legs of the zigzag of the same period, based on the statistics obtained, we can identify certain dependencies. In the end, it is absolutely obvious that, for example, the higher the speed of price change, the fewer candles are needed to pass a certain price range, the less the total price path inside each candle, due to the fact that the price has a clearly expressed direction of movement, respectively, the further the expected extremum will be.
But this is all theory. To translate theory into practice is possible only empirically. To do this, you need to code a lot, try, make mistakes, cross out everything and start over. But my coder friend, although a very high professional, is also very lazy
. And all this remains only in my head, unfortunately ...