Machine learning in trading: theory, models, practice and algo-trading - page 3181

 

It just occurred to me that

1) the first attempt to understand a process is to decompose it into some primitives (break it into pieces), e.g. compression algorithms, various decompositions, decompositions....

2) The second step is to look for combinations of interactions between these primitives ( broken pieces ).

3) The superfluous are discarded and only the essence remains. Filtering...

 
СанСаныч Фоменко #:

In medicine, I've always been surprised by its supposedly evidence-based approach, where you take 100 patients, give half a drug and half a placebo , and present this as STATISTICS to justify the supposedly statistically significant conclusions.

Seems to me like cheating on a universal scale.

For stationary processes 100 is not a sample, but here is a person, all 100 are ALWAYS different, with a bunch of other diseases of different severity, living different lives and all with unknown correlation with the tested drug. It's called evidence-based medicine.

In a word, a universal medical scam.



Always by three) And it's just a control study after 5 years of internal in vitro research (that's what the pharmacopeial article is written on), then usually from circumstances and understanding of how the drug works, and if it doesn't, up to 5 years of monitoring the use).

The political risks of breaking the proper rules of medical research are great.))

But the money is too big...)))))

 
СанСаныч Фоменко #:

Or maybe it has NOTHING to do with evidence and is at best just advertising, and unfair, aimed at the majority of the statistically illiterate population. A banal thirst for money at any cost.

Now that we've touched on Covid.

If you take the instructions of the Ministry of Health of 20 years ago, written in strict accordance with the requirements of evidence-based medicine, then we, as well as all over the world (1) there was no epidemic and (2) there was no vaccine. And then according to your principle"But it's better to have some evidence than none at all" , we issue temporary regulations and quickly start making billions, ignoring our own instructions. By ignoring statistics, medicine has become dangerous.

It's about honesty in statistics. Either we observe every letter of the requirements of statistics, or it is not statistics at all.

You are only partially right about the requirement for large samples. Asymptotic tests do not work well on small samples, while exact tests work quite well.

There are plenty of other problems in drug testing besides mathematical ones, but it is better to try to solve them somehow than to cancel everything and go back to treatment with plantain.

 
Aleksey Nikolayev #

Forester #

Did it this way, if I understood correctly - count the number of units in the column/array with the target and then randomly fill the new array with units, then copy the new one into the old one.

//+------------------------------------------------------------------+
//|Генерируем массив с целевой случайным образом                     |
//+------------------------------------------------------------------+
void Random_Target()
{
   char arr_Target_Random[];//Массив со сгенерированными целевыми
   ArrayResize(arr_Target_Random,Strok_Total_Data);
   ArrayInitialize(arr_Target_Random,0);

   int S_T_1=0;//Сумма целевой 1;
   int Nomer_Stroki_Random=0;
   for(int i=0; i<Strok_Total_Data; i++)
   {
      switch(arr_Target[i])
      {
      case 1:
         S_T_1++;
         break;
      }
   }

   MathSrand(GetTickCount());
   for(int i=0; i<S_T_1; i++)
   {
      Nomer_Stroki_Random=RandomInteger(Strok_Total_Data-1);
      if(arr_Target_Random[Nomer_Stroki_Random]==1)i--;
      else arr_Target_Random[Nomer_Stroki_Random]=1;
   }
   ArrayCopy(arr_Target,arr_Target_Random,0,0,WHOLE_ARRAY);//Заменяем целевые
}

//+------------------------------------------------------------------+
//|Определяем комбинацию случайным образом
//+------------------------------------------------------------------+
int RandomInteger(int max_vl)
{
   return (int)MathFloor((MathRand()+MathRand()*32767.0)/1073741824.0*max_vl);  //случайное Int от 0 до  1073741824
}
 
Aleksey Vyazmikin #:

I did it this way, if I understood correctly - count the number of units in the column/array with the target and then randomly fill the new array with units, then copy the new one into the old one.

You have something complicated, especially unclear with i--
I mix columns like this. In this example, the index array is mixed, but you can mix the data itself by replacing the data type with
.
void RandomizeIdx(int & idx[], int rows) {
        int j = 0, c = 0;
        for (int r = 0; r < rows; r++) {//перебор train участка
                j = RandomInteger(rows);//номер строки с которой поменять - 
                c = idx[r]; idx[r] = idx[j]; idx[j] = c;//меняем местами каждую строку с случайной
        }
}
 
Forester #:
You have something complicated, especially with i--
.

This is if the row has already been popped out, it will take another try, and it will be popped out if the value is equal to one.

Forester #:
This is how I mix columns. In this example, the index array is shuffled, but you can also shuffle the data itself by replacing the data type with
.

Interesting, and seems more versatile.


Anyway, two passes have passed - 18% of units in the sample, in the first pass one quantum segment was found, and in the second pass two.

It's even kind of suspiciously small.

Added - in the third one again.

So my method can be recognised as working?

 
Aleksey Vyazmikin #:


So my method can be recognised as working?

Looking for an error in the code after modification

 
Aleksey Vyazmikin #:

Looking for a bug in the code after modification

No error no

 
fxsaber #:

Thanks, I'll try MathRand increments.

Aleksey Nikolayev #:

The most universal one is probably Monte Carlo.

Looks like I have an interesting Random generation.

double GetAvgPrice( const MqlTick &Tick )
{
  return((Tick.bid + Tick.ask) / 2);
}

void SetAvgPrice( MqlTick &Tick, const double Price )
{
  const double Spread = (Tick.ask - Tick.bid) / 2;
  
  Tick.bid = NormalizeDouble(Price - Spread, 8);
  Tick.ask = NormalizeDouble(Price + Spread, 8);
  
  return;
}

// Случайный знак приращения средней цены.
bool RandomPrice( MqlTick &Ticks[] )
{  
  const int Size = ArraySize(Ticks) - 1;
  
  if (Size > 0)
  {
    Print("Random price...");
    
    MqlTick PrevTick = Ticks[Size];
    double PrevPrice = GetAvgPrice(PrevTick);
    
    MathSrand((int)TimeLocal());
    
    for (uint i = Size; (bool)i--;)
    {
      const double Diff = GetAvgPrice(PrevTick) - GetAvgPrice(Ticks[i]);
      
      PrevTick = Ticks[i];

      SetAvgPrice(Ticks[i], PrevPrice += !(MathRand() & 1) ? Diff : -Diff);
    }
  }
  
  return(Size >= 0);
}

On top is a real symbol, on the bottom is random.

RandomPrice can be applied iteratively. Spreads and time are preserved.


It would be correct to do it via logarithm, but I didn't bother with it. If we refine it, it may be the best option for Monte Carlo to generate a random symbol with the required statistical characteristics.

Reason: