From theory to practice - page 254

 
bas:
You can also watch lectures - Small SHAD, Savvatev, etc. https://www.youtube.com/watch?v=UXhM8owABL8
But all this does not bring direct profit :)

Thanks a lot, I'll take a look)))

 
Renat Akhtyamov:

... On the forex market, it takes years and your lost money to get there.

Losing money and years is guaranteed, but "coming in" is not at all.

 
Alexander_K2:

Absolutely great post.

There's not even much to add. It's exactly like that.

For non-Markovian processes the matrix apparatus is not designed at all, that is the problem.

I was just working with ticks and found out an amazing thing. If you take the average RMS value of the sliding sample volume, it turns out that this value is almost a constant!!! And at the point in time when it starts to decrease, there is a trend that sort of restores this constant value of variance. That's what self-organisation of the process is all about.

But! I have found it very difficult to process huge data sets from any point of view (computer resources, power requirements, communication channel stability, etc.). This task is extremely difficult to solve at home.

But there are diffusion equations for Markovian processes. Everything is clear and understandable. That's why I started to transform our time process. Whether it is good or bad - I do not know. At least I have a footing under my feet. I'm more or less sure of the strategy, rather than guessing and tinkering, which is why I don't put any stops.

To be blunt - I'm not quite sure I'll have +100% per month all the time, but so far there's no reason to think this strategy will lead to outright failure.

And yes - if you break the "memory" completely - what we used to call a trend will look like just a deviation of let's say 4-5 RMS at most. And this is already happening now 80% of the time.

But 20% - yes, some additional parameter is needed. Looking for it.

Let's go point by point and take it slow:

1. Don't say that for non-Markovian processes "the mathematical apparatus has not been developed at all". - it is not so! Agree that mathematics teaches us to calculate the expectation for any random process, with any distribution, even quite unknown to mankind. Just assume that we measure a random variable and immediately obtain the right to calculate the expectation. Also, mathematics gives us every right to count the RMS for any process that seems random to us. For series and non-stationarity, the mathematical expectation itself becomes a series - a moving average. Mathematics does not insist, but offers to play with weights and a whole zoo of different slides has already been invented. The RMS in the case of series will be counted for each value of the series. You can average, smooth, cluster, extract periods, look for coincidences, patterns. This mathematics may seem childish to you, compared to the diffusion equation, but it is quite legitimate, reasonable and developed.

Alas, mathematics does not give us for price series the shapes and formulas of distribution curves, it does not give the properties of these distributions. Alas it does! However, M, S (RMS) and slides are already very good.

Yes, you can also count variance. And Chebyshev's inequality will also help to determine how much the market is "crazy in the moment". I think everyone knows how to view the market outflow in 3*S. And if the price series obeyed a "Normal Distribution", then the exit beyond 3*S would occur with a probability of only 0.27%!!!

Now let's talk about "the market has gone crazy". Remember we rejoiced that the distribution has thick tails? Like that would give us a lot of trades? That's right! But, as always, there is a "but". From these very thick tails we see that the market is "angry", it is manic-depressive. It sits in a flat - depressed - not fish or meat, not going up or down. And then he turns on his manic side and he gives it to us! And we are in heaven....... And the Yukos is worth 0(zero). And the dollar-ruble goes kaboom, and the euro-franc goes boom... and the brokers go bankrupt.....

What happened doesn't matter! Let's not be like analysts, let's not explain it with news, handshakes of tough guys, the economy, crises, bubbles. This is not important!

What is important is that it is perfectly normal for the market, like a thunderstorm, hurricane or tornado on our planet. And what's also important is that he's sick with such manias quite often!

Now, Alexander, I'll repeat my question from my last post.Why do you think that if a trend starts, it's from "processmemory"? Do you think that if you tear up the "memory" of the process by some transformations,the trends will disappear?????

Let's make it clear, let's speculate. You are shorting USDRUB from 30 down by the signals of your system in 2014. After all, it is quite logical - 30 is already high, it should return to the mathematical expectation - you think. Which method you used to calculate that it should be shorted is absolutely unimportant! What is important is that it flies down to 80. And now let's attach your quote: "If we break the "memory" completely - what we used to call a trend will look as just a deviation of, say, 4-5 RMS at most. And that's already happening 80% of the time now."

Sounds to me like 30 to 80 is way more than the 4-5 RMS you calculated BEFORE the outlier! I mentioned Chebyshev's inequality above - it can give a trader a ghostly hope that the probability of flying away by many-to-many RMS from the matrix expectation is small, because there it is estimated as <1/k**2, where k is the number of RMS. But the hope is ghostly! Because the RMS at the time of departure will increase and less will be needed for even a frantic deviation. Also remember that the probability of a random variable to fly away by 10 RMS(ten RMS, Carl!) is estimated to be less than 1%, which is alreadynot so low when serious money is at stake. Besides, don't forget that in such cases, hardy mathematicians have theory of catastrophes in store :)

You can say that you're not going to trade on daily candlesticks, that you will collect money on ticks. Fine, but the profit/loss ratio will be the same there too. Roughly speaking, when you collect 2 cents per trade, then a 1 dollar flight of an asset against you is a total disaster!

It would be very, very, very good if you could find a way to detect trends in advance. The best solution - simply do not enter those 20% of transactions in which the counter-trend system is carried away by a manic phase of the market. The trite solution everyone knows is to sense the trend with a stop loss, pay it off and drop out while you're still alive. But this is trivial. If you find a way to detect a hurricane on the approach - now that would be a miracle wonder! Hearst, nagentropy, even Mendeleev and Clapeyron. It's all in your hands!

It seems to me personally impossible, but I'm not saying it to you because you shouldn't spoil the mood of a creative person. Search and do not listen to anybody who says "it is impossible". Even if you can not, the path necessarily leads somewhere and gives at least small victories.

And a couple of other trifles:

The RMS with a fixed sample is definitely not constant- anyone who has seen old Bollinger knows that. Could it be that by taking a moving sample volume you have adjusted it so that the RMS becomes constant?

Your observation is "the RMS decreases before the trend". It has been known for a long time. Only usually, in the language of trading, one speaks of volatility. The volatility is contracting - wait for the movement, the volatility has increased - somewhere ahead there will be a flat (consolidation). Only it doesn't necessarily happen as soon as volatility goes up, or the trend flies as soon as it goes down.

 
Serge:


I'll give you the link in the meantime:

https://www.mql5.com/ru/forum/221552/page3#comment_6146489

The most brilliant Vladimir there, based on Orlov's books, said once and for all that for non-stationary series it makes no sense to calculate RMS. This thing does not work in the market. The best I could do was to calculate the average historical variance.

I.e. I took a moving sample volume of, for example, 10.000 ticks, and at the arrival of each new tick I calculated the variance and obtained the average value of this moving window variance. This thing is quite stable and can be worked with. But it is a VERY resource-intensive task.

The problem is solved simply for a Markov process - the diffusion coefficient is calculated instead of variance. This is really cool stuff. If the calculation takes into account non-stationarity of the process in form of bidirectional coefficient, you will see the most beautiful picture.

ALL.

And yes - the trend, is the "memory" of the process, its heavy tails of the distribution at a certain sample size. What is it trying to remember? It's that non-Markovian averaged variance. With these outliers, when the current variance reaches unbelievable sizes, it restores that historical average variance to some constant characteristic of the currency pair, when it has decreased.

От теории к практике
От теории к практике
  • 2017.12.02
  • www.mql5.com
Добрый вечер, уважаемые трейдеры! Решил было на какое-то время покинуть форум, и сразу как-то скучно стало:)))) А просто читать, увы - неинтересно...
 

Alexander_K2:

I.e. take a sliding sample volume of, for example, 10.000 ticks, and on the arrival of each new tick, calculate the variance and get the average of those sliding window variances. This thing is quite stable and can be worked with. But it is a VERY resource-intensive task...

Generally speaking, there are recurrence formulas for this purpose. There's no resource-intensiveness there).
 
bas:

K2 wrote about this somewhere in the middle of the thread.

Yeah, well, 99% of my code, for example, is technical risk handling. But we are talking about strategy here.

The question was about strategy, about what exactly is the output of VisSim?

At the time I was interested at least whether the model gives a prediction of movement? How does the model calculate the target? Now we have found out that the target is the mathematical expectation.

However, the description of the strategy now still looks like this

owl circles


Quote Alexander_K2: "In these equations the 2 components we are interested in are the drift and diffusion parameters, which we calculate and use."

The demolition and diffusion parameters are nice of course, but in order to trade we need to have an entry level - OrderSend will not take diffusion, and also be sure to have a plan where we forecast the move and what we will do in the event of a counter move. You don't have to put TP/SL right in the order, you don't have to tell them to the terminal and dealing, but the bot has to know them, at least in its algorithm!!!

I still haven't got an answer, how does respected Alexander pull what he has calculated in the space of "almost Markovian" process into the space of market quotes?

By how much is the mathematical expectation he calculated there different from the one that can be calculated directly from market data? Their values should be dumped into the log for each trade. Are the RMS's very different? The levels behind which it goes back to the average are not calculable without converting to its space? How does the number of trades and percentage of profitable ones change if these levels are placed further/closer to M?

Some take the news into account, some believe in the puppet theory, some in the phases of the moon, some in physics - you can calculate anything as you like. We are free people! And you can transform everything into any mathematical space as your soul or rather your insatiable mind desires. But one thing we cannot change - if at the end of calculations we want to really trade, then the output will always be the same: the direction and price of entry, plan A (if the market goes in our direction), plan B (if it doesn't).

This is what I would be interested to know (interfaces).

 

While I'm busy sorting out WebMoney and opening an unrestrained signal and PAMM account, I would like to dwell again and again on the key point - the time intervals between tick quotes.

I checked it once again. This is what I have got for the AUDCAD pair:

This is the distribution of time intervals between real ticks

I keep repeating that this is the DISCURRENT LOGARIFY DISTRIBUTION

Column C represents real values of the probability density function

Column D - calculated by formula fromhttps://ru.wikipedia.org/wiki/Логарифмическое_распределение with p=0.7.

Gentlemen!!!!!!!!!

Well, show me at least one theory that would work at such time intervals between events.

There isn't one and there isn't one to be expected.

That's why I break down this time series with an exponent, introducing pseudo-states into it and working with diffusion equations.

Files:
 

And yes! Gentlemen of physics and mathematics!

With my head bowed and my cap removed, I humbly ask you to post on this thread a REALLY work-proven formula for calculating the Hurst coefficient.

 
Serge:

The question was exactly about the strategy, what exactly is the output of VisSim?

If you want to really trade at the end of the calculations, then the output will always be the same: direction and entry price, plan A (if the market goes in our direction), plan B (if not).

This (interfaces) I would be interested to know.

Well, that's exactly what I told you) at the output of Vissim the buy/sell commands. On these commands the robot sends OrderSend at the current price. It doesn't have SL/TP, it also closes on command.

You have overcomplicated things)

 
Serge:

Let's take it one step at a time:

1. Don't say that for non-Markovian processes "the mathematical apparatus is not developed at all". - it is not so! You must agree that mathematics teaches us to calculate the expectation for any random process, with any distribution, even quite unknown to mankind.


A random variable having a Cauchy distribution is a standard example of a distribution having no expectation and no variance.

https://ru.wikipedia.org/wiki/%D0%A0%D0%B0%D1%81%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5_%D0%9A%D0%BE%D1%88%D0%B8