a trading strategy based on Elliott Wave Theory - page 53

 
<br/ translate="no"> I honestly don't understand anything from this file. It would be interesting to hear the comments. I think that the risk of a trade in the Vladislava strategy should be calculated solely on the current price position in the confidence interval, and not on the random number generator. As far as I understand it is the random number generator that is used as a setpoint for the amount of trades in the file?


In your tester report you can see that the probability of a profit trade is about 0.9, while the average profit is 10 pips (~1%) and the average loss 20 pips (2%). That is if you open with 0.1 lot of the $1000 deposit at Alpari. So if you vary the lot size (risk) you can get approximate sequences of trades and probability Balances. Again, bluntly pressing F9 will show that these are very good results, it is impossible to drain. Of course, if that's how the trades will be distributed in the future.
That, in a nutshell, is the idea behind this simulation.
 
Interesting... And I solved this problem is not much different, found in the net decomposition of the normal distribution function (12 lines) and consider the probability to the second sign, I do not know can it slow down the calculation (to the expert to approach), if it will be interesting I can lay out a piece of code ...

I too found inet calculation of quantiles on site ALGLIB.SOURCES.RU. But it somehow appeared not 12 strings at all and one function required calculation of others. I wrote about it in this thread before. So I think the approach used on this site would have slowed down the Expert Advisor. So if you actually have 12 lines of code that do the same thing, then everyone would be interested to read them. I use a quantile table with 3 decimal places. I think that 2 decimal places won't change the whole picture of work, but it will be useful for everybody.
 
What is the maximum standard deviation in points we have? No more than 100. Then finding the probability of being at any point on the price chart near the centre of the distribution will be no more than 1%, i.e. 2 decimal places. So there is no need for greater precision.
 
Maybe I did not understand the conclusions of the central limit theorem (in my reference book it is written like this: If a random variable can be represented as a sum of a large number of independent components, each of which contributes to the sum only slightly, then this sum is approximately distributed normally), it turns out that we simply use a normal distribution function table to determine the probability of finding SF within the confidence interval given by the value of the table.

That is why I simply did a series expansion of the distribution function and determined the interval size either in pips (if k=true (i.e. the probability of the price moving up or down)) or in RMS values

double ver(bool k, double Par,int e, int b) {if(k) {Canal(PriseData,e,b);
Par=(Par-CanalA[0]*b-CanalA[1])/CanalA[2];} double t=MathAbs(Par); double sum=t; double x=t*t; double s=0; for( int m=3; MathAbs(s-sum)>0.01;m=m+2){t=x*t/m; s=sum; sum=sum+t;} if(Par>0)return(-0.7968*sum*MathExp(-x/2)); else return(0.7968*sum*MathExp(-x/2)); }




I was very surprised that you didn't do that, and now it makes me doubt it all...

And please, if you don't mind, tell me what you mean by the term "quantile".

 
Here is a piece of ready-made code for practically calculating probability by deviation.

https://c.mql5.com/mql4/forum/2006/06/kvantil.zip

How to use it in the code is not difficult to guess.
 
I don't seem to have found any errors in this function, so I won't change anything until I get an expert.

I will make an explanation of the function:
k - key that indicates what is passed to the function in the Par parameter
If k=true, Par is a price and in this case we should also pass into the function the channel parameters relative to which the probability is calculated. The parameters e is the last channel bar and b is the first channel bar.
if k=false, then Par is the deviation expressed in RMS values, and then the parameters b and e are not used.
Canal(Data[],e,b) is a function that calculates the regression and RMS by filling CanalA [] with the obtained values.

And then the decomposition algorithm, which was taken from the http://www.kamlit.ru/docs/aloritms/lgolist.manual.ru/maths/matstat/NormalDF/NormalDF1.php.htm site

MathAbs(s-sum)>0.01 and here you can set the required accuracy
 
<br/ translate="no"> If a random variable can be represented as a sum of a large number of independent terms, each of which contributes only a small amount to the sum, then the sum is approximately normally distributed), then we simply use a normal distribution function table to determine the probability of finding the c in the confidence interval by a given value.

ZSY That you did not do it surprised me a lot, and now it makes me doubt it all...

ZZZY And please if you don't mind telling me what you mean by the term "quantile".

In the phrase "If a random variable can be represented as the sum of a large number" the key word is large. And this word I think refers both to the factors themselves and to the number of observations. In practice, we deal with samples for example from 30 bars up to 1000. In this case it is more appropriate to use Student's distribution rather than a normal distribution. I do exactly that. Although, perhaps we will get the same thing with a normal distribution. I haven't tested it yet.

Honestly, I couldn't understand your code at first glance. How can you take degrees of freedom into account in such a small amount of code? Excel has ready-made functions to calculate quantiles for different probabilities and different degrees of freedom. I use Student's distribution table, not a normal distribution (pp. 53-55 Bulashev).

By "quantile" I mean the same thing as written by Bulashev on pages 18-19 of his seminal work.
 
<br / translate="no"> To be honest I couldn't make sense of your code at first glance.


Explanation of the function in the post above
 
solandr, the only application of Student's distribution that I remember is to assess lab measurements. I remember I got a C on the terver test, which wasn't too bad in general, as the rest of the group got D's :)
So I'd be interested to hear how you apply the Student distribution :)

ZS Unfortunately, in those days, terver was too theoretical to be applied in life.
 
So I would be interested to hear how you apply the Student distribution :)

Well, I've already written above. Just calculating quantiles to build confidence intervals. How else can it be used? Bulashev has written how to calculate these very quantiles in Exxle. In general I have the same file that you posted above, but only for Student's distribution. Here is the difference. Just think how can you apply the normal probability distribution to a sample of 30 bars for example if there are only a few bars? Just compare quantiles of Student's distribution at different degrees of freedom and everything will become clear at once.