I tried it in script and yet still doesn't work.
Then you have a bug in your code.
if((Open[0] < (sum/MA_Period) && Low[0] > (sum/MA_Period)) || (Open[0] > (sum/MA_Period) && Low[0] < (sum/MA_Period))){ MessageBox("Pass Average", "Windown Tittle")
Did you check to be sure it is possible for Open[0] to be less than the MA at the same time as Low[0] is bigger ? Think about it ...
int MessageBox( | string text=NULL, string caption=NULL, int flags=EMPTY) |
The function cannot be called from custom indicators since they are executed within interface thread and may not decelerate it.
Nor can it be called in scripts and EAs from the init() function (same reason)
That surprises me as I have used MessageBox in the init()function of EAs and it has worked as I expected.
Nor can it be called in scripts and EAs from the init() function (same reason)
This is not true. RTFM :-D
Scripts and experts work in their own thread. Custom indicators work in the main interface thread. If a custom indicator has been called with the iCustom() function, this indicator works in the thread of the program that has called it. Library (imported) functions work in the calling program thread, as well.
I Thought I had:
Message box waits for a user response and returns one of the return codes
Init() must return within 2.5 seconds.
Therefor message box can not be used in init.
Rereading it deinit() and start() when IsStopped, must return withing 2.5 seconds. Not init(). So I stand corrected.
Hi,
I am really sorry as I don't know if this is the right thread to post or no...
I am trying to show message every time with alert when candlestick pattern is found but it shows once only when I test the code.
Code is:
if(op2>cl2 && op1<cl1 && op2<cl1) { Alert(EnumToString(TimeFrame(i))," Bullish Engulfing pattern",TimeToString(tim)); MessageBox("CANDLESTICK PATTERN FOUND"," Pattern Alert"); }
Any help is really appreciated.
Thanks.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need some help. Somehow I can't display one simple message box.
The rest of the moving average file is kept the same. Is it because this is a custom indicator so it can't display it? If so, how can i do it? Thanks guy in advance.
P/S: i'm still new to C++ so pls be easy on me.