[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 522

 
costy_ писал(а) >>

The cluster type?

It's crude but it'll do as an example, it's roughly from a landfill, so check it out.


Thank you, I will look into it.

 

How do I generate a random number?
For example: 1 to 5, including 1 and 5.

 
NTH >>:

Как сгенерировать случайное число?
Например: от 1 до 5, включая 1 и 5.

https://docs.mql4.com/ru/math/MathRand

e.g. 1+4*MathRand()/32767 or something like that.

 

OK, thanks :)

 
Hello! Can you please tell me how best to determine the maximum and minimum for a given time period, say from 13:00 to 18:00?
 
Here's my option, but it's not working for some reason:
int start()                                          
 { 
    int i, a; 
    while (TimeHour(Time[i])>=0)
     {
      i++;
     }
     Alert ( "i = ", i);
    while (TimeHour(Time[a])>=8)
     {
      a++;
     }
     Alert ( "a = ", a);

    double max = High[iHighest(NULL,0,MODE_HIGH,i,a)];
    Alert ("max =", High[iHighest(NULL,0,MODE_HIGH,i,a)]);
    double min = Low [iLowest (NULL,0,MODE_LOW,i,a) ];
    Alert ("min =", Low [iLowest (NULL,0,MODE_LOW,i,a) ]);
 }
 
sergey1302 >>:
Вот мой вариант, но он почему-то не работает:

Try the script, 13 to 18 hours inclusive.

   int start_hour=13;
   int end_hour=18;
   
   for( i=limit; i>=0; i--){
    if(TimeHour(Time[i])==end_hour+1&&TimeMinute(Time[i])==00){
    double max_index = iHighest(Symbol(),0,MODE_HIGH,(end_hour-start_hour+1)*60/Period(),iBarShift(Symbol(),0,Time[i])),
           min_index = iLowest(Symbol(),0,MODE_LOW,  (end_hour-start_hour+1)*60/Period(),iBarShift(Symbol(),0,Time[i]));
    double max = iHigh(Symbol(),0,max_index),
           min =iLow(Symbol(),0,min_index);
    string name_max = i,
           name_min = name_max+1;
    ObjectCreate(name_max,OBJ_ARROW,0,iTime(Symbol(),0,max_index),max);
    ObjectSet(name_max,OBJPROP_ARROWCODE,6);
    
    ObjectCreate(name_min,OBJ_ARROW,0,iTime(Symbol(),0,min_index),min);
    ObjectSet(name_min,OBJPROP_ARROWCODE,6);
    }
   } 
Files:
 
costy_ >>:

Попробуйте скрипт, с 13 по 18 час включительно.

Or this one, there are strong levels seen on frames < H4.

Files:
 
I am appealing primarily to those who really understand MQL5 and can help.
There are a few questions:

1. - How can I apply to price arrays in MQL5: Open,High,Close,Low; in mql4 it was quite simple, maybe in version 5 it is also simple, but I haven't found any examples of scripts that contain price calls.
2. - I need to use a two-dimensional array, but I tried to describe it in a structure, for some reason it doesn't work... I haven't even tried to open classes, but if it's possible to save and then successfully open some class, please advise how...

If someone can help with the code on these issues, please help. I would have figured it out myself, but unfortunately I am more used to learning from practice...

The task itself is very simple:
1. I need to manipulate the price (assign a variable to the value of the previous bar), it's highs or lows, but it doesn't matter.... but from the script.
2. We need to manipulate a two-dimensional array, for example, assigning all of its elements to 1, but it is important to save and read this array and preferably use a structure.

That's all I would like to know :).... probably dumb questions... But I will be grateful to everyone who can suggest something!

Thanks in advance ALL!!!
 

Question: who has this EA opening both Buy and Sell orders?
Or maybe I'm misunderstanding something, but I'm getting error 138.
https://www.mql5.com/ru/code/8177