Good afternoon, help find a bug in the code for the indicator , comments are in the code , blue does not want to draw as I want to write. Idea to find the smallest Low value in time range from last update to last update High green line. Thanks.
{
if(prev_calculated<1) limit=rates_total-1;
if(prev_calculated>0)limit=rates_total-prev_calculated;
for(i=limit; i>=0; i--)
{
yesterday_weekday = TimeDayOfWeek(iTime(Symbol(),0,i+1))-TimeDayOfWeek(iTime(Symbol(),0,i));
if (yesterday_weekday !=0) // находим открытие нового дня
{
BH=open[i];BL=open[i]; // переменные ХАЙ ЛОУ
Closebar=open[i]; // искомая переменная
NHT=time[i]; // переменная время последнего обновления ХАЙ
PHT=time[i]; // переменная время предпоследнего обновления хай
}
CloseD[i]=Closebar; // буфер отрисовки искомая переменная СИНИЙ ЦВЕТ
HD[i]=BH; // буфер отрисовки ХАЙ
LD[i]=BL; // буфер отрисовки ЛОУif (Fun_New_Bar==false) // находим закрытие бара
{
if (Prev_Time==0)
{
Prev_Time=time[i];
Fun_New_Bar=false;
}
if(Prev_Time!=time[i])
{
Prev_Time=time[i];
if(iHigh(NULL,0,i+1)>BH) // проверяем есть ли обновление Хай
{
C=PHT; // присвоим переменной время предыдущего бара обновления Хай
NHT=iTime(NULL,0,i+1); // находим время обновления Хай
Pshift=iBarShift(NULL,0,C); // находим индекс бара предыдущего обновления Хай
P=iLow(NULL,0,iLowest(NULL,0,MODE_LOW,Pshift,i+1)); // находим наименьшее значение Лоу от обновления Хай настоящего до предыдущего (искомая величина)
BH=iHigh(NULL,0,i+1); // прорисовываем Хай новый
Closebar=P; // прорисовываем искомую величину
PHT=NHT; // сохраняем время последнего обновления Хай
}
Fun_New_Bar=false; // ждем закрытие нового бара
}
}
Comment( NHT, C , Pshift ); // проверкаif(low[i]<BL) BL=low[i]; // в процессе
}
return(rates_total);
}
Good afternoon! Help on the EA! I need to make a normal trailing stop, which works in steps, and moves SL to Breakeven!!! I.e.: An order is opened and after 25 (figuratively speaking) points in the right direction, SL isimmediately set tothe opening price!
i have this code, but it follows the price and stops at the open price!
Good afternoon! Help on the EA! I need to make a normal trailing stop, which works in steps, and moves SL to Breakeven!!! I.e.: An order is opened and after 25 (figuratively speaking) points in the right direction, SL isimmediately set tothe opening price!
i have this code, but it follows the price and stops at the open price!
i've been banging my head against the wall for a week now!
Rustam Bikbulatov: Hi guys. Can you please tell me why I have a couple dozen orders that are closed in staggered order or differently? How should I fix it? Is there a method of closing them all at once?
Close at the end, not at the beginning.
for(int i=OrdersTotal()-1; i>=0; i--)
Or I should make my own list and close orders by it?
Hi guys. Can you please tell me why I have a couple of dozens of orders closing in staggered order or differently at all? How do I fix it? Is there a method to close them all at once?
it's not a joke and that's not how I mock.
Look at the picture carefully before you post heresy.
The topic is so trite that it's disgusting to read it... ...then the visuals are missing, then the optimization...
Widen the window wider and you'll be happy. Do not confuse which window to expand.
The problem is the screen resolution.
Thank you very much, started to guess by looking at the pictures...
The problem is the screen resolution.
Thanks again. Everything works, the problem was in the text size (font) display
{ if(prev_calculated<1) limit=rates_total-1; if(prev_calculated>0)limit=rates_total-prev_calculated; for(i=limit; i>=0; i--) { yesterday_weekday = TimeDayOfWeek(iTime(Symbol(),0,i+1))-TimeDayOfWeek(iTime(Symbol(),0,i)); if (yesterday_weekday !=0) // находим открытие нового дня { BH=open[i];BL=open[i]; // переменные ХАЙ ЛОУ Closebar=open[i]; // искомая переменная NHT=time[i]; // переменная время последнего обновления ХАЙ PHT=time[i]; // переменная время предпоследнего обновления хай } CloseD[i]=Closebar; // буфер отрисовки искомая переменная СИНИЙ ЦВЕТ HD[i]=BH; // буфер отрисовки ХАЙ LD[i]=BL; // буфер отрисовки ЛОУ if (Fun_New_Bar==false) // находим закрытие бара { if (Prev_Time==0) { Prev_Time=time[i]; Fun_New_Bar=false; } if(Prev_Time!=time[i]) { Prev_Time=time[i]; if(iHigh(NULL,0,i+1)>BH) // проверяем есть ли обновление Хай { C=PHT; // присвоим переменной время предыдущего бара обновления Хай NHT=iTime(NULL,0,i+1); // находим время обновления Хай Pshift=iBarShift(NULL,0,C); // находим индекс бара предыдущего обновления Хай P=iLow(NULL,0,iLowest(NULL,0,MODE_LOW,Pshift,i+1)); // находим наименьшее значение Лоу от обновления Хай настоящего до предыдущего (искомая величина) BH=iHigh(NULL,0,i+1); // прорисовываем Хай новый Closebar=P; // прорисовываем искомую величину PHT=NHT; // сохраняем время последнего обновления Хай } Fun_New_Bar=false; // ждем закрытие нового бара } } Comment( NHT, C , Pshift ); // проверка if(low[i]<BL) BL=low[i]; // в процессе } return(rates_total); }Please, wrote for myself and use them as well.
I wrote for myself and use them.
Please, I wrote it for myself and use it for myself.
this is for tester only :-)
In real life, it is very dangerous to trawl based on Bid, Ask
Hi guys. Can you please tell me why I have a couple dozen orders that are closed in staggered order or differently? How should I fix it? Is there a method of closing them all at once?
Close at the end, not at the beginning.
Or I should make my own list and close orders by it?close at the end, not at the beginning
or do you make your own list and use it to close?how do you make a list?