Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 824

 
Lomonosov1991:
Thanks to Igor Makan. I made the function yesterday so the function the day before yesterday I made it so Can I make it not reset to zero on weekends? i.e. Monday yesterday was Friday for it. i.e. how do I get rid of weekends?

use bar open time on D1 timeframe

datetime d1 =  iTime(NULL,PERIOD_D1,1);  //один торговый день назад (вчера)
datetime d2 =  iTime(NULL,PERIOD_D1,2);  //два торговых дня назад (позавчера)
.....

you can define the day of the week using TimeDayOfWeek()

You can also "collect / parse" datetime using StructToTime() and TimeToStruct()

 
Hello. What is wrong?
   for(int i=limit; i>=0; i--)
     {
      if(
         close[i+1]<iLow(NULL,PERIOD_CURRENT,iLowest(NULL,PERIOD_CURRENT,MODE_LOW,10,2))
         )
        {
         BufferUP[i+1]=low[i+1];
        }
     }
The condition is that the first candle closed below the low of the 10 candles, but the candles closed above the low and puts the arrows.
 
!
 
Ghabo:
Hello. What is wrong? The condition is that the first candle closed below the low of the 10 candles, but the candle closed above the low and puts the arrows.
iLow[iLowest(NULL,0,MODE_LOW,period,2)] так правильнее написать

NULL - symbol

0 - current timeframe

period - number of bars

2 - 1st bar (if 1, it is the current bar)

https://www.mql5.com/ru/docs/series/ilowest
Документация по MQL5: Доступ к таймсериям и индикаторам / iLowest
Документация по MQL5: Доступ к таймсериям и индикаторам / iLowest
  • www.mql5.com
[in]  Индекс (смещение относительно текущего бара) начального бара, с которого начинается поиск наименьшего значения. Отрицательные значения игнорируются и заменяются нулевым значением. Индекс наименьшего найденного...
 
Sergey Nikolenko:

NULL - symbol

0 - current timeframe

period - number of bars

2 - 1st bar (if 1, it is the current bar)

https://www.mql5.com/ru/docs/series/ilowest
iLow[iLowest(NULL,0,MODE_LOW,period,2)] так правильнее написать

it is not correct


correct

Low[iLowest(NULL,0,MODE_LOW,period,2)]
 

Thank you Igor)

How do I write in Russian where the variables are? To write notStopNewOrder but"Drawdown to stop trades"

extern double StopNewOrder = 10;//"Просадка для остановки торгов"
 
Lomonosov1991:

Thank you Igor)

How do I write in Russian where the variables are? To write notStopNewOrder but"Drawdown to stop trades"

input double StopNewOrder = 10;//Просадка для остановки торгов
 
Igor Makanu:
I heard that it works in MQL5. It doesn't work on MQL4.
 
Lomonosov1991:
I heard that it works in MQL5. It does not work on MQL4.

works, you can experiment with this script:

#property copyright "IgorM"
#property link      "https://www.mql5.com/ru/users/igorm"
#property version   "1.00"
#property strict
#property  show_inputs

enum ENUM_TST{param1/*один*/,param2/*два*/,param3/*три*/};
input ENUM_TST    inp1  = param1;
input double      inp2  = 20.0;//Мой параметр
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
  }
 
Alekseu Fedotov:

That's not right.


That's right.

Isn't your version and what I have written the same?

         close[i+1]<iLow(NULL,PERIOD_CURRENT,iLowest(NULL,PERIOD_CURRENT,MODE_LOW,10,2))//БЫЛО
         close[i+1] <Low[iLowest(NULL,0,MODE_LOW,10,2)]//СТАЛО

In any case, nothing has changed on the graph.

Reason: