You enter in the variable what kind of a flop you are interested in during the whole history and it gives you the longest flop in the specified number of pips, when and how long it lasted.
Rayder69: You enter in the variable what flip in pips you are interested in throughout the history, and it gives you the longest flip in the specified number of pips, when and how long it lasted.
possible to fix? and dare I ask to put in variables the time interval at which it looks for a flat
//////////////////////////////////////////////////////////////////////// ПОИСК САМОГО ДЛИННОГО ФЛЕТА ПО ВРЕМЕНИ +111.mq4 ////////////////////////////////////////////////////////////////////////
#property show_inputs
externint ПУНКТЫ=300;
extern datetime НАЧАЛО=D'2010.9.3';
extern datetime КОНЕЦ=D'2010.1.1';
//----------Переменные для вывода данных-------------- int FBars, //кол-во баров в коридоре
SiftBars; //индекс бараdouble PriceMin, //минимум коридора
PriceMax; //максимум коридора//----------------------------------------------------int init()
{
НАЧАЛО=iBarShift(0,0,НАЧАЛО);
КОНЕЦ=iBarShift(0,0,КОНЕЦ);
}
//----------------------------------------------------int start()
{
int i,n,D,ST,Bar;
//----
Alert("*********************");
int Shift_Min=iLowest(Symbol(),0,MODE_LOW,Bars,0); //Находим индекс минимального бараint Shift_Max=iHighest(Symbol(),0,MODE_HIGH,Bars,0); //Находим индекс максимального бараdouble Min=iLow(Symbol(),0,Shift_Min); //Находим минимум на графикеdouble Max=iHigh(Symbol(),0,Shift_Max); //Нходим максимум на графикеdouble Z=(Max-Min)/Point; //Растояние в пунктах от минимума до максимума на всем графикеdouble W=Z-ПУНКТЫ; //Переменная W нужна для ограничения бесполезных циклов по ценам ось(Y) //-------------------------------------------------------- for (i=0;i<=W;i++)//Цикл по ценам ось(Y)
{
ST=0;
for(n=НАЧАЛО;n<=КОНЕЦ&&n<Bars;n++)//Цикл по барам ось(X)
{
if(Low[n]>Min && High[n]<Min+ПУНКТЫ*Point)
{
if(ST==0)
{
Bar=n;
}
ST++;
}else
{
if(FBars<ST)
{
FBars=ST; //Сохраним кол-во баров в коридоре
PriceMin=Min; //Сохраним минимум коридора
PriceMax=Min+ПУНКТЫ*Point; //Сохраним максимум коридора
SiftBars=Bar; //Сохраним индекс бара
ST=0; //Обнуляем счетчик
}else
{
ST=0; //Обнуляем счетчик
}
}
}
Min+=1*Point; //Сдвигаем коридор на один пункт вверх
}
//--------------------- ВЫВОД ДАННЫХ --------------------
ObjectDelete("q9w8e5");
ObjectCreate("q9w8e5",OBJ_RECTANGLE,0,Time[SiftBars],PriceMin,Time[SiftBars+FBars],PriceMax);
datetime Нач=Time[SiftBars+FBars];
datetime Кон=Time[SiftBars];
Alert("Самый длинны флет в ",ПУНКТЫ," пунктов был с ",TimeDay(Нач),".",TimeMonth(Нач),".",TimeYear(Нач)," ",TimeHour(Нач),":",TimeMinute(Нач),
" по ",TimeDay(Кон),".",TimeMonth(Кон),".",TimeYear(Кон)," ",TimeHour(Кон),":",TimeMinute(Кон)," Цена : MAX = ",PriceMax," MIN = ",PriceMin,
" Кол-во баров в коридоре = ",FBars," :)");
return(0);
}
//+------------------------------------------------------------------+
If you want to use the script to evaluate the performance of avalanche-like EAs, this is only suitable for a classic avalanche with stationary channels. If non-stationary channels are used, diverging triangles are the most dangerous in this case.
khorosh: If you want to use the script to evaluate the performance of avalanche-like EAs, this is only suitable for a classic avalanche with stationary channels. If non-stationary channels are used, diverging triangles are the most dangerous in this case.
Are stationary channels a channel with two parallel boundaries?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Here's a script I can't remember where or when I found it.
Maybe someone could use it!?
What does it do?
Thank you
You enter in the variable what flip in pips you are interested in throughout the history, and it gives you the longest flip in the specified number of pips, when and how long it lasted.
Error: The script cannot work on this chart.
What am I doing wrong?
it doesn't work on five digits
is it possible to fix it? and dare I ask to put in variables the time interval at which it looks for a flat
possible to fix? and dare I ask to put in variables the time interval at which it looks for a flat
If you want to use the script to evaluate the performance of avalanche-like EAs, this is only suitable for a classic avalanche with stationary channels. If non-stationary channels are used, diverging triangles are the most dangerous in this case.