Errors, bugs, questions - page 1258

 

By the way, who knows how to make that when you click on the button, it would be squeezed if the LKM is pressed and released if the LKM is released?

and what would press the button to click and release and what would release the button to click and release, nonsense)

ZS: of course you can change a property right after you release the LKM, but is that how it's done? )

 
sanyooooook:

By the way, who knows how to make that when you click on the button, it would be squeezed if the LKM is pressed and released if the LKM is released?

and what would press the button to click and release and what would release the button to click and release, nonsense)

ZS: of course you can change a property right after you release the LKM, but is that how it's done? )

Yes. You'll have to control the state of the objects yourself if you want to do it your way. )
 
tol64:
Yes. You'll have to control object's state yourself, if you want to do it your own way. )

all would be fine, but the button is not pressed when the LKM is pressed, and pressed only when the LKM is released, nonsense )

ZS: want to press the button? let it go )

But if you do otherwise, given thatOnChartEvent does not work in the tester, then in general, no way in the tester with the copies of copies can not work.

 
sanyooooook:

all would be fine, but the button is not pressed when the LKM is pressed, and pressed only when the LKM is released, nonsense )

ZS: want to press the button? let it go )

But if you do otherwise, given thatOnChartEvent does not work in the tester, then in general, no way in the tester with lops.

With the tester, many things don't work yet. Remains to write in servicedesk and then follow updates. )

And outside the tester, you have to write your own handlers for the controls to work the way you want them to.

 
sanyooooook:

all would be fine, but the button is not pressed when the LKM is pressed, and pressed only when the LKM is released, nonsense )

ZS: want to press the button? let it go )

But if you do otherwise, given that OnChartEvent does not work in the tester, then no way in the tester with copies of not work.

OnChartEvent() handles typical and user events. As far as custom events are concerned this handler in the Tester works!!! See my article Prescriptions in MQL5 - Handling Custom Chart EventsThere is a CustomEventProcessor robot there. It trades in the Tester.

Tester's trouble - it's graphics... I wrote earlier to Service Desk about graphics, so far only promises...



Рецепты MQL5 - обработка пользовательских событий графика
Рецепты MQL5 - обработка пользовательских событий графика
  • 2014.10.10
  • Dennis Kirichenko
  • www.mql5.com
В данной статье рассматриваются аспекты проектирования и разработки системы пользовательских событий графика в среде MQL5. Предлагается пример подхода для классификации событий. Приводится программный код событийного класса и класса-обработчика пользовательских событий.
 
denkir:

OnChartEvent() handles typical chart events and custom events. As far as custom events are concerned this handler in the Tester works!!! See my article Prescriptions in MQL5 - Handling Custom Chart EventsThere is a CustomEventProcessor robot there. It trades in the Tester.

The trouble with the tester is the graphics... I've written to Service Desk before about graphics, only promisesso far ...



Ok, thanks, I'll have a look, so far I've done it by checking the property of the button.
 

The situation is as follows: I create an OBJ_TEXT object on the chart. Then I manually delete this OBJ_TEXT from the chart. Then I try to find the deleted object on the chart and get an error (this is logical: the object was deleted, so it cannot be found). Then I try to move the anchor point of the deleted OBJ_TEXT object with ObjectMove, but get no error.

Question: should ObjectMove give an error when trying to move the anchor point of a deleted OBJ_TEXT?

 

Please advise who knows: when trying to display an indicator in the visualiser (tester), a 4014 error appears, although no such error occurs when running the same code in the terminal window.

The code is as follows:

            Indic_Handle[Indic_Total-1]=iMA(NULL,0,MA_Period,MA_Shift,MODE_LWMA,PRICE_CLOSE);

            if(Indic_Handle[Indic_Total-1]==INVALID_HANDLE)

              {Error_Message;return(false);}


            if(F_If_Indic_Exist(Indic_Handle[Indic_Total-1])==false) // Проверяем есть ли уже индикатор с таким хендлом. Если нет - добавлем новый индикатор

               if(ChartIndicatorAdd(0,0,Indic_Handle[Indic_Total-1])==false) 

                 {Error_Message;return(false);}


The "Error_Message" command is defined by a macro:

#define Error_Message_Exp Alert(__FILE__+": "+__FUNCTION__+": Error at line "+(string)__LINE__+". Last Error code: "+(string)GetLastError())


When executed in the terminal: The code works as it should, without errors. The indicator is plotted on the chart, the"Indic_Handle[Indic_Total-1]" variable is assigned a handle value.

But when executed in the tester and/or in the visualizer. An error is printed to the log:

2014.12.15 21:16:10 Core 1 2014.01.01 00:00:00   Alert: GA_Incl.mqh: F_Offspr_Init: Error at line 149. Last Error code: 4014

(line "149" - is the"{Error_Message;return(false);}" line under line "148":"if(ChartIndicatorAdd(0,0,Indic_Handle[Indic_Total-1])==false)".

The error obviously occurs when executing the "ChartIndicatorAdd" function which is executed differently in the tester environment and the terminal environment.

The decoding of the error code does not make it clear:

ERR_FUNCTION_NOT_ALLOWED

4014

The system function is not allowed to be called

On the forum I found a mention of this error occurring in the same situation by another user, but his question remains unanswered. (https://www.mql5.com/ru/forum/1111/page763#comment_208678)

I have found out that if I continue to run the program in the tester despite the error, the required indicator will be applied to the chart. But the indicator handle does not correspond to the value in theIndic_Handle[Indic_Total-1] variable.(But the indicator itself is created after some ticks, after calling the ChartIndicatorAdd command.

Please help me

Thank you.

Документация по MQL5: Операции с графиками / ChartIndicatorAdd
Документация по MQL5: Операции с графиками / ChartIndicatorAdd
  • www.mql5.com
Операции с графиками / ChartIndicatorAdd - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
methaqvot idi notification didn't come, I've been waiting for the second hour... Three hours ago it was working...
 
valeryk:

Right, it doesn't print. But it works. Try tracking the event with graphics.

It's not working for me. Clicking on an object in the tester doesn't trigger an event. On the demo/real - it works. What is wrong? (MT4)