The regularities of price movements: Part 2. Series of bars - page 19

 
Aleksander:



Mishek... and you're a bastard man... Don't post here anymore... I'm personally disgusted to even shit on the same field with such a man...

That's the problem, you come here to crap.
 


Yikes! Man, I thought nothing would surprise me after the occupation of Niroba and the Loker invasion, but there are still some surprising clinical cases. However, the pathology of martingale and catcher is apparently close to that of casino ruiners.

 
kosolap:
Procreating by budding?
 
Aleksander:

well... The game is good... but the ships are not properly (sub-optimally) laid out... although... in 2-3 games... it won't matter...

In 2-3 batches, yeah right. There's actually a five-decker. Without practice and the first one won't make it to the end.
 

It's not very sporty ...

 
HideYourRichess:

It's not very sporty ...


It's very sporting, making the most of your time to crap in as many threads as possible before you get banned.
 
alsu:
In two or three batches, yeah. There's actually a five-decker. Without practice and the first one won't make it to the end.

I don't know... a friend and I once saw a film about hunting :-) The specials... and we drank a shot of every toast there was in it.... - nothing-- six bottles for two... and here's some ships :-)

phew phew phew... vodka never gives me a headache :-) but I hardly drink drink drink (only from the heat) and I have no respect for vino... but vodka... easy

 
Well, I'm probably wrong, but to respond seriously to these childish tantrums is kind of, I don't know, funny to me
 

Continuing the theme of the bar series ...

There are patterns of price movements that many people know, but few know how to use correctly. One such pattern is the following rule:
The price recoils to the middle of the bar in most cases.
.

It happens like this (in one of the worst cases):

A pullback occurs on one of the subsequent bars. In this case it is the second bar.

I decided to calculate the percentage statistics for this rule and found out that it works more than 99% of the time. However, that does not mean
it is very easy to make money on this rule.

I wrote a script to calculate the statistics:

// Скрипт для подсчёта вероятности отработки 50% HL бара на последующих барах //
// Skript 50 pro otkat, июнь 2012
#property  copyright "Copyright © Svinotavr-2000"
#property  link      "DmitriyN"
#property show_inputs                      // Показываем окно параметров 
extern string NameFileSave="Rezultat.txt"; // Имя файла для записи данных 
extern double Glubina=100;                 // Глубина исследования, бар 

int start()
 { 
   // Декларация переменных
   double DliPer;           // Длительность периода исследования, лет
   double CenaCentra;       // Цена центра бара - 50%
   int    Massiv[1000];     // Массив результатов
   double KolCikl;          // Количество циклов расчёта
   double progr;            // Переменная прогресс-индикатора (доля единицы)
   
   // Вычисляем длительность периода истории исследования (календарная)
   DliPer = Bars*Period()/(1440*365);
   // Формируем строки шапки для печати в файл
   string S0 = "\n" + "================= Результаты расчётов ================="+ "\n";  
   string S1 = "Исследовано бар = " + DoubleToStr(Bars,0)+ " шт";
   string S2 = "Длительность периода исследования = " + DoubleToStr(DliPer,1)+ " лет";
   string S3 = "Период исследуемого графика = " + Period() + " мин." + "\n";
   // Выводим строки в файл - шапка    
   SaveLineInFile(S0); 
   SaveLineInFile(S1); 
   SaveLineInFile(S2); 
   SaveLineInFile(S3);
   // Цикл по всем барам начиная с n и заканчивая предпоследним минус глубина
   Comment("Ждите, идёт расчёт");             // На мелких ТФ скрипт подвисает
   for(int j = Bars; j > Glubina+1; j--)
     { 
        KolCikl=KolCikl+1;
        // Цикл по глубине  
        for (int NomerBara=1; NomerBara < Glubina+1; NomerBara++)
        {             
               // Считаем среднюю цену начального бара
               CenaCentra=(High[j]-Low[j])/2+Low[j];
               // Проверяем дошла ли цена текущего бара (J+NomerBara) до середины бара (J)                                        
               if (CenaCentra >= Low[j-NomerBara])  { // 1-е условие
               if (CenaCentra <= High[j-NomerBara]) { // 2-е условие
               Massiv[NomerBara]=Massiv[NomerBara]+1;
               // Досрочно выходим из цикла, если нашли бар
               continue;     
               }}
        }                                   
        // Прогресс-индикатор ======================================
        progr=(KolCikl/Bars)*1000 - MathFloor((KolCikl/Bars)*1000);
        if (progr>0.9999)                     // Частые комменты тормозят расчёты, _
        {                                     // _ поэтому ограничим число изменений
        Comment("Ждите, идёт расчёт, выполнено: ", (KolCikl/Bars)*100 , " %");
        } //========================================================            
     }
     // Печать массива в файл
     string S5 = "Номер бара" +"\t"+ "Количество бар" +"\t" + "Процент бар";
     SaveLineInFile(S5); 
     for(int ii = 1; ii < Glubina+1; ii++)
     {
     string S6 = ii +"\t"+ Massiv[ii]+ "\t"+ DoubleToStr(Massiv[ii]/KolCikl*100,3); 
     SaveLineInFile(S6); // Печать строки
     }
   // Сообющение о завершении работы скрипта
   Comment("Работа скрипта полностью завершена, результаты находятся в файле /experts/files/", NameFileSave);         
   }
 
  
// Процедура записи строки в файл - строки дописываются в конец файла                                             
void SaveLineInFile(string text)
{
int file_handle=FileOpen(NameFileSave, FILE_READ|FILE_WRITE, " ");
   if (file_handle>0)
   {
   FileSeek(file_handle, 0, SEEK_END);  
   FileWrite(file_handle, text);        // Записываем в файл строку
   FileClose(file_handle);              // Закрываем файл
   }
}
Criticism of the calculation part of the script is welcome.
 

Next ...
This script runs through the history and calculates the number of pullbacks that occurred and the percentages to file.
It looks like this:

This is part of the file. The depth is set in the initial data of the script.
In this case, we can see that 73.3% of kickbacks occur on the 1st bar after the initial bar, 51.8% of kickbacks on the 2nd bar, 42.5% on the 3rd bar and so on...

Proceeding from this data, we can calculate, for example, using Excel, what is the probability of the price pulling back to the middle bar on the first ten bars after the first bar:

In this case, we have transferred the data to Excel, calculated in column E the probability of a pullback on each bar, then calculated in column F the probability that this event will not occur, and then multiplied these probabilities in column G and obtained the probability that a pullback will not occur in 10 bars.

As the result we got that statistically, the probability of the rollback on the bars 1 to 10 is 100-0,7=99,3%

Of course, this rule cannot be applied to trade in its pure form since the losses on the unfinished bars will be enough to cover all the profits, despite the very high probability of the position being in the plus.