From theory to practice - page 1458

 
secret:
Millionaires are required of those mathematicians who claim to describe financial series)
Similarly, if a computer assembled by an engineer does not work, then the engineer's knowledge is wrong.

Well firstly, computers can fail because of a trivial failure of some chip, which the computer assembler has nothing to do with making.

It is not necessary for a researcher of financial rows to implement his research to make money by trading. Any research findings, if they discover something new, are valuable in themselves. You cannot, for example, blame Niels Bohr for not building a nuclear reactor based on his research into the nucleus).

 
Aleksey Nikolayev:

In reality, a statistician always deals with finite samples, and so it is always just an approximation to the implementation of this theorem. But as the sample size grows, this approximation improves, and this is called the consistency of the estimate.

The article in Russian wiki about Glivenko-Kantelli theorem is nonsense, read in English version or in some normal textbook.

No, in principle the theorem works, here's an indicator to test it now, so as not to argue

it's almost a linear distribution:


and this line from zero is

As for nonsense, everything is clear to me personally.

#property strict
#property version "1.1"
#property indicator_separate_window
//#property indicator_chart_window
#property indicator_buffers    1
double STAT[],CHART[],CL,min,pnt;
int i,indBars,ind;
//+------------------------------------------------------------------+
int init()
{
   pnt=MarketInfo(Symbol(),MODE_POINT); 
   //---
   SetIndexBuffer(0, STAT);
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1,clrRed);
   SetIndexLabel(0,"STAT");
   //---
   return(0);
}
//+------------------------------------------------------------------+
void deinit()
  {
      //ObjectsDeleteAll();
  }
//+------------------------------------------------------------------+
void start()
{
   ArrayInitialize(STAT,EMPTY_VALUE);
   indBars=Bars-1;
   ArrayResize(CHART,indBars+1);ArrayInitialize(CHART,0);
   for(i=indBars; i>=0; i--)CHART[i]=iClose(Symbol(),Period(),i);
   ArraySort(CHART,WHOLE_ARRAY,0,MODE_ASCEND);
   min=CHART[0];
   ind=-1;
   for(i=indBars-1; i>=0; i--)
   {
      if(CHART[i+1]!=CHART[i])
      {
         ind=ind+1;
         STAT[ind]=(CHART[i]-min)/pnt;
      }
   }
   return;
}

What this does is not yet clear
 
Renat Akhtyamov:

No, in principle the theorem works, here's an indicator to test it now, so as not to argue

it's practically a linear distribution:


and this line from zero is

About the nonsense - I personally understand everything there

#property strict
#property version "1.1"
#property indicator_separate_window
//#property indicator_chart_window
#property indicator_buffers    1
double STAT[],CHART[],CL,min,pnt;
int i,indBars,ind;
//+------------------------------------------------------------------+
int init()
{
   pnt=MarketInfo(Symbol(),MODE_POINT); 
   //---
   SetIndexBuffer(0, STAT);
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1,clrRed);
   SetIndexLabel(0,"STAT");
   //---
   return(0);
}
//+------------------------------------------------------------------+
void deinit()
  {
      //ObjectsDeleteAll();
  }
//+------------------------------------------------------------------+
void start()
{
   ArrayInitialize(STAT,EMPTY_VALUE);
   indBars=Bars-1;
   ArrayResize(CHART,indBars+1);ArrayInitialize(CHART,0);
   for(i=indBars; i>=0; i--)CHART[i]=iClose(Symbol(),Period(),i);
   ArraySort(CHART,WHOLE_ARRAY,0,MODE_ASCEND);
   min=CHART[0];
   ind=-1;
   for(i=indBars-1; i>=0; i--)
   {
      if(CHART[i+1]!=CHART[i])
      {
         ind=ind+1;
         STAT[ind]=(CHART[i]-min)/pnt;
      }
   }
   return;
}

What this does is not yet clear

1) I advise to use mql5 (you can build normal graphs) and MathCumulativeDistributionEmpirical() function

2) Price distributions are meaningless because of their apparent dependence. It is common to study the distribution of price increments.

 
khorosh:

It is not necessary for a financial row researcher to implement their research to make money by trading. Any research results, if they discover something new, are valuable in themselves. You cannot, for example, blame Niels Bohr for not building a nuclear reactor based on his research on the nucleus).

Not necessarily. But in this field, profit is the criterion of truth. So if your goal is to make money and not just research, there is no point in reading all 100500 million posts on the forum) you can save years of your life if you are selective.

 
Aleksey Nikolayev:

Conditional distributions are based on joint distributions. Only in the case of independence (by definition) is the joint distribution function equal to the product of univariate distribution functions. In the case of dependence, it is much more complicated - copulae were recently recalled here - this is from the same thread. So the G.-C. theorem (which seems to be generalized to the multidimensional case) applies to approximate construction of a two-dimensional distribution from which one can try to construct a conditional one-dimensional distribution.

Let's take an example: construct an incremental distribution, assuming the previous increment was positive. What prevents a sample distribution from converging to a theoretical distribution as the sample increases?

 
Aleksey Nikolayev:

Stability of what? There is, for example, stability of the Lyapunov solution of a diffuser, or, for example, statistical stability of the frequency of an event (in the sense of convergence to its probability).

Stability of behaviour in time. Something like stationarity, but in a broader sense. A function (series) may be non-stationary, but still exhibit similar behaviour in any interval of time. For example, y=x^2 is stable, but y=x^2 + sin(x) is not, provided that the analysis window is smaller than the sin() period.

Applied to equitability, it can be formulated as follows: "equitability grows (updates high) on each of N time intervals". In the limit, it simply converges to the percentage of profitable trades. Or the percentage of trades that updated the high. But maybe you can suggest a better wording.

 
secret:

Let's take an example: construct an incremental distribution, assuming the previous increment was positive. What prevents the sample distribution from converging to a theoretical distribution as the sample increases?

If we take a subsample and construct a distribution function for it, will it coincide with that for the whole sample? In the general case, of course not. As an example, let the sample have numbers of different signs and the sub-sample have only positive numbers.

In the case you cite, if the original sample is independent, the subsample seems to remain independent. In the case of dependence of the original sample, everything will be determined by the device of this dependence, which is fully determined by a joint bivariate distribution, which can be approximated by a bivariate sample (from pairs of subsequent displacements) if the conditions of G-K theorem are satisfied for it.

The point is that it is always possible to construct a sampling function for any set of numbers, but it does not always make sense. To clarify whether this makes sense, one can use criteria like the Kolmogorov-Smirnov two-sample criterion, by randomly dividing the original sample into two subsamples.

 
secret:

Stability of behaviour over time. Something like stationarity, but in a broader sense. A function (series) can be non-stationary, but still exhibit similar behaviour over any time interval. For example, y=x^2 is stable, but y=x^2 + sin(x) is not, provided that the analysis window is smaller than the sin() period.

Applied to equitability, it can be formulated as follows: "equitability grows (updates high) on each of N time intervals". In the limit, it simply converges to the percentage of profitable trades. Or the percentage of trades that updated the high. But maybe you can give a better formulation.

monotonicity of a function and/or its derivatives? algorithmic complexity?

 
Aleksey Nikolayev:

1) I suggest using mql5 ...

this is debatable

I can do the same in 4-rka.

in general, i haven't had any tasks that i couldn't implement on 4-rka

including graphics

 
Renat Akhtyamov:

it's a moot point.

I can do the same in 4p

in fact, I've never had a task that I couldn't do on 4p

including graphics

Did you ever ask your Expert Advisor to follow the current trend shown by the ZigZag? Specifically, to open

The next position at the beginning of the next trend and close it at the end of the trend?