Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1077

 

Make it like this

int limit = prev_calculated > 0 ? rates_total-prev_calculated : rates_total-1;

Instead of 1, you can put any number except 0. The higher the number, the fewer bars will be counted when the indicator starts.

And remove

ArrayResize(?,?,?);

it is absolutely useless.

 
AlexeyVik:

Make it like this

Instead of 1, you can put any number except 0. The higher the number, the fewer bars will be counted when the indicator starts.

And remove

it is absolutely useless.

I understand now. Thanks for the advice.
 
guys, there is a command t1=StrToTime(TimeToStr(dt, TIME_DATE)+" 10:00"); how do I set not today 10:00, but tomorrow 10:00? hint please!
 
kocunyc89 : there is a command t1=StrToTime(TimeToStr(dt, TIME_DATE)+" 10:00");how do I set not today 10:00 but tomorrow 10:00? datetime dt=TimeLocal();
datetime t1=StrToTime(TimeToStr(dt, TIME_DATE)+" 10:00") + 24*60*60;

Alert("Now = ",dt, " Tomorrow at 10:00 = ",t1);

 
LRA:
kocunyc89 : there is a command t1=StrToTime(TimeToStr(dt, TIME_DATE)+" 10:00");how do I set not today 10:00 but tomorrow 10:00? datetime dt=TimeLocal();
datetime t1=StrToTime(TimeToStr(dt, TIME_DATE)+" 10:00") + 24*60*60;

Alert("Now = ",dt, " Tomorrow at 10:00 = ",t1);

Thank you very much!
 
 if (Sob_01_0_1==1 && OrderSelect(ticket3_buy, SELECT_BY_TICKET)==true)
        {
         Alert("Sob_01_0_1=",Sob_01_0_1);
         Alert("здесь код перестает работать?"); 
                   
        if (OrderTakeProfit()>0 && OrderCloseTime()>0)
           {
           Alert("третий ордер на покупку закрыт, событие 011");
           bool close6=OrderClose(ticket3_sell, lot3, Ask, 20, clrRed);
                if (close6==true)
                   Alert("третий ордер на продажу закрыт");
                   else Alert("ошибка закрытия третьего ордера на продажу", GetLastError());
           bool close7=OrderClose(ticket2_sell, lot2, Ask, 20, clrRed);
                if (close7==true)
                   Alert("закрыт второй модифицированный ордер на продажу");
                   else Alert("ошибка закрытия второго модифицированного ордера на продажу ticket2_sell ", GetLastError());
               Sob_01_0_1++;
               Sob011++;
           }
         }
 
bobrush:
Good evening, can you tell me what the error is. Code stops working afterAlert("here code stops working?");. I.e. whenticket3_buy closeson profit, then the if statement is not executed.
 

Good evening all. Question from a dummy on iLowest and iHighest functions. In the beginning, I wanted to use these functions to find the high/low break in my EA and place a pending order. Everything works with iLowest but iHighest does not set orders. However, this is a word, since I have already solved this problem in a different way. I now have to delete a pending order if it was canceled to open it at a new price. I have tried to use the above functions again. There is no problem with iLowest and removing a pending buy order; I have problems with iHighest removing a sell order - the order is removed when a condition has not yet been met (price is below the maximum), a new order is placed, is removed again and so on. If the price has exceeded the maximum it is deleted and a new one is not executed but as soon as the current price has moved below the previous maximum the "scramble" starts again.

The conditions are written in the following way

if(iHighest(NULL, 0, MODE_HIGH, 70, 2) < iHigh(NULL, 0, 1)

{

DeleteOrders(OP_SELLSTOP, Magic);

}

if(iLowhest(NULL, 0, MODE_HIGH, 70, 2) > iLow(NULL, 0, 1)

{

DeleteOrders(OP_BUYSTOP, Magic);

}

(Delete function is written out separately). What am I doing wrong, what is the error?

 
Sorry for the inconvenience, everything has been resolved. I wrote the deletion condition in the EA slightly differently from what I wrote on the forum - there was no offset relative to the current bar.
 

Can you tell me why in testing the EA (100$ depot) the absolute drawdown (20$) differs from the values in the table of trades (minimum balance 85$), i.e. the difference is 5$.

The same with the maximum drawdown.

Maybe this 5$ is taken when the balance falls when the price moves in the direction of the stop loss and if so, is it possible to make the absolute/maximum drawdown reflected only according to the trades in the table?

p.s. I have clarified that on this forum(https://www.mql5.com/ru/forum/107382) drawdowns are calculated by equity, not by balance