Application of mathematical analysis and higher mathematics - page 8

 
eugenk1 писал (а):
About the flow of prices. I totally agree with you. About volumes, I don't know. Volumes sometimes look very funny. Look at EURUSD 2006.11.24 10:30 Moscow time. By the way, when I was studying MT4, I used to watch how volumes were changing during the price movement. And I was opening if it seemed that there was a trend and the volumes were increasing as the price was moving in the direction of the trend. And it seemed to help...So it's debatable, but let's give up for now for simplicity.

The thing is that volume in stock and forex are completely different things. Generally, volume is a very valuable indicator when it shows the volume of a transaction. But in forex, volume is just a number of ticks, i.e. price changes. Nothing else. Probably, the number of ticks per bar can also mean something, but, firstly, it is not clear what, and secondly, it is not clear how this not clear what can be used. That is why I think that for the simplicity of the picture it is better to refuse from volumes for the time being.

eugenk1 wrote (a):
Now the patterns. I take it you want to see some physics behind it all ? So far I believe in crowd and tehanalysis (exactly I believe, I can't prove anything, but it sounds plausible). The bottom line is this, there is a crowd. And there are generally accepted (and even imposed on the crowd) methods of tehanalysis. All see charts approximately the same, with the accuracy to the noises. And they believe in the same things. And therefore they perform approximately the same actions. For example, I haven't met anything more absurd than Elliott Waves and figure analysis. Nevertheless, it makes the crowd to act in approximately the same way. So, it's true for the market. Of course, all actions are not absolutely identical. The same waves with figures can be interpreted very differently. Everything is stricter with the indicator values. But there is a certain randomness in this case as well. Therefore, complex distribution of order accumulations on the market can occur. Now if by chance or by intention of the game masters, the price gets into one of these concentrations, it triggers a response: multiple orders get triggered, the volumes grow (by the way, this is another reason why I consider the volumes important) and as a result, the price either accelerates or slows down. The market model is spreading of disturbances in a highly non-linear and it is unknown how distributed the environment is. Unfortunately such a model gives little practical help. The properties of the medium are unknown. Moreover, it is not quite clear how they can be known. We can only guess where there are areas of strong non-linearity - order accumulations. For this purpose one should know classical tehanalysis, even if it seems to be an absolute rubbish. To predict the actions of the crowd, you need to know its beliefs. Unfortunately, this model does not explain at all and does not even try to explain temporary drifts, that is what interests me now. Alas, I have nothing better to offer. Can you suggest something else?

Not the physics, but the mechanism, the essence of the process. If it is understood to some extent, then it will become clear which of the known physical models you can try to apply.
I also believe in crowd, and I consider it as the second axiom of my approach. A market is a market, the interaction of supply and demand. Buy cheaper, sell dearer - the law of speculation. It is the same everywhere, and Forex is probably the most sophisticated of all world markets. And another important factor - because this market is a global one, it is very unlikely and difficult to manipulate, which is not uncommon on the stock exchange.
But apart from the crowd, there are also the fundamental processes in the world economy. And it is these that largely determine the relative exchange rates. The speculative price play is only a ripple on the surface of a deep current. The difference in the 4th digit of the dollar exchange rate does little to touch exporters-importers, but it is enough for speculators.
So generally agreeing with you I would like to draw a slightly different conclusion from this. "To predict the actions of the crowd, you need to know its beliefs" - I would put it this way: "In order to predict the actions of the crowd, one must have an indicator of its condition." The traditional terms "overbought/oversold" just reflect the opposite poles of this condition. However, modern indicators may not measure this well enough.

eugenk1 wrote (a):
By the way, here in forex, my 20 years of programming is worth almost nothing. Almost, because I can still write code myself and am not afraid of debugging via Print(). There are completely different tasks to be solved here. Not the logical construction of a system solving a well-defined task, but fighting with the unknown. So hardly knowledge of C/C++, even perfectly flawless, can help in UNDERSTANDING a simple system for 3-5 different indulators. ...

Yes, Yrixx, I also wanted to ask you. It seems that you are a beginner here too. Have you worked out some methods of system decomposition? I now try to think of it (and do) as sets of enabling and disabling signals. For example, two mooves crossed. The signal for a deal. But stochastic is hovering somewhere in the middle. It seems to be easier to think this way. But images in the Strategy Tester sometimes confuse me. What's up with that?

For debugging Print() will do at first. But for a more serious operation, output in the file is more efficient.
To understand the indices, it is better to read their descriptions directly on the MQ website https://www.metatrader5.com/en/terminal/help/charts_analysis/.
You will see for yourself that the calculation algorithms are elementary, and at the same time you will see what is commonly known and will not reinvent the wheel. Saving time is a useful thing.

I take the same view on signals. From the logical point of view, it is the simplest formulation of the task to develop those technical means that an EA must rely on. But even this simple formulation leads to great complexity. Different components give different signals - this is normal, because only different components can increase the reliability of signals. However, the hierarchy of these components is not predetermined, so a little deviation from elementary logic and it is already unclear how to process these signals.

Phoenix is a good example, by the way. There are only 4 (if memory serves me correctly) indicators and 5 signals. The logic is elementary. The deal is executed if all 5 give the green light. Therefore, it is easy to understand the principle of its operation. But to optimize it is not just difficult, but very difficult. :-)) The author has a special methodology for this purpose. And this methodology leads to inside out parameters for OsMA. You cannot get it in a tester.

I personally have not thought about complex logic, and therefore I'm not bothering with decomposition. So far, the task for me is to form signals and estimate their reliability. Then it is easy enough to calculate the reliability of their intersection.
 
Yrixx, I am still not clear on the volume issue. I am not the first to discuss it with you, and no one has managed to change my mind yet. So let's compromise. We will not consider them for the sake of simplification. But let's keep it in mind...

With models, you see, it seems that you also have nothing practically acceptable. And about manipulation - I'll probably argue... I have no doubt at all that forex is partly manageable. Of course it is managed with big money that you and I would probably never dream of. Nevertheless, this money is small compared to the Powers, which it throws out of equilibrium... In non-linear environments this is quite possible. And it's unlikely that all this mess was created just to give us enough food for our brains... Please don't laugh. Because I have been called a conspiracy theorist and other dirty words for such statements more than once :))))))))))

About my problems with turkeys. Alas, it is more a matter of habit and experience. If we draw an analogy with quantum mechanics, there too, when one gets a good grasp of coordinate and momentum representations, things like uncertainty ratios start to seem quite obvious. The same is true here. You can learn all calculation formulas of all indices by heart. You can learn by heart all the docs on this site. But until it is in your fingers, you will not understand anything. I have understood Phoenix in the sense that you're talking about (signals). There is really nothing complicated there. The hard part starts when you try to understand how it works in real life, where all these interlinked indices work together. That's why I want to write something of my own, very simple, but something that I will be able to adjust, say, for a month...
 

It's the same here. You can learn by heart the calculation formulas of all the indices. You can learn by heart all the documents on this site. But until it is in your fingers, you will not understand anything.

That's why I suggested you to read it on the website. The matter is that for all indicators there are only two or three ideas, which are rewritten for each of them in their own way. When you read it all in a row, you end up getting bored. :-)) It's just when everything is already settled in your head and both ideas and methods are visible. All that's left to do is to twist it a bit with your hands.

I have understood Phoenix in the sense that you're talking about (signals). There is really nothing complicated there. The hard part starts when you try to understand how it works in real life, where all these interconnected indices work together... By the way, you also admit the complexity of Phoenix, when talking about tuning. That's why I now want to write something of my own, very simple, but something that I will manage to fit in, say, for a month...


The indices are not interconnected in any way. Each one will give its signal independently of the others. The Expert Advisor waits for the simultaneous confirmation of all signals. But it is absolutely unclear why exactly such parameter values work.

I have an idea I would like to implement myself, but I do not want to give up what I am doing for the sake of something new. If you want to work on a simple scheme with your hands and, at the same time, write something of your own, you can try it.

The most sensational championship expert sashken is built on just 2 MAs. But it has its own distinctive zest. It is not in the fact that they are different types of МА, but the МА crossing is used as an inverse signal. That is, if the classic understanding is to buy when the fast one has crossed the slow one upwards, then this signal is used there to sell. This is a variant of the counter-trend strategy implementation. It is quite suitable in a volatile market (and the pound is the most volatile) when there is no trend. Therefore, for this Expert Advisor there are large areas when it is very profitable. But as soon as the trend starts, it will lose everything. This is what happened at the Championship.

The idea is to select or build an indicator of the market status that would only determine the trend-un-trend phase. This indicator should further serve as a switch in logic: interpret the signal in the trend direction and vice versa.

Of course, in order to turn the sashken into a normal Expert Advisor, this is not enough. We need to solve a couple of other issues. But this is its main flaw.


In fact, it's not just a study of tehanalysis. The question of recognising and separating market phases is relevant to everyone. It has not only practical but also scientific value. Therefore, there is, among other things, plenty of scope for a real study based on a scientific approach. If necessary - using any available mathematics (as opposed to the primitive arithmetic used in standard indicators).

I will be glad to participate in it, if it will be your will :-))

 
eugenk1:

That's why I now want to write something of my own, very simple, but something that will still manage to fit in for say a month...

Eugenk1, to make the conversation turn to a practical plane, I suggest a starting point for creation of something more or less simple, without quantum mechanics, calibration invariants and with possibility of adaptation on weekends. And the application of econophysics can be thought about quietly and after you have made something uncomplicated and workable.

There are two adaptive МА - Kaufman's in Code Base (thanks to dmitriy) and FRAMA (by Rosh, in the 'ArrayMinimum() function' thread). They are drawn very well and more or less flat on flags - just what I need to have fewer false signals. Of course there is a lag, but one can try to handle it in the same way as in ZeroLAG MA ('ZeroLAG MA').

Initial system - two adaptive differently tuned MAs with some rudimentary crossover filter. The next thing is this idea that I accidentally read in one popular article on the theory of catastrophes: "After a catastrophe, the system does not remember its previous parameters".

And now we test it on the whole history of that brokerage company, whose quotes you have. If all is good on the entire history, good luck! If not, we try to find points in the history, at which the system (not the market, but the system!) has had a crash, and see how the system parameters need to be changed (say, only the filter) for the system to work between the crashes. The criteria of a catastrophe - any reasonable one, they can still be chosen - either intuitively, or with the same economophysics or the theory of dynamic systems.

The main thing is to start, and then the ideas themselves will appear...
 
2 Mathemat
How come we are so friendly with you and Eugene? :-)))

That's an interesting idea about catastrophes. If you are able to identify disasters when they happen, you can make something substantial out of it. If not, the Expert Advisor will not be able to reset itself. It would need to survive the catastrophe first and then identify it anyway. What do you think ?
 
kniff:
In general, the point is that our main ally is statistics, i.e. we can draw conclusions based on frequently recurring events. And our enemy is outliers, which are falsely assumed to be profitable market inefficiencies. And the use of spikes can be driven very, very deep into the Expert Advisor. I.e. we take 10 Expert Advisors that fit them and give profit on histories, then we bring them together in one program and voila, we have 100 trades. The statistics look like more, but in fact nothing has changed!

If you have a signal filter that works VERY Seldom, for example 5 times per year, then its effectiveness and validity may be easily questioned, even if the total number of trades exceeds a thousand.

It means that each symbol and each "if" in advisor should have great STATISTICS on history to be valid. Of course, the total number of trades is important, but then we should go deeper.
You may identify the future direction of quotes on the basis of artificial intelligence. An example is in the branch (clickHERE). The trades are not filtered but open as soon as the previous one closes. AC oscillator was used as an indicator and a simple Perceptron neural network as an identifier.
 
Yurixx wrote:

That's an interesting idea about disasters. If one is still able to identify disasters at the time they occur, then one can make something substantial out of it. If not, then the EA will not be able to reconfigure itself. It would need to survive the catastrophe first and then identify it anyway. What do you think?

During the emergence, it is unlikely to succeed. There will still be drawdowns. Another thing is that these drawdowns can themselves serve as an indicator of a system crash. In general, the system catastrophe should probably only be caught based on the parameters of the system itself, not the "objective" parameters of the market, because it is a catastrophe of the model, not the market. (Hehe, there are no disasters in the market, only we see them as disasters - because of the discrepancy between models and objective reality...).

Once we identified it - do not trade further and wait for a certain time to get the system statistics in changing conditions, and then optimize the system and work in normal mode, until the next signal of a system crash ...

By the way, I didn't set myself the task of creating an automatically resetting Expert Advisor. The main thing is automatic detection of a catastrophe, and what parameters it will have after the cataclysm, God alone decides...
 

By the way, I did not set out to create an automatically reconfigurable EA. The main thing is automatic catastrophe detection.

That is what I had in mind. About the Expert Advisor - that is Eugene's task.
And in general, this task has the same effect as the one I described. If there are two strategies - trend and counter-trend - then the crash is a signal to switch to the other strategy. It only needs to happen at the catastrophe stage of the model, not at the EA stage. :-)

And we can use their past values as initial values of parameters for a new strategy and change (adapt) them gradually as statistics accumulate. All the same, waiting for new data can always just be a trap. Is it enough already or not? Whatever the statistics, the market can change at any time. And if that change (catastrophe) is correctly identified, there will be some time for the parameters to adapt.

PS It looks like Eugene's cognac treatment did him good. Or vice versa ? :-)))

 
I think that cognac is always beneficial - if in the right quantities.

Our catastrophes differ significantly, as yours isan objective transition of the market to another phase (from trend to flat or vice versa), while mine is a collapse of the subjective model as a whole (fuck everything - both flat and trend). I don't think the crash should be as frequent as yours - although the idea is not without merit... I think that the first attempts to build such systems should not be difficult to implement, and catastrophes as such should be rare. And I'm sure a couple of dozen programmers hired by a serious firm have implemented this a long time ago, hehe...
 
Yurixx, the turkeys are always and everywhere connected and interlinked with each other. Even if everything is organised as a set of independent signals. It's just that an indicator is some function of a price series. Several indices are several such functions. We count them all and make some decision based on it. Nevertheless, it's just a way of breaking the task into some observable chunks. In fact, I find it difficult to imagine a situation when, for example, the volume increases and stochastic does not react at all. For the indices are not independent by definition! And at the end of the day we are faced with the task of understanding what we have written ...
About the sashken. What does his trading signal mean ? Very simple. The fast one has crossed the slow one from bottom to top. During the delay, the up portion of the flat changed to a down portion. It means it's a good time to sell. Thus, this signal implicitly includes such a parameter as flat period. As you see, it's not so simple... As far as trading efficiency is concerned, he didn't convince me either. I had only 3 profitable trades in total. And the last one was in deep drawdown for a long time... Alas, with all my respect towards Sasha, I'm afraid his EA contains no ideas that would make sense to develop...
And the question of the separation of market phases... I don't know how it's solved, but I know what it's called. It's called the Grail... And everything we do here, in fact, is an attempt to solve it with this or that degree of certainty...