Optimal values of SL and TP orders for an arbitrary TS. - page 6

 
M1kha1l >>:

...

Тогда встает понятная задача - конкретизировать параметры SL исходя из параметров сохранности капитала. Таковыми могут быть:

  1. Макс % потерь текущего капитала от одной сделки ( возможно, как функцию от вероятности правильного прогноза и дохода от одной сделки )
  2. …. ( пжл. добавьте сюда свои – к сожалению, пользуюсь только одним)

The very possibility of loss only arises at the moment we enter the market. At that moment we assume we know :) :

  1. instrument of entry and its parameters (in particular its volatility)
  2. max % of current capital loss from one trade
  3. probability of a correct forecast
  4. ...and the weather outside the window as an example of an unformalized parameter
Hence, I suggest we go back to the basics once more and discuss the concept of the TS itself and its nodes, or clearly articulate them, before we start designing.

(because it seems a shame that accuracy of forecast has no effect on Lot :) )

Michael, I've separated the main (as I think) and fresh idea from your post, that: when calculating the lot you can take into account the value of probability. I had such an idea once, but... But this variant is more suitable for dynamic TS, you probably have exactly one, what do you think?

 
Neutron писал(а) >>

Everything is correct. Only this correctness needs to be proven, which we will do. My reasoning at the moment does not contain SL and TP orders, it is not the time to enter them yet. We will consider the most general case of a TS without protective orders which opens and closes positions by itself and its entire life, from the mathematical point of view, is determined by the distribution of h taps by absolute value and sign.

The simplest proof is trying to find better stops than a trading system by an optimizer. All Vince gives abstract calculations that have nothing to do with the quote. Moreover, as usual a stationary BP is assumed. Real TSs work on the range that is available, not the stationary one. Name me one MM that doesn't assume this. A TS that is profitable on real VR must have worse outputs than on VR with strange assumptions (stationarity). When something is proved, it is very important to discuss those assumptions that are not provable within the proof system, and that is usually the stationarity assumption.

Not everything is so obvious MM. It might be worth poking around here.

 
faa1947 >>:

Хотя на мой пост не обратили внимания, еще раз настаиваю, что SL и ТР не имеют никакого отношения к ТС.

Then what does the TS do? If SL and TP live their own, separate lives. It's funny.

If it was possible to find an SL better than an exit by a trading system that makes decisions on current quotes, then there is a disadvantage of this TS compared to SL.

I think there is some confusion of terms and objectives.

SL TR is a reaction to extreme trading conditions in forex, e.g. connection interruptions.

So you have an absolute strategy, for which only a connection failure is scary, for example? Do you close orders only during extreme conditions?

 
Neutron >>:


Да, пока эта величина фиксирована, но позже мы превратим её в параметр и найдём оптимальное значение (как у Винса, только для произвольной ТС и в аналитическом виде, что бы не оптимизатор гонять днями, а иметь коротенькую формулку - подставил в неё котир и получил оптимальное f).

Great!!! It's just a dream come true. And I suspect it will be a dysfunctional thing like Shepherd's....

 
storm писал(а) >>

Michael, I've highlighted a basic (as I think) and fresh idea from your post, that: when calculating the lot, you can take into account the value of probability. I had such an idea once, but...

Anatoly, thanks a lot, but I think the idea of correlation of Lot and FidelityPrediction is much older than me :)

Neutron wrote >>

Hi Mikhail!

Thanks for responding to my request to participate in the general discussion.

Of course, everything you voiced in your post just above is correct. But let's go in order (in my order :-) The fact is that there are many paths that lead to the truth, and unfortunately we can not cover them all, and that's not necessary. Therefore, I will continue the path I have already outlined, taking into account only your critical comments and omitting the details...

I think Sergey is right: Olympus is one, but each climber has the right for his own route. Our business is to respectfully help the one who started the way.

"My" not-so-new assumption about SL's relation to forecast reliability through Lot (i.e. through Max % of current capital loss from one trade) might be used g.n. in the "climbing" process.

storm wrote(a) >>

But this variant is more suitable for dynamic TS, it seems to be the same for you, what do you think?

Anatoly, give us your definition of "dynamic TS", maybe it will help the writer in his work.

Not to rubbish, we can continue this topic in another branch or in private.

 

Moving on.

Reminder:


We got an expression that shows the relative value of our deposit increment K[n] to its starting value K[n] through n transactions for an arbitrary TS, which is defined through the values of its bribes h[i]. The symbol P stands for the product of brackets by each other. That's all for now. The point is that we cannot go further with expression for deposit growth presented in this form. But we can try a trick, in particular, recall the fact that values of point bribes h[i] are integers, and in case of large number of transactions we can always find groups of bribes with the same number of points in each bribe. Thus regroup the terms in the product into a "product of interest piles" and take advantage of the fact that by rearranging the terms in the product, the product does not change. The expression can then be represented as:

Look, we were able to change from a continuous product to the product of groups with the same parameter h[j]. These groups can already be replaced with simple expressions with exponent g[j] equal to the number of elements in the group (see the right hand side of the expression for the deposit increment).

We need to investigate the resulting expression for an extremum that maximizes the deposit increment per time unit as a function of f. To do this, we will simplify the expression using the fact that an extremum of a smooth function (that is what we are interested in) will not shift if we look at the "vase" through a magnifier (figuratively). In our case we use a logarithmic function as a magnifier. Its beauty is that it is monotone and converts the product of magnitudes to their sum (without shifting the extremum):

For simplicity we denote the logarithm of profit by S and note that g[j] is nothing but a distribution function (DF) of the number (number) of bribes of such a size (argument). Here is, for example, how FR of randomly taken TC looks like:

You can see that the bribes may be both losing and winning (positive). You can also notice that there are noticeably more bribes with a small swing than with a big one, etc. It is not difficult to find the MO for such a TS:

You can see that MO=10 pips and this abstract TS would be able to produce profits for instruments with a commission of less than 10 pips. For the time being we leave out all questions concerning ergodicity and so on, because we consider an illustration of the suggested approach.

So, all this serves as preparation for the fact that in order to find the optimal deposit f, we need to know the law of the distribution of the number of tricks for a certain TS (and preferably in an analytic form). Knowing it, we substitute the obtained expression for FR into the formula for the logarithm of profit and look for its maximum. For example, in this case, the law of distribution of bribes is Gaussian and it is easy to write it down in analytical form:

Or for the logarithm of profit:

But again it is not clear what to do with this expression... But we can do the second trick and go from the sum to the integral. To do this, just divide and multiply the resulting sum by the same number, which we will take as equal to one point (simply put - one) or, what is the same - a step of descretization dh on the abscissa axis:

I deliberately went to infinite limits of integration, because the FR of bribes is not limited and bribes for the most general TS can take any values (in this case h is defined on the whole area of real numbers, which does not correspond to reality, but it is not principal and does not affect the result, but allows to go from sums to integrals - they are sometimes taken). 1/dh before the integral is omitted, since it is identically equal to one.

Now we can introduce a stopper into the problem.

A little later...

M1kha1l писал(а) >> Чтобы не флудить, мы можем продолжить обсуждение интересующщей Вас темы в др. ветке или в личке.

No way! I insist that you "flub" in this thread and don't dissipate intellectual potential :-)

grasn wrote(a) >> Great!!! It's just a dream come true. And I suspect it will be as dysfunctional as Shepherd's...

Well, Sergei, we agreed that we wouldn't expect a miracle. That's one. And two. It's expensive to prove anything. Even if the proven fact is negative. It saves you a lot of effort and puts it in a promising direction.
 
Neutron писал(а) >>

Moving on.

Let me remind you:

We obtained an expression that shows the relative value of our deposit increment K[n] to its starting value K[n] through n transactions for an arbitrary TS,

To be more precise, an arbitrary but profitable system. Any theory of SL and TR is meaningless without reference to a particular particular particular TS. Another TS will give other values of SL and TR.

 

to Neutron

I had a very simple idea. Since I'm just getting started with this problem I haven't had enough time to work it out in details and I'm not ready to show the formulas yet, but conceptually it looks like this. If I'm searching for a "universal" solution for SL not related to a particular strategy, I believe it is necessary to determine the "model" of the market (in quotes). Only in this case we can hope to find something acceptable (Sl and TP are related - it's a medical fact).

Definition of the problem

Using TP calculated values and time window length when TP is expected to trigger, determine the most likely SL level. It is clear that it is possible to modify SL and TP levels but it will be in the future.

Market model

The market model adopted is very simple. It is a "superposition" of two processes: a Bernoulli process ("momentum positive" and "momentum negative") and a very complex distribution of incremental moduli, similar to lognormal (from a distance :o)). It works simply - a positive or negative pulse is generated, then it is multiplied (accelerated) by some positive value (including zero) derived from a distribution close to the distribution of market returnees. But these retournals are so complicated and their distribution so unclear, that I have decided to replace them with some average of these retournals.

Keeping it simple: knowing the "waiting time" of TP, we can replace the market with such a simple model (based on the average returnee):

e.g. for a segment of a series like this

The model will be as follows

This is the model of the market written in impulses :o). Everything is trivial, for each (sliding) time window we collect the total passing of @impuls@ from the beginning of movement in that window. It will take into account all the (+) and (-) within the selected "quantum" of motion :o).

TP level

Having obtained the external TP level, knowing the current opening level and the average incremental value of the quoting process, it is possible to transfer the data to the model.

SL level

Further, inside each sliding time window we calculate all possible total movements with the signs (+) and (-). I.e. we find extreme points, compare it with the current situation and TP (including the direction of movement). It becomes possible to plot its distribution (by the way, it seems to be analytical). Further on it is almost simple - we take the method of maximum likelihood and get the most probable level of SL for the situation. Do not forget to take into account statistics High and Low, emissions, and of course - blackout, power failure, tsunami and volcanic eruptions.

Tweaks to the method

If the value of the window is relatively large, then it is possible (and maybe necessary) not to use the average increment x(i)-x(i-1), but generate these increments randomly, but in accordance with the distribution.

Distribution of TC transactions

You don't need to know it (most times it's impossible), it's replaced by the market model, which is calculated for the right window.



PS: Now it's your turn to criticise :o).

 
Neutron писал(а) >>

Hi Sergei!

Very interesting. Not to mention relevant. And even now, at an early stage, you can see how it can be applied in practice.

However, maybe you have some other surprises in store for me ? Well, I'm looking forward to the sequel.

 
Neutron писал(а) >>

Moving on.

Reminder:

We obtained an expression that shows the relative value of our deposit increment K[n] to its starting value K[n] through n transactions for an arbitrary TS, which is defined through the values of its bribes h[i].

Still the starting value K[0]?

It is strange, that you have not presented it as an article. Well, it's your business, I'll be glad to read the sequel.

Reason: