fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Print Message, Current Symbol

    Questions & Answers
    3
    11
    3493
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      ezzakt last edited by

      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

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • E
          ezzakt last edited by

          Great thanks, that helps me out for now đŸ˜‰

          1 Reply Last reply Reply Quote 0
          • E
            ezzakt last edited by

            It seems it leads to an error compiling

            I have it in 2 blocks, so its 2xtimes the error message

            ......
            error.png

            1 Reply Last reply Reply Quote 0
            • fxDreema
              fxDreema last edited by

              " and then " and then + and then Symbol() and then + and then " and then "

              1 Reply Last reply Reply Quote 0
              • E
                ezzakt last edited by

                It seems "+Symbol()+" is accepted

                Trying this one when markets are online

                1 Reply Last reply Reply Quote 0
                • E
                  ezzakt last edited by

                  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 !?

                  1 Reply Last reply Reply Quote 0
                  • fxDreema
                    fxDreema last edited by

                    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

                    1 Reply Last reply Reply Quote 0
                    • E
                      ezzakt last edited by

                      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

                      1 Reply Last reply Reply Quote 0
                      • T
                        Trader3487 last edited by

                        I put "+Symbol()+" with only 1 set of quotes but it isn't printing the symbol. See attached screenshot. Thank you.

                        ......
                        symbol.png

                        1 Reply Last reply Reply Quote 0
                        • E
                          ezzakt last edited by

                          see screenshot

                          Just as a comparison, if thats not printing, I dont know it ^^

                          ......
                          symbol.png

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post

                          Online Users

                          M
                          S
                          T
                          O
                          G
                          B
                          A
                          P
                          I
                          M
                          M
                          J
                          T
                          S
                          T
                          M

                          28
                          Online

                          146.7k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors