Questions about MQL4.

 
Slawa 08.11.05 17:51 <br / translate="no">.
Is it acceptable to use theMessageBox() function in indicators according to MQ4 rules ?
no. And GetLastError will return the corresponding error
Is it acceptable to use the MessageBox() function in deinit()?

There is a need to tell the user some information when he closes the EA. And trigger events depending on their responses. How to do it?
 
deinit runs for 2.5 seconds - should the user respond that quickly? =)
You can write to a file what needs to be done, and then script to read, display MessageBox and, depending on the response, do something about it.
It's not quite clear what you need to do. And why?
 
komposter,
you have to...
Well, in 2 words.
First, deinit() doesn't run for 2.5 seconds, it runs indefinitely. At least in my script.
Secondly, this whole kitchen is only needed to handle object coordinates between ticks. For this reason it makes no sense to put processing code in Start, because it starts tickwise, i.e. it will work only once and will idle for the rest of the time.

After that, the problems begin and the programming becomes a creative activity, because (well, I don't know why) Slip does not work in indicators, MB is prohibited, etc. etc. It seems to be just a matter of time before we start working on it. However, in some cases my loops only consist of GlobalBar calls and my code must not be started until some conditions are met. Without a slip these loops would just freeze Traida...

And since I want to do everything well, I have to spend money on ornate solutions.
Apparently, you won't get really good, but like in Microsoft - "good enough" (it's their slogan).
And then there are pictures on the web with Microsoft's image of a keyboard with 3 keys: Ctrl, Alt and Del.

We'd better be guided by Linux...:)
 
So make it an infinite loop at the start - what difference does it make "where" if you don't care about the ticks?
 
I have this cycle in the indicator and nowhere else can be used.
This is due to the fact that in the script the trade functions are allowed, there are also their own loops, and there is no place in them for secondary (but also necessary) tasks. But the script is allowed only one. Therefore, we have to split the solution into:
1 expert, 1 script and (so far) 2 indicators.
And these indicators have their own cycles of chart processing between ticks too.
Besides, I can't unload from start. If I have only inyte and deinit in indices, then it's enough to exit the loop, and they will unload from window - they react on some event, for example, unloading of EA.
It's a pity, they cannot be loaded.

But never mind. I'll do it anyway:) I will just have to make some trouble.
 
SKif:
This is due to the fact that trade functions are allowed in the script, it also has its own loops, and there is no place for secondary (but also necessary) tasks.
Why not? If it already works in "infinite" mode, insert a couple of lines into already created loop, and if your script is "one-off", make another one that catches object movements.
Or do you have a principle question of quantity?)))
 
Why not a place? Because there is a lot of information to process. While the cycles are almost empty, between ticks I manage to scroll through them mostly 10 to 200 times, but in short intervals - 2 to 3 times each. And the information will be added - I'm afraid to go beyond the intertick interval.
 
Why depend on them between ticks? Why depend on them at all?
It's a bit complicated, I won't get into it....You'll figure it out ;)
 
О! (186)). (186)
 
Why between ticks
?!) You'll tell me why later. I do have difficulty, but that's nonsense. The main thing is the result:)
How's it going for you?
 
How's it going for you?
Expert here, expert there... going a bit ;)
Reason: