Discussion of article "A scientific approach to the development of trading algorithms" - page 2

 
Реter Konow:
It's brilliant, but VERY expensive, because while the algorithm is learning, it will drain a lot of money...

Of course, you can train on demo, but who said that when we enter the market for real, it does not change? ;)

Isn't really that expensive. I tried to do something similar using 2 averages, trained their period and a dozen more settings. In general, the algorithm quickly went to plus. At first the balance was falling, then the fall slowed down, and then the growth started, and then this growth was more or less stable. But it is not necessary to learn on real trades, you can make them virtual at first and then, when the balance starts to grow, start real trading. This is an idea in general outline... there are a lot of things to think about, the project is very big. There will be a lot of problems)). More problems with resource consumption....

 
Denis Kirichenko:

Maxime, kudos to you for your courage to explore the complex nature of markets!

I noticed for myself that the author is a mathematician and cooperates with a programmer to implement the proposed algorithms. I guess it is easier to solve complex problems...

The topics touched upon are very interesting, so keep it up!

Thanks!

I'm in favour of division of labour, so that everyone does their own thing, that way it's really possible to solve more complicated problems. Everyone should be a master in their own field)

 
Maxim Romanov:

is actually not that expensive. I tried to do a similar thing using 2 averages, training their period and a dozen more settings. On the whole, the algorithm quickly went to the plus side. The balance first fell, then the fall slowed down, and then began to grow, and then this growth was more or less stable. But it is not necessary to learn on real trades, you can make them virtual at first and then, when the balance starts to grow, start real trading. This is an idea in general outline... there are a lot of things to think about, the project is very big. There will be a lot of problems)). More problems with resource consumption....

A lot depends on the choice of market and type of trading (scalping, deutrading or medium term), and in this regard, I would advise you to go to funda. There are sources of diverse data and many sane and wealthy traders there, whose rational views form market patterns. Imho.
 
the probability of trend continuation is higher than the probability of reversal. This follows from the fact that the density distribution of increments over N steps for price series is wider and lower than the density distribution of increments for a process with 50% probability of reversal at each step.

It shouldn't. It is a mathematical fallacy. The shape of the distribution of increments tells us nothing at all about what the next increment will be.

 

The work is pretty, but I have a lot of questions, I strongly disagree with a lot of things:

1. Allegedly trendiness decreases with increasing scale - nothing like that!

2. Allegedly, the price chart in an efficient market should occupy the maximum intermediate position between linear and sinusoidal - what kind of trend is this, especially in an efficient market?

3. and one more thing - where is the value of stop loss in the EAs in the tests? Without a stop loss, any Expert Advisor is immediately profitable (though until the first large-scale reversal, where the deposit will die).

I say this not in reproach, no offence, the truth I liked the work - made with a soul, interesting, colourful. But still, do not give out semi-intuitive things in a research impulse.

 
Aleksandr Masterskikh:

The work is pretty, but I have a lot of questions, I strongly disagree with a lot of it:

1. Allegedly, trendiness decreases with increasing scale - nothing like that!

2. Allegedly, the price chart in an efficient market should occupy the maximum intermediate position between linear and sinusoidal - what kind of trend is this, especially in an efficient market?

3. and one more thing - where is the value of stop loss in the Expert Advisors in the tests? Without a stop loss, any Expert Advisor is immediately profitable (though until the first large-scale reversal, where the deposit will die).

I say this not in reproach, no offence, I really liked the work - made with a soul, interesting, colourful. But still, do not give out semi-intuitive things in a research impulse.

Questions are good!

1. In the previous article I wrote how I determine the degree of trendiness and what I consider a trend. I made an indicator that measures the degree of trendiness of an instrument on different scales and tested a large number of instruments, (more than a hundred). I did not just write that instruments become less trendy as the scale increases, but I did some research on this issue beforehand. For example, the same shares of APPL. A histogram of trendiness distribution for different block sizes is plotted. On the left the block size is 0.4, on the right 3.59. If the value is greater than 1, it is trending, if it is less than 1, it is flat. Despite the fact that all scales are above 1, but the value of trendiness is falling.

similarly for EURUSD below. On the left the block size is 0.00023, on the right 0.008. You can see that as the scale increases, the trendiness becomes lower.

If you prove me wrong, it will be great and I will be happy to use your methodology.

2) Linear and sinusoidal charts are completely deterministic. A line chart has a 100% probability of trend continuation, while a sine chart has a 0% probability of trend continuation. An intermediate value is when the probability of reversal is 50%.

3) Stop Losses can be included, but it will not affect the result, because losing positions are closed as soon as the price passes the number of points equal to the size of the block in the opposite direction, and the profit on the contrary can collect several blocks. If the block size is called BS, the maximum loss can be 1BS + delta at block closing + commissions. The profit size can be from 0BS to nBS, depending on how much the price can go vertically without pullbacks. This shows everyone's favourite principle: limit losses and let profits grow. That is, losses are fixed, nothing is overstayed, there are no martingales, no averaging. There can't be a situation when the market has turned round and the depo has evaporated. But there can be a situation when the market became flat and the depo started to melt.

There are no semi-intuitive things, if something is written, it has been tested, except for what is called a hypothesis, there it is just intuitive reasoning, not proven. If you disprove something and show proof then I will be only too happy to use your claims. This is science) I do something and another person tries to prove that I did it wrong and in the process everyone gets closer to the truth.

 
secret:

It shouldn't. It is a mathematical fallacy. The shape of the distribution of increments says nothing at all about what the next increment will be.

The shape of the distribution doesn't really tell you what the next increment will be. But it does tell you how it used to be. If the probability of reversal was 50%, then the shape of the distribution would be like the red benchmark. I'm not making anything up here, it's combinatorics. But if the distribution is lower than the benchmark and wider, it means that the price on average travelled vertically more than the process with 50% probability of reversal, and therefore the probability of reversal was less than 50%. In the future, we can assume that the character of the instrument will be preserved and it will be inclined to continue the trend. Here we can even assume the worst case scenario, that in time the probability of reversal will tend to 50%, develop a model of this tendency and take it into account in trading. If this is not the case, show me where I am wrong.

 
Maxim Romanov:

If that's not true, show me where I'm wrong.

Distribution and combinatorics show the frequency of increments. But they don't tell us anything about the order in which they follow.

You could, for example, arrange the increments as follows: sequentially in time, first all positive, then all negative. You get one upward trend and one downward trend, and one reversal. And the frequency of increments will remain the same.

And trendiness is just the order of arrangement in time, not just frequency: a positive trend is more likely to be followed by a positive trend, and a negative trend is more likely to be followed by a negative trend.

In mathematical terms, it is a correlation, or a conditional distribution.

 
secret:

Distribution and combinatorics show the frequency of increments. But they say nothing about the order in which they follow.

You could, for example, arrange the increments as follows: sequentially in time, first all positive, then all negative. You get one upward trend and one downward trend, and one reversal. And the frequency of increments will remain the same.

And trendiness is just the order of arrangement in time, not just frequency: a positive trend is more likely to be followed by a positive trend, and a negative trend is more likely to be followed by a negative trend.

In mathematical terms, it is a correlation, or a conditional distribution.

It's true, the fact that the price has travelled 0 steps vertically in 40 steps does not directly indicate what the probability of reversal was. It could have gone up 20 steps in a row, and then 20 steps in a row down, eventually reversing only 1, and travelled 0 vertically. You could say my assertion is wrong.

But there are nuances. If the price took such configurations, then on smaller/larger number of steps the distribution would have a different shape and on larger scales the distribution would have a different shape, not similar to the initially obtained one. That is, the shape of the distribution would be different at different scales. But the shape of the distribution is roughly the same for any number of blocks and any scale. Hence I concluded that there is no gross error. Yes, the probability of a reversal does not strictly follow from the shape of the distribution on one scale and one number of steps, but if we take the distributions on all scales and all numbers of steps and if they are plus or minus the same, we can assume that the market is most likely trending, if the distribution for the market is lower and narrower than for the benchmark.

But I agree that it would be better to calculate the number of reversals directly, it would be less questionable and clearer.

 

Maxim Romanov:

The probability of reversal does not strictly follow from the shape of the distribution.

It doesn't follow at all, in principle. It's a trivial mathematical fact from a textbook. It's like green can't be sour.

You can generate a reversal or trend process with absolutely any distribution of increments.


Maybe there is a reverse effect - reversion and trend processes (real, not generated) give different distributions at a certain slicing of bars.

I.e. first the return/trendiness as an initial fact. And then the form of distribution as a consequence. But it still needs to be proved.