[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 455

 

Good evening, I am wondering how to open orders at the opening price of a bar without paying attention to ticks. I understand that I have to change OrderSend(), but what should I change?

Help me understand :)

 
skyjet:

Good evening, I am wondering how to open orders at the opening price of a bar without paying attention to ticks. I understand that I have to change OrderSend(), but what should I change?

Help me understand :)

No, you only need to open orders when a new bar is formed. Add only a couple of lines to start()
 
splxgf:
No, it will be enough to open orders when a new bar is formed. Add only a couple of lines in start()
If you don't mind, could you please show me an example how it should look like ? :)
 
skyjet:
If you don't mind, could you show me an example of what it should look like ? :)

Something like:

datetime      Time_Handle               = 0;

start() {
      . . . 
      if(Time[i]!=Time_Handle) ) {
         Time_Handle                    = Time[i];

      . . . 
}}
 
else return;
to go along with it.
 
skyjet:
If you don't mind, could you show me an example how it should look like? :)
//глоб перем
static datetime prevtime = 0;       // по ценам открытия

int start()    // -----------------------СТАРТ ЭКСПЕРТА--------------- 
{ 
   if(Time[0] == prevtime)   return(0);  //ждем нового бара
   prevtime = Time[0];                   //если появился новый бар , включаемся 
// код эксперта

 return(0);    //  ВЫХОД ИЗ СТАРТ
}   


And for demo or real trading, you can insert the trawl function immediately after start() before this construct.

if(Time[0] == prevtime)   return(0);  //ждем нового бара
   prevtime = Time[0];                   //если появился новый бар , включаемся 
So that trawl is calculated and works on every tick, but not only on bar.
 
splxgf:
in addition.

:-)
 
skyjet:
If you don't mind, could you show me an example of what it should look like? :)

In fact, nobody cancelled the search - google "control opening of new bar" site:mql4.com. The result.
 
Связывает переменную-массив, объявленный на глобальном уровне, с предопределенным буфером пользовательского индикатора. 
Количество буферов, необходимых для расчета индикатора, задается с помощью функции IndicatorBuffers() и не может быть больше 8.

How to manage more than 8 clipboards in mql4 from one indicator, is there any way around this restriction?

Well, as an example, I need to build more than 8 indicator lines, but from one program.

 
fore-x:

How to manage more than 8 clipboards in mql4 from one indicator, is there any way around this restriction?

Well, as an example, I need to build more than 8 indicator lines, but from one program.

Trend lines.

Reason: