[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 63

 

Can this code be written in a couple of lines here? (I don't know much about programming.) So what should be written instead of


int ticket = -1;
int total = OrdersTotal();
for (int i = total - 1; i >= 0; i--)

in each Expert Advisor.

 
int ticket = -1;
for (int i = OrdersTotal() - 1; i >= 0; i--)
 
keekkenen >> :
int ticket = -1;
for (int i = OrdersTotal() - 1; i >= 0; i--)

And this will fix the problem - "There are 3 Expert Advisors on different pairs, but only one of them trades (all have different mages)... What should be changed in EA code to make them trade all....(and at the same time 1 EA does not open multiple orders)" ????

 

filter out

//+------------------------------------------------------------------+
//| Подсчитывает количество открытых ордеров согласно условиям       |
//+------------------------------------------------------------------+
int CountOpOrd(string Sy="",int Typ=-1,int Magik=-1){int count=0;
  for(int i=0; i<OrdersTotal(); i++){
    if(OrderSelect( i, SELECT_BY_POS, MODE_TRADES)){
      if(OrderSymbol()== Sy|| Sy==""){
        if(OrderType()== Typ|| Typ==(-1)){
          if(OrderMagicNumber()== Magik|| Magik==(-1)){
            count++;
          }
        }
      }
    }
  }
return( count);  
}
 

With this code, won't the robots with different mages interfere with each other?

int ticket = -1;
int total = OrdersTotal();
for (int i = total - 1; i >= 0; i--) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if ((OrderSymbol() == Symbol()) && (OrderMagicNumber() == magic)) {
int prevticket = OrderTicket();
if (OrderType() == OP_BUY) {

 

Good afternoon and good evening to some.

Not by choice but by force of His Majesty Forex , I ask you.

I read the article about the tester, but I don't want to punish you. I want to know when iCustom() is used in the Strategy Tester and when it peeks into the future. I have a trading strategy that takes into account the older and the younger timeframes so I have some doubt that iCustom() will return the already formed value of the older timeframe on bar 0, it only applies to one currency pair .

That iCustom() is peeking into the future from the next currency pair, about that I have heard.

And another thing, I really want to write an optimizer within the optimizer, at least a simple one based on opening prices . There sure iCustom() on n bar will return the generated value from the higher timeframe, which will lead to a peek. If someone has faced with such a situation please direct in the right direction for further creative research. I humbly accept any kind of slap on the wrist.

 
Tomas65 писал(а) >>

Hello, dear programmers! Please add signals to the two indicators.

This thread is for newbies questions, not for signal add-ons.

 
Can you please tell me how to organize in an indicator to check that the code is executed only once during a bar and only immediately after the arrival of the FIRST quote of the bar?
 

Gentlemen, please advise a newcomer! I downloaded the tutorial MQl4BookRussian.chm (author Sergey Kovalev), the problem is that printing from this format is very messy. Probyby copied this text to doc format, images disappear. Can you advise whether this tutorial is in a format suitable for printing (read it from the monitor - my eyes get tired)?

 
Can you please advise how to make an EA open an order for several symbols at once? Thank you in advance!
Reason: