It seems it leads to an error compiling
I have it in 2 blocks, so its 2xtimes the error message
......
error.png
Hello,
short question for the Alert Message block (Which I assume is an Alarm Message popping up)
I want to have an EA run on many charts and pop up an alarm if a condition is reached. How can I include the symbol name in the Alarm message so if an alarm pops up I can see a text specified with the Symbol name after.
Cheers
That's a shame - the most basic thing is not included somewhere in Condition block. Now I can suggest this: http://fxdreema.com/shared/aEO5e954, but I will include it later (these days), because now I have some other things to do.
Great thanks, that helps me out for now
It seems it leads to an error compiling
I have it in 2 blocks, so its 2xtimes the error message
......
error.png
" and then " and then + and then Symbol() and then + and then " and then "
It seems "+Symbol()+" is accepted
Trying this one when markets are online
jepp, copied and pasted out of your example and double checked I do it the same as you did, still that error appeared
Note sure what it will do with just "" for one time !?
There is a function named Alert() in MQL4. Here is how it works:
Alert("some text here");
or...
Alert("some text here"+", and some other text here");
or...
Alert(Symbol());
or...
Alert("my current symbol is: "+Symbol());
or...
Alert(""+Symbol()+"");
So, + is like glue, and you can put as many things as you want to display, one after another with + in between. Strings (texts) are always with " in the beginning and " in the end. Digits are not.
Alert(12345+"some text here");
will alert this: 12345some text here
Text in Condition outputs what is in the field, but it automatically puts " in the beginning and " at the end of it. So, if you write just Symbol() it will become...
Alert("Symbol()");
and this will alert: Symbol()
but Symbol() is a function and at the end it must be executed as such, something like
Alert(Symbol());
but because the generator puts " and ", then we need to do some thick until we have this:
Alert(""+Symbol()+"");
and this will output: EURUSD
Thx for the examples provided
Will play around with them
For your information, using "+Symbol()+" as text as in the example from you worked now.
So had to remove 1x the "" to have it compile and it alerts me visual in MT4.
Great, cheers
I put "+Symbol()+" with only 1 set of quotes but it isn't printing the symbol. See attached screenshot. Thank you.
......
symbol.png
It seems it leads to an error compiling
I have it in 2 blocks, so its 2xtimes the error message
......
error.png