Errors, bugs, questions - page 2218

 
fellow:

what are those numbers in inverted commas?

probably the value of the field

 
Georgiy Merts:

Exactly.

In my opinion, all structural parts of programs should be made into platform-independent blocks (virtual interfaces, in my opinion, are very suitable for this), so that changes in platforms affect small isolated areas of code. Plus there's the bonus of being able to plug in new platforms.

As for the new i-Functions, I'm only looking at one - search for a bar by a specified time. Perhaps this function will work faster than mine. The rest - I'm sure - will not give an increase in speed compared to mine, which means one doesn't look for the good from the bad.

I wrote my own library on bars a long time ago and am unlikely to use the innovations

 
Alexey Volchanskiy:

I wrote my own library for bars long ago and am unlikely to use innovations

The native search for bar by time may be really faster.

Now it is limited as calculation of the required bar index by the time of the first bar, the last bar, and the required time, with subsequent correction.

I used to use binary search as well, but the direct calculation with correction - turned out to be faster.

And developers may have an index that finds the right bar much faster than both of these options.

 
fellow:

what are those numbers in quotes?

a string is a uchar array

In inverted commas there is a character and to the left of the inverted commas there is a character code.


more precisely :

void OnStart()
  {
   string s;
   uchar u[1];
   for(int i=32; i<=255; i++)
     {
      u[0]=(uchar)i;
      if(i%16==0) s="";
      s+=IntegerToString(u[0],3)+"-"+CharArrayToString(u)+"  ";
      if (i==152) s+=" ";
      if(i%16==15)  Print(s);
     }
  }
 

who updated to 1860, do you confirm the problem indicated earlier by several users during testing?

because this is the second time Otkritie broker has sent this update ))

 
Vitaly Muzichenko:

If you use free software, then keep it up to date, and if there are ads in the future, that's fine too (free software). Nobody owes you anything.

The software is not free - it costs the broker a lot of money. I, as a trader, pay the broker a commission, from which the developers are paid. I am a trader and I want to be treated appropriately.

I don't care about the functions (the hell with them - I rewrote them), but the tester started glitching and crashing every 2-3 runs, you could have uploaded a stable version

 
At the very least, take the fact that in 10 years they never taught the software how to correctly calculate drawdowns. I had to write everything myself
 
// Воспроизведение ситуации, когда OrderSend успешно выполнилась, но ордера нет ни среди живых, ни среди мертвых.

#define Bid SymbolInfoDouble(_Symbol, SYMBOL_BID)
#define  PRINT(A) Print(#A + " = " + (string)(A))

void OnStart()
{
/*
  // Посылаем поочередно ордера на открытие/закрытие позиций
  while (!IsStopped() &&
         (OrderSend(_Symbol, OP_SELL, 1, Bid, 0, 0, 0) != -1) &&
         OrderSelect(0, SELECT_BY_POS) && OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 0))
    ;
*/

  MqlTradeResult Result;
  MqlTradeRequest Request = {0};

  Request.action = TRADE_ACTION_DEAL;
  Request.symbol = _Symbol;
  
  do
  {
    Request.position = PositionSelect(Request.symbol) ? PositionGetInteger(POSITION_TICKET) : 0;  
    Request.type = Request.position ? (ENUM_ORDER_TYPE)(1 - PositionGetInteger(POSITION_TYPE)) : ORDER_TYPE_SELL;
    Request.price = Request.position ? PositionGetDouble(POSITION_PRICE_CURRENT) : Bid;
    Request.volume = Request.position ? PositionGetDouble(POSITION_VOLUME) : 1;
          
  } // Посылаем поочередно ордера на открытие/закрытие позиций
  while (!IsStopped() && (OrderSend(Request, Result) ? OrderSelect(Result.order) || HistoryOrderSelect(Result.order) : true));
  
  PRINT(Result.order);
  PRINT(OrderSelect(Result.order));
  PRINT(HistoryOrderSelect(Result.order));
}


Result onForexTimeFXTM-Demo01

Result.order = 2210942086
OrderSelect(Result.order) = false
HistoryOrderSelect(Result.order) = false


The script opens and closes positions until it detects a "phantom order" - neither among the current ones nor in the history. Should I consider it a bug or a platform feature?


The script is written in such a way that several positions may open because of this nuance. But it does not prevent a "phantom order" from being received.

Особенности языка mql5, тонкости и приёмы работы
Особенности языка mql5, тонкости и приёмы работы
  • 2018.02.08
  • www.mql5.com
В данной теме будут обсуждаться недокументированные приёмы работы с языком mql5, примеры решения тех, или иных задач...
 
It was the same at BCS forex a year ago, after the dc switched something in its advisor
 

Hello. Today I updated to version 1860 and while optimising the Expert Advisor I encountered this problem:

Delay in optimisation

The delay between passes is 1 minute! Can you please advise what may be the problem?

p.s. Before the update everything was working like clockwork.

Reason: