Ask! - page 24

 

thanks

Gordon

 

Write_Alert() and Read_Alert() function ?

Hello,

I know the function Alert() which means to WRITE an alert.

I need the reverse function: can MT4 also READ the messages of the alerts ?

One complicated way would be to send the alert by email to myself, then somehow get the content of the email and parse it, and then feed it into MT4 using a dll. How to do this exactly ? Or is there an easier way ?

Autopips

 
autopips:
Hello,

I know the function Alert() which means to WRITE an alert.

I need the reverse function: can MT4 also READ the messages of the alerts ?

One complicated way would be to send the alert by email to myself, then somehow get the content of the email and parse it, and then feed it into MT4 using a dll. How to do this exactly ? Or is there an easier way ?

Autopips

If u specify the right properties in options of metatrader u can make string message and send it to u by SendMail() function, but better way is to use the dll made by codersguru witch can be found on his web page www.metatrader.info in the tools section.

 

read, not write

Kalenzo:
If u specify the right properties in options of metatrader u can make string message and send it to u by SendMail() function, but better way is to use the dll made by codersguru witch can be found on his web page www.metatrader.info in the tools section.

thanks for the interesting link. - However, SendMail (or some dll substituting SendMail) cannot be of any help. The aim is not to send something, but the aim is to get the content of the alert window. - Or can the SPEECHTEXT tool from CodersGuru read these messages (and output them as string instead of as voice) ? Or did I misunderstand your answer ?

 
autopips:
thanks for the interesting link. - However, SendMail (or some dll substituting SendMail) cannot be of any help. The aim is not to send something, but the aim is to get the content of the alert window. - Or can the SPEECHTEXT tool from CodersGuru read these messages (and output them as string instead of as voice) ? Or did I misunderstand your answer ?

Well I'm not sure if u misunderstand something. Mabye it was me Anyway, all messages are stored in log file int the expert log directory (experts/log) but that messages are not stored there in the real time. I mean the metatrader stores there all messages when u close it. If he is still running he will store there the last x lines (not all lines).

I think there can be 2 solutions from this situation:

1) Make a ea that will write your alerts into an external file (by the standard file functions) then, make a program (eg. in c++ or any other language) that will read that file every 30 seconds and check if there was added a new line, if yes then it will send u this line.

OR

2) u can use for eg. mysql library and connect to database, then write all alerts to database and read it from any place on earth, in any time u want to.

Hope it helps u

 

is it possible to ask for an ea to be made?

i have a strategy thats simple i just need somebody to code it for me. im just not very familiar with coding and programming.

should i ask it in here if not please guide me to where i need to ask it and to who

thanks

 

Crossalert

codersguru:
Hi newdigital, Did you test the code? is it what do you want?

Hi coders guru and everyone,

while using the crossalert on a considerably large timeframs, such as M30 and H1, it happens to the MA's to cross several times temporarily before the bar finishes, wich makes a lot of signals for the same breakout(wich is not yet 100% formed) , is there a function in MQL that limits the alerts to only one?, or a code that makes alert only when the bar finishes.

i will really apreciate your help, as i'm trading the breakout with several pairs, this will help me a lot.

thank you all.

 
pipspiner:
Hi coders guru and everyone,

while using the crossalert on a considerably large timeframs, such as M30 and H1, it happens to the MA's to cross several times temporarily before the bar finishes, wich makes a lot of signals for the same breakout(wich is not yet 100% formed) , is there a function in MQL that limits the alerts to only one?, or a code that makes alert only when the bar finishes.

i will really apreciate your help, as i'm trading the breakout with several pairs, this will help me a lot.

thank you all.

U can make variable in global section like alertBar and then add to condition

if(Bars>alertBar and other conditions)

{

Alert("ALERT ME!!!");

alertBar = Bars;

}

 

I cannot find an example on how this should be written!

Nested If statement - 3 Conditions

I want to code an ea to activiate during 3 different time periods. How would I set this up?? I am not sure how to code a nested if conditional statement in MQ4. Where is all the examples to follow to code this language??

The rough times would be between the following GMT times.

6 to 9

11 to 16

18 to 24

Any help would be appreciated! I could not find an example on how to do this in your MQL4 educational materials??

Dave <<<
 

How to READ (not WRITE) alerts ?

autopips:
Hello,

I know the function Alert() which means to WRITE an alert.

I need the reverse function: can MT4 also READ the messages of the alerts ?

One complicated way would be to send the alert by email to myself, then somehow get the content of the email and parse it, and then feed it into MT4 using a dll. How to do this exactly ? Or is there an easier way ?

Autopips

if you have given an EA or an indicator (the ex4 only, NOT the source),

and this EA writes some alerts into the alert window: what is the easiest way to get these alert messages into a string variable in realtime ? (The question is not how to WRITE an alert, that's what the alert() function is good for. I need to READ the alert. Also to write the alert message to a TXT file and read it from there is no solution, since exactly this message I do not have, so how should I write it ?)