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

 
novichok2018:

Hello, dear forum members. Can you tell me what I need to do so that the t1 ticket is not redrawn when opening a position under the same conditions. So that when the condition to close these (but not other) positions comes, both (or maybe more)
tickets are read. So far, only the last ticket is read and the closing loop ignores the first ticket. The loop seems to be built correctly:

It makes sense to use SELECT_BY_TICKET instead of the loop and SELECT_BY_POS - then the required order will be exactly chosen. And to control Alert(fabs(WPR0));

 
novichok2018:

Hello, dear forum members. Can you advise what needs to be done to ensure that the t1 ticket is not redrawn when a position is opened under the same conditions. So that when a condition to close these (but not other) positions occurs, both (or possibly more)


ticket. So far only the last ticket is read and the closing loop ignores the first one. The loop seems to be built correctly:


I seem to have found it myself - removedt1 from the loop.

 
STARIJ:

It makes sense to use SELECT_BY_TICKET instead of the loop and SELECT_BY_POS - then the required order will be exactly selected. And to control Alert(fabs(WPR0));


What is fabs?

 
novichok2018: What is fabs?

Put the cursor on this word in MetaEditor and press F1 - you will be pleasantly surprised...

 
STARIJ:

Put the cursor on this word in MetaEditor and press F1 - you will be pleasantly surprised...


Thank you. Done. It was not pleasant - it is easier and clearer for me to useMathAbs(). :)

 
STARIJ:

Put cursor on this word in MetaEditor and press F1 - you will be pleasantly surprised...


Can you please explain how I can useSELECT_BY_TICKET without loop and how to close the found ticket by condition exclusively for it? I'm not getting anything out of it. Some open positions are closed correctly, while others are closed not at the right moment but much earlier at seemingly identical conditions.

 
Artyom Trishkin:

What moose?

Can we not use jargon? It's not like we're at school at recess discussing who has the cooler "adics", "yo"...

http://stocks.investfunds.ru/enc/37/

«Быки», «медведи», «лоси». Как не путаться в биржевом сленге. Рынок акций, покупка и продажа акций, котировки акций, брокеры и брокерское обслуживание | Stocks.investfunds.ru
  • Об авторе
  • stocks.investfunds.ru
Российский биржевой сленг богат и разнообразен. В «увлекательной зоологии фондового рынка» наиболее значимы следующие экземпляры.  «Бык» - традиционное название трейдера, покупающего ценные бумаги в расчете на рост их курсовой стоимости. Соответственно, «бычьим» называют такой рынок, на котором наблюдается тенденция роста цен.  Дерущиеся быки...
 

You think I'm not familiar with all this?

I just don't understand, if you ask somewhere about the RF Criminal Code, will you be speaking in a foreign language?

 
Alexey Viktorov:

Something here is piled on top of both mql4 and mql5...

In what language do we need to get the value?


on the previous one, and what's here from mql4? function OnTick()?

 

wrote this code.

 void zakritj_vse_sdelki()
 {
 bool pr;
 for (int i=OrdersTotal()-1; i>=0; i--)       
   {                                        
   if(OrderSelect(i,SELECT_BY_POS)==true)
      {   
         if (OrderType()==OP_BUY)    pr=OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(),MODE_BID), 30 );                              
         if (OrderType()==OP_SELL)   pr=OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(),MODE_ASK), 30 );
         
         if (pr==false) Print("закрытие ордера ", OrderSymbol() ," завершилось с ошибкой #",GetLastError());
         if (pr==true) Print("ордер ", OrderSymbol() , " ЗАКРЫТ");
       }
    }
  }  

the meta-editor mumbles.



Why does it mate?


#property strict