Errors, bugs, questions - page 606

 
uncleVic:
It's not really clear why? After all, if your program deleted an object, it knows about it. But if the object is removed and the program doesn't even know about it, it is the Terminal's fault.

it's not that simple (it's a pity it's disappeared from the service desk, I'll try to reintroduce the problem).

We need to handle the situation when a user accidentally deletes an object from the chart. But this object shouldn't be deleted. For example it's the substrate of a list or a dropdown menu.

So in the OnChartEvent code I need to handle this event and redraw the control.

So I have to delete all other objects in this control. I think I don't need to explain why I should delete all top objects of this control.

So it turns out that processing this event the algorithm gets in a deep loop. The script will delete objects and get the event that the objects were deleted and it means that this event must be processed again - remove and render... In short, algorithmic mess.

I don't know how to fix it within current CHARTEVENT set. That's why I suggest, that the script understands - whose removal it was - by terminal (by sly user) or by script itself (by the same programmer).

You would have to deal with it yourself sooner or later, when you start actively working with controls.

 
sergeev:

it's not that simple (it's a pity it's disappeared from the service desk, I'll try to find out the problem again).

I don't know how to solve this situation within current CHARTEVENT set. That's why I suggest, that the script should understand - who deleted it - by terminal (by sly user) or by script itself (by same programmer).

You would have faced this sooner or later, when you start actively working with the controls.

I have encountered it myself. In one of the first versions of the Art Library (in terms of controls) this mechanism was implemented, but for certain reasons it was removed (I do plan to restore it later).

There's nothing clever about it. Every controller should be able to restore itself. The substrate, when deleted, removes everything that lies on it. The restoring is done by events.

 
uncleVic:


There's nothing clever about it. Every controller needs to be able to repair itself. The substrate, when deleted, deletes everything on it. Then the restoration is done by events.

Well, that's what I'm saying, that when a deletion event is received, the control restores itself.

But as soon as control restores itself (deletes upper objects) it will start deleting events again.

Anyway, why do I bother proving the obvious again :)) When your company needed mouse movement event for development of the standard library, they added it on the fly and without unnecessary questions. The practice of double standards turns out....
But I think that if this same proposal was sent by user to Service Desk, they would haul him for another month to find out why they needed it.

Believe me, it's needed! I have already written in Service Desk that we do not try to promote MT5 and MQL5, but we do it for our own benefit.

We honestly pass all ways to find quick and compact solutions for our tasks in MQL. If we face an obstacle, we always write to Service Desk. But we do not always meet any understanding there.

As I wrote above, I'm very glad that you are making the control library yourself. You can at least have a little glimpse of all our problems that must be solved without any understanding on your part.

PS.
Victor, sorry, that so severely, just a pain in the neck.
I would just ask your company to listen to the requests of MQL programmers. After all, we solve much more various tasks in MQL than you can imagine. Sometimes I just want to hear the answer in the Service Desk: yes, we will do it in the next build.

Thank you for your understanding.

 

sergeev:

... when your company needed a mouse move event ...

If you knew how much I had to break my fists over "adult" programmers to do it...
 
At the risk of sounding unoriginal, but still... Ladies and gentlemen - when will the market open? Does anyone know at least a rough timeline?
 
uncleVic:
If you knew how much I had to break my fists over "adult" programmers to do it...
Victor, you and I are in the same boat :)) let'sbe together.
 

I am trying to open a long position based on the script for a symbol where exchange execution is implemented ( SYMBOL_TRADE_EXECUTION_EXCHANGE, Exchange execution).

#include <Trade\Trade.mqh>                   
input double InpLots          =0.1;  
input int    InpTakeProfit    =500;
input int    InpSL            =300;
CTrade       myTrade;

void OnStart()
  {   
   double price=SymbolInfoDouble(_Symbol,SYMBOL_ASK);
   double tp=SymbolInfoDouble(_Symbol,SYMBOL_BID)+InpTakeProfit*_Point;
   double sl=SymbolInfoDouble(_Symbol,SYMBOL_BID)-InpSL*_Point;
   myTrade.SetTypeFilling(ORDER_FILLING_IOC);
   myTrade.PositionOpen(_Symbol,ORDER_TYPE_BUY,InpLots,price,0,0,"Test Buy");
   Sleep(500); // интервал задержки
   myTrade.PositionModify(_Symbol,sl,tp);
  }

I get an error:

  • exchange buy 0.10 EURUSD.e at 0.00000;
  • failed exchange buy 0.10 EURUSD.e at 0.00000 [Invalid stops].

I.e. the terminal does not see the price I want to buy at. I tried different prices but still received 0.00000.

I tried a similar script running in MT4 with the same exchange conditions, it worked there... Not in MT5...

Please point the nose at the error.

 
denkir:
  • failed exchange buy 0.10 EURUSD.e at 0.00000 [Invalid stops].

This is a server message, not a terminal message. I have nothing more to say on this subject.

Submit a request to the Service Desk.

Общайтесь с разработчиками через Сервисдеск!
Общайтесь с разработчиками через Сервисдеск!
  • www.mql5.com
Ваше сообщение сразу станет доступно нашим отделам тестирования, технической поддержки и разработчикам торговой платформы.
 
papaklass:

Why does an array overflow error occur?

Well, you usually write something to it before you read it...
 
papaklass:

Why does an array overflow error occur?


And where do you have the ArrayResize call?
Документация по MQL5: Операции с массивами / ArrayResize
Документация по MQL5: Операции с массивами / ArrayResize
  • www.mql5.com
Операции с массивами / ArrayResize - Документация по MQL5
Reason: