Theorem on the presence of memory in random sequences - page 27

 

Another bug was found in the code. When launching the Expert Advisor or turning off autotrading, the Expert Advisor immediately starts active trading, not when a new bar is formed, as it should be in the algorithm. I had to add a couple more lines:

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit(){

   
   if(!Sym.Name(_Symbol)){
      Alert("Failed to initialize CSymbolInfo, try again");    
      return(-1);
   }
   // Добавлены две нижеуказанные строки, чтобы советник ждал формирования нового бара
   CopyTime(_Symbol,PERIOD_CURRENT,0,1,ctm);   
   LastTime=ctm[0];

   Print("Expert initialization was completed");
   
   
   return(0);
}
The corrected code of the EA is in the trailer:
Files:
 
double results = rates[0].open - 2.0 * rates[p].open + rates[2*p].open; what is the meaning of this line?
 
Denis Timoshin:
double results = rates[0].open - 2.0 * rates[p].open + rates[2*p].open; I cannot understand this line, what is its meaning?

It is equal to:

double results = (rates[0].open - rates[p].open) - (rates[p].open - rates[2*p].open);
 
этоYury Reshetov:

It is equivalent:

this is of course clear, but what is its meaning, how does it compare to your theory?

 
Denis Timoshin:

is of course clear, but what is its meaning, how to compare it with your theory?

There are numerical values derived from plots of past history (i.e. we already know their values):

double a = rates[0].open - rates[p].open;

и

double b = rates[p].open - rates[2*p].open;

And in the future a third value will appear (which we do not yet know):

double c = rates[-X*p].open - rates[0].open;

The value of X is also unknown to us.

According to the theorem, if a, b and c are random numbers, then two mutually exclusive inequalities are true with probability over 1/2:

  1. a > b > c
  2. a < b < c

If they are not random, then with probability more than 1/2, there are also two mutually exclusive inequalities:

  1. c > a > b
  2. c < a < b

To find this out, we calculate:

double results = rates[0].open - 2.0 * rates[p].open + rates[2*p].open;

Which is equivalent:

double results = a - b;

Then we compare the value of results with 0, for above or below zero, and depending on whether the numbers are random or not, we decide according to the above inequalities.

 

...

Suppose we have a sequence of random variables:


x1, x2, ... xn

If for all i and j the equality is true:

p(xi) = p(xj | xi)

then the sequence has no memory.

Otherwise it is.

Yuri, hello!

I'm a bit late, though I read this thread from the beginning.

I understand correctly, that it is possible to find on lag i values of a random variable, which determinate the value on the last known datum? Or is it more complicated than that?

 
Alexey Burnakov:

Do I understand correctly that it is possible to find the values of a random variable that determines the value at the last known datum on Lag i? Or is it more complicated than that?

If at least two other random values in the random camp are known. But the point is that determinism is not strict, but probabilistic.

 
Yury Reshetov:

If at least two other random values in the random camp are known. But the point is that determinism is not strict, but probabilistic.

Does a random variable have the property i.i.d.? Doesn't that prevent the conclusions from being true?
 
Alexey Burnakov:
Does a random variable have an i.i.d. property? Doesn't this prevent the conclusions from being true?

The most important thing is that independence in the sequence for any i and j is observed: p(Xi > Xj) = p(Xi < Xj). Everything else doesn't matter.

 
Yury Reshetov:

The most important thing is that independence in the sequence for any i and j is observed: p(Xi > Xj) = p(Xi < Xj). Everything else doesn't matter.

I will think about it. I myself have been looking for dependencies specifically on forex market returns using the mutual information method and continue to do so. It is there.

But here, as I understand it, we are talking about an arbitrary series.