[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 88

 

Good afternoon, everyone.

I have an interesting question.

Tell me, who knows or may be faced with, when the account is registered in MT4 the Trader's Name and Account No. are written on the left side.

I am wondering whether or not I can change the details entered in the account while I am using it. I need to change the entered NAME.

I will thank you in advance for your reply.

 
Hi all! Can you tell me if it's possible to implement price change speed function in mql4? For example, if price changes faster than 30 pips per second, then do not open a deal (for an EA)... If you can, tell me the code... thanks
 
artmedia70:
В той функции идёт перебор ордеров для поиска последнего закрытого по тейку. Переработайте эту функцию для ускорения. Они у Кима все универсальные - значит от-туда можно много лишнего поубирать. Опять-таки, всё зависит от логики вашего эксперта.

borilunad:
Thanks a lot! Was thinking maybe some operator to use, but they don't go over cases with "or" for the same action.

Artyom, sorry to bother you! What and how else can I remove from the function? I'm only interested in the last position, closed on the take!

I've commented out everything that's not needed, but it's still crawling and dragging... :((

//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 19.05.2008                                                     |
//|  Описание : Возвращает флаг закрытия последней позиции по тейку.           |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента   (""   - любой символ,                   |
//|                                     NULL - текущий символ)                 |
//|    op - операция                   (-1   - любая позиция)                  |
//|    mn - MagicNumber                (-1   - любой магик)                    |
//+----------------------------------------------------------------------------+
//bool isCloseLastPosByTake(string sy="", int op=-1, int mn=-1) {
bool isCloseLastPosByTake() {//int op=-1) {//, int mn=0) {//string sy="", 
  datetime t;
  double   ocp, otp;
  int      dg, i, j=-1, k=OrdersHistoryTotal();

//  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
//      if (OrderSymbol()==sy || sy=="") {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
//          if (op<0 || OrderType()==op) {
//            if (mn<0 || OrderMagicNumber()==mn) {
              if (t<OrderCloseTime()) {
                t=OrderCloseTime();
                j=i;
              }
//            }
//          }
        }
//      }
    }
  }
  if (OrderSelect(j, SELECT_BY_POS, MODE_HISTORY)) {
//    dg=MarketInfo(sy, MODE_DIGITS);
//    if (dg==0) if (StringFind(OrderSymbol(), "JPY")<0) dg=5; else dg=3;
    ocp=NormalizeDouble(OrderClosePrice(), 5);//dg);
    otp=NormalizeDouble(OrderTakeProfit(), 5);//dg);
    if (ocp==otp) return(True);
  }
  return(False);
}
 

Good evening! Happy holidays to all!

I had my pending orders deleted in the tester, it can be seen in the results, however, the log says ERR_INVALID_TICKET 4108 Invalid Ticket Number

Should I ignore this or better deal with the situation?

 
bugorok:
Hi all! Can you tell me if it is possible to implement rate function in mql4? For example, if price changes faster than 30 pips per second, then do not open a deal (for an EA)... If you can, tell me the code... thanks

Try looking at the code of this EA, it has something similar implemented.

https://www.mql5.com/ru/code

extern int     KolSec =  4;  //количество секунд, между измерениями скорости цены
extern int     Punkts = 28;  //количество пунктов, которые цена проходит за это время

 //ЗАКРЫТИЕ ПОЗИЦИИ, ЕСЛИ ЦЕНА ДЕЛАЕТ РЕЗКИЙ РЫВОК ПРОТИВ НЕЕ
   //-------------------------------------------------------------
 
Dimka-novitsek:

Good evening! Happy holidays to all!

I had my pending orders deleted in the tester, it can be seen in the results, however, the log says ERR_INVALID_TICKET 4108 Invalid Ticket Number

Should I ignore this or better deal with the situation?


You'd better handle it. Maybe, your Expert Advisor has tried to delete not only the pending ones, but the ones already opened? Before deleting, insert Print("I want to delete an order with ticket=",OrderTicket()," OrderType=",OrderType()); For pending OrderType from 2 to 5. For open ones from 0 to 1.https://docs.mql4.com/ru/constants/trading
 
BeerGod, thanks for the tip!!!
 
Thank you!!!!
 
Dimka-novitsek:
Thank you!!!!

Is there a bushwhacker/no bushwhacker in the tanks? :-)
 
I don't know much about tanks, what it's like. The oldest is Misha - my brother - he's a fan of the game.