Features of the mql5 language, subtleties and tricks - page 281

 
 if ((EMA50[i] < EMA50[i+ 1 ] && EMA50[i+ 1 ] < EMA50[i+ 2 ] && EMA50[i+ 2 ] < EMA50[i+ 3 ] && EMA50[i+ 3 ] < EMA50[i+ 4 ])
      &&(EMA90[i] < EMA90[i+ 1 ] && EMA90[i+ 1 ] < EMA90[i+ 2 ] && EMA90[i+ 2 ] < EMA90[i+ 3 ] && && EMA90[i+ 3 ] < EMA90[i+ 4 ])
       &&(EMA90[i] > EMA50[i] && EMA90[i+ 1 ] > EMA50[i+ 1 ] && EMA90[i+ 2 ] > EMA50[i+ 2 ] && EMA90[i+ 3 ] > EMA50[i+ 3 ] && EMA90[i+ 4 ] > EMA50[i+ 4 ]))

Can someone please help me.

The EMA50 and EMA90 indicators have been dropping for a long period of time. How can you programme this more intelligently and add EMA slope?


 
Alexander Piechotta # :

Quelqu'un peut-il m'aider s'il vous plaît ?

Les indicateurs EMA50 et EMA90 sont en baisse depuis longtemps. Comment pouvez-vous programmer cela de manière plus intelligente et ajouter une pente EMA ?


Alexander Piechotta # :

Can someone please help me.

The EMA50 and EMA90 indicators have been dropping for a long period of time. How can you programme this more intelligently and add EMA slope?


The MACD will have a close result without developing anything

 

Forum on trading, automated trading systems and testing trading strategies

Libraries: MT4Orders

fxsaber, 2024.12.22 19:50

A clear example that frequent work with arrays should be done wisely. In this case static allows not to allocate memory for an array in ArrayCopy every time. And we get a multiple performance increase in the real task, which can be felt with the naked eye.

 
fxsaber #:

The performance gain will be noticeable when working with large/huge arrays. For small arrays, the 'static' keyword does not provide any benefit.

 
amrali #:

The performance gain will be noticeable when working with large/huge arrays. For small arrays, the 'static' keyword does not provide any advantages.

In tests it may do, you should check it.

and you need to look at multicharacters, it is the main nuisance, multiply everything by the number of characters.

 
HistorySelectByPosition can create tables of thousands of items.
void OnStart()
{  
  if (HistorySelectByPosition(35466210))
    Print(HistoryOrdersTotal()); // 27507
}
 
fxsaber HistorySelectByPosition can create tables with thousands of items.

Where does this position ID come from? Is it from a torch or real?

 
Alexey Viktorov #:

Where does this position ID come from? Is it from a torch or is it real?

Yes, this is real data. Thousands of orders are TP re-jacks of only one position with such ID.

 
I noticed that the compiler does not swear at such a construction.
class A {};

void OnStart()
{
  A a;
  
  a = &a; // Полное копирование объекта по указателю в объект.
}

Of course, it is not a conversion of a pointer into an object, but in some situations such a construction is reasonable for speeding up.

 
fxsaber #:

Yes, this is real data. Thousands of orders are TP redirects of only one position with such ID.

Then what is unusual, special?