SendNotification
-
I am probably missing something within the multiple choices, but I cannot find an option to use the sendnotification command
Thank you for your help
-
There is such option at the bottom of "Alert"
-
okay I check it out
but can you just confirm if I select send notification to phone, it wont give me a popup alert, but just a push notification to my phone
Correct? -
I have no idea. If you look at the code, the native MQL4 function is used, but then some settings must be set in MetaTrader and to have such phone. I have Windows Phone and I never checked that
But it's so simple function that is used, so I can't see how something in the code can be incorrect. -
Okay, what I meant was that the alert gives me an onscreen popup on my computer (which I dont want)
the notification does send something to my phoneWould it be possible as a feature request
allow on each block under "more settings" an additional setting : sendnotification true/false
and a custom field to pass the information that we want to sendIt feels much more logical to me that way
the push to phone notification is extremely powerful and usefullThanks
-
100 different people will suggest 100 different things to be added under "More settings" in each block. Someone will say "Put Alert over there", other one will say "I want Print there", another one will say "Play sound, I want to play sound!".
This feature "SendNotification" is one of the simplest to program. Literally, write SendNotification("Message") everywhere in the code and it should work. I added this to the Alert block because the Alert is something similar, but not on MetaTrader directly. But the function can be used in "Custom MQL4 code" or in a custom block as well.
-
I get the fact that all and everybody asks for different and often similar or conflicting features
But I have a hard time understanding why I would wnat to receive a popup alert on my computer and a push notification to my phone at the same time
can we at least separate them? -
I have been trying to create a custom block, that I can simply attach to another block so that when that block is executed succesfully a notification gets send
My current sample, does send my push message to my phone
but I cannot figure out how I would have to define so I can input custom text whenever I attach a new SendNotiication block
it currently sends "snd" all the time ;-(Any help please, anybody?
my current definition in the attachment

......
sendnotification.png -
Almost there! But use only snd in the code, without "". If you look at the code that is generated, local variable called snd will be automatically put on the top of the function.
-
__I get the fact that all and everybody asks for different and often similar or conflicting features
But I have a hard time understanding why I would wnat to receive a popup alert on my computer and a push notification to my phone at the same time
can we at least separate them?[/quote:3l9ags2s]
Because the alert message holds the data and ifyou miss something you can see it later. I suppose that you will use the phone while you are away from MetaTrader. But yes, there is no reason to not have separate block for this thing only and I can easily create one. Can you tell me if all the other options in "Alert message" are ok to be used the same way, or something is missing or too much? -
Great!
I imagine using sendnotification as follows

But it would be WAY BETTER if we also have the option to parse all the information available in Alert besides a simple text message
For example when a trade closes I like to know that trades profit and total profit for the dayI dont know if there is maximum of characters to a push notifications
Thanks
......
sendnotif.png -
255 is the maximum length according to the specification:
http://docs.mql4.com/common/sendnotificationCan you tell me if rows can be used. I mean, is the text one-row-only or we can put things each in a new row. This is how "Alert message" works now, you can actually see that this block is separated into few rows. There is no problem with the Alert message, it supports new rows, but I started to wonder if that is really possible with SendNotification()
By the way notice these limits:
Strict use restrictions are set for the SendNotification() function: no more than 2 calls per second and not more than 10 calls per minute. Monitoring the frequency of use is dynamic. The function can be disabled in case of the restriction violation. -
I think it just allows for one row, so I send a new textmessage for each trade action or a change in trend
As you mentioned the number of messages is limited per second and minute. In my experience if you abuse the messages are queued and arrive later, as such losing their significance, but it does not stop or gte blocked completely