background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "Hacking mql4 to Make a Message Box In An Indicator"

input logo icon
Video tags
|

Video tags

computer
course
forex
forex trading
jimdandy
learn
learnmql4.com
lesson
lessons
metaeditor
metaquotes
metatrader
mq4
mql4
programming
trader
trading
tutorial
coding
education
indicators
mql4 programming tutorial
mt4
hacking
messageboxw
messagebox
user32.dll
WinUser32
WindowHandle
hacking mql4
make a messagebox
messagebox in an indicator
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:00
hello everybody welcome to this Saturday
00:00:03
session brought to you by the Learning
00:00:05
ql4 school and learning QL 4.com if you
00:00:08
would like to download this video and
00:00:09
the file that were about the right then
00:00:12
by all means subscribe to the YouTube
00:00:14
video archives there you can download
00:00:16
all of our tech tip Tuesdays and
00:00:18
Saturdays sessions subscription is $5 a
00:00:21
month okay so let's talk about the issue
00:00:24
that we are facing when trying to make a
00:00:28
message box work in a custom indicator
00:00:31
normally it will not because as they say
00:00:36
in their MQL for reference the function
00:00:39
can't be called from custom indicators
00:00:41
because indicators are executed in the
00:00:43
interface thread it shouldn't slow it
00:00:45
down so I'm not exactly sure exactly
00:00:48
what that means but all I know is it
00:00:50
means message box does not work in a
00:00:53
custom indicator it'll work in the
00:00:54
script it will work in an expert advisor
00:00:56
but not in a custom indicator unless you
00:01:00
do what we're about to do so if you want
00:01:03
to know how to make a message box work
00:01:05
in a custom indicator stay tuned
00:01:09
jim-dandy presents Saturday sessions
00:01:11
brought to you by learning QL for comm
00:01:13
videos all about MQL for coding and
00:01:16
trading Forex
00:01:22
or get started let me say thank you to
00:01:24
my patreon patrons who make this
00:01:26
possible for you guys to watch what
00:01:31
we're looking at here is code that I
00:01:32
have written in an indicator and you can
00:01:36
see that what it says here is if the
00:01:40
period is not equal to the four-hour
00:01:42
period in other words if someone drops
00:01:44
this indicator on to something other
00:01:47
than a four-hour chart it is programmed
00:01:51
here to pop up a message box that says
00:01:53
this only works on the four hour time
00:01:55
frame and then there is a new line that
00:01:59
says change to the four hour time frame
00:02:01
and reload and the caption of the
00:02:06
message box would read that it cannot
00:02:08
initialize now as I mentioned this will
00:02:12
not work in a custom indicator you could
00:02:15
put this exact same code in a script or
00:02:17
any expert advisor and it would work but
00:02:19
not in a custom indicator let me show
00:02:21
you what it does if we were to drop this
00:02:24
indicator on a on a one-hour chart
00:02:27
first of all I'll switch to the 4-hour
00:02:29
chart and we drop it on the chart
00:02:32
everything's okay and you can see it
00:02:35
says that it initialized and if we look
00:02:38
on our chart indeed we do have the
00:02:40
message box test the message box test
00:02:42
indicator running but if we were to
00:02:46
delete this off of the chart and drop it
00:02:52
on a one-hour chart let's say let me
00:02:55
clear this out down here we drop this on
00:02:59
here everything looks the same we drop
00:03:02
it on there and without explanation it
00:03:05
is removed it simply says initialization
00:03:08
failed if we tried to do it again on a
00:03:12
4-hour chart it works just fine
00:03:15
but if we were to change timeframes it
00:03:20
removes our indicator without
00:03:21
explanation so what we're going to do is
00:03:25
make it to where during the
00:03:27
initialization phase of an indicator and
00:03:30
that's what's important here you don't
00:03:32
want message box
00:03:33
just popping up while an indicator after
00:03:36
it's loaded on the chart while it's
00:03:37
running
00:03:38
because as it said it will bring things
00:03:40
to a halt it will stop your interface
00:03:44
your mql for interface from running
00:03:47
while that message box is open so you
00:03:49
don't want to do it after the indicator
00:03:52
is loaded however we're doing it before
00:03:54
the indicator loads we're doing it
00:03:56
during the initialization phase and if
00:03:59
it is not on the proper time frame it
00:04:02
will jump out of initialization it will
00:04:04
say initialization failed so how do we
00:04:07
accomplish this well what we're going to
00:04:10
do is instead of using meta traders
00:04:12
built-in message box function we're
00:04:15
going to use windows built-in message
00:04:17
box function and in order to do that
00:04:20
we're going to have to import or rather
00:04:23
include a file if you look over here in
00:04:26
the files in the include folder you will
00:04:29
see one called when user 32 dot mqh and
00:04:34
this is a file let me open it up so that
00:04:36
you can see it this is a file that
00:04:38
imports a Windows dll file called user
00:04:43
32 DLL and these are all of the
00:04:46
functions that that DLL contains the one
00:04:50
that we are going to use is message box
00:04:55
W right there that's the one that we're
00:04:58
going to use but first of all we have to
00:05:01
bring in this one user 32 mqh file and
00:05:05
that is done like this there we have now
00:05:11
included that file with this get before
00:05:15
this gets compiled now in that file as I
00:05:19
said we're going to use the message W
00:05:22
let me compile this we're going to use
00:05:26
the message box W instead of message box
00:05:31
and now that I have compiled you can see
00:05:34
here the option to select message box W
00:05:38
it's showing me all of the functions
00:05:39
that's in that user 32 file here message
00:05:44
box W
00:05:46
first of all it requires a window handle
00:05:50
and we're going to get the handle of the
00:05:55
window the number of the chart that is
00:05:57
open right now and the way that we're
00:05:59
going to do this is we're going to use
00:06:00
the meta traders built-in window handle
00:06:04
function and it wants you to enter in
00:06:10
the string which is the currency pair
00:06:15
and the time frame so we're just going
00:06:17
to put in symbol and the time frame
00:06:23
which is period so this is going to
00:06:26
return us a handle we put that closing
00:06:29
parenthesis there now you can see the
00:06:33
next thing it once here is text and this
00:06:36
is what the message box is going to
00:06:38
actually say so we'll just cut and paste
00:06:40
this from this other message box
00:06:42
function here yeah all of this right
00:06:45
through here and we just well we get the
00:06:48
caption as well fact we can get this
00:06:50
whole thing why not
00:06:55
and copy this and bring it up here now
00:06:58
let's look at what we've got here we've
00:07:00
got the handle we've got what the
00:07:05
message box is actually going to say the
00:07:10
caption of the message box and what kind
00:07:14
of icons it's going to display on the
00:07:16
message box this compiles just fine so
00:07:22
you want to see if it will work for us
00:07:24
let's give it a try here's the message
00:07:29
box test first of all we will load it on
00:07:32
a on a 4-hour chart and you can see that
00:07:36
it's loaded successfully here it is it's
00:07:38
on the chart however let's try loading
00:07:43
it on a one-hour chart when we say okay
00:07:50
we actually get a message box in a
00:07:54
custom indicator this only works on the
00:07:56
four hour time frame change to the four
00:07:59
hour time frame and reload and we say ok
00:08:02
and you can see down here it said it
00:08:04
loaded successfully and then the message
00:08:07
box test initialization failed and it
00:08:11
wasn't until we've said ok that it
00:08:14
actually removed it because everything
00:08:16
comes to a stop when the message box is
00:08:19
open let me show you again here let me
00:08:23
load it on a 4-hour chart right here it
00:08:28
loaded up successfully and initialize
00:08:31
let me delete all this out of here now
00:08:33
watch what happens with we change
00:08:35
timeframes we get the message box and
00:08:39
you notice down here it just simply says
00:08:42
that it has uninitialized that's when we
00:08:45
took it off of the 4 hour time frame
00:08:48
chart and now a 1 hour time frame chart
00:08:50
has been loaded and it is trying to
00:08:52
initialize it has not initialized yet
00:08:55
but when we say ok watch what happens
00:08:58
down here and we bring this down here
00:09:00
closer to it there when we finally hit
00:09:04
OK it tells us that the initialization
00:09:06
failed
00:09:08
and the message box test has been
00:09:12
removed and of course we can also put a
00:09:13
print line in there that will tell
00:09:16
people you need to change timeframes
00:09:17
that's how you make a message box pop up
00:09:20
in an indicator and now that you've
00:09:22
found me if you haven't subscribed to
00:09:24
the channel and you like this kind of
00:09:25
stuff make sure you subscribe give it a
00:09:27
thumbs up or if you didn't like to give
00:09:29
it a thumbs down do one of the other but
00:09:31
I thank you for watching and I'll see
00:09:32
you next time pip pip

Description:

Learn mql4 coding at https://learnmql4.com Mql4 has it's limitations. One of them is the inability to use the MessageBox function in a custom indicator. In this video we will do a little hacking to make us a message box appear using the windows user32.dll file. My Expert: Jimdandy Trade Management Tool.. Free download https://www.mql5.com/en/market/product/11862 My Trade Simulator: DownLoad Skill Builder and hone your trading skills. https://www.mql5.com/en/market/product/18682 My simple kindle book at: https://www.amazon.com/How-Hard-Mql4-Programming-Programmnig-ebook/dp/B00QZEI5RA Tip Jar: https://www.paypal.com/paypalme/jimdandy1958 Support the Channel and download videos and files at... https://learnmql4.teachable.com/ and/or...Be a supporter: https://www.patreon.com/JimDandy1958 Subscribe to the 2013 archives and download all of the videos and files you want here.. https://learnmql4.teachable.com/ If you are serious about trading for a living.... Learn to trade here. https://tieronetrading.com/14-day-trial/

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "Hacking mql4 to Make a Message Box In An Indicator" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "Hacking mql4 to Make a Message Box In An Indicator" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "Hacking mql4 to Make a Message Box In An Indicator" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "Hacking mql4 to Make a Message Box In An Indicator" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "Hacking mql4 to Make a Message Box In An Indicator"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "Hacking mql4 to Make a Message Box In An Indicator"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.