i have not code.. im testing bat i have not idee ;)
im found dis .. (PriceAlert.mq4)
im need sound and mail alert by -50 .. parheps you can help :D
I think this is what you are trying to do. You will need to put it in an EA, compile it. Drop on a demo account and open a few trades. Email will not work from Tester!
#include <stderror.mqh>#include <stdlib.mqh>#define NL "\n"#define TAB "\t"externdouble ProfitTarget = 1.00;
externdouble LossTarget = -1.00;
externbool EmailCommunication = true;
bool InitVar = true;
bool DoOnce = false;
string SubjectLine = "A simple rule to follow when posting";
string Body = "I will not post the same question in multiple threads";
int init()
{
return(0);
}
int start()
{
if(InitVar)
{
InitVar = false;
DoOnce = true; // <---- only send one email
}
double Profit=AccountProfit(); //<---- get running total of profit for open trades
Comment("Account Profit is ",DoubleToStr(Profit,2),"\n","Profit Target is "
,DoubleToStr(ProfitTarget,2),"\n" ,"Loss Target is "
,DoubleToStr(LossTarget,2)); //<---- will display in upper left corner of chartif((Profit>=ProfitTarget)||(Profit<=LossTarget)) //<--- comment out to test email and alertif(DoOnce)
{
DoOnce = false;
if(EmailCommunication) //<--- email must be set up in option for sendmail() to work
{
SendMail(SubjectLine, TAB + Body + NL + "Account Profit\Loss is "
+ DoubleToStr(Profit,2)); //<---- example of sendmail() email must be set up in options for sendmail() to workAlert("Email sent" + " Account Profit\Loss is ",DoubleToStr(Profit,2)); //<---- example of alert
}
}
return(0);
}
dis scrips send mail and giv alert. BAT but only if youstart/restarttheprogramagain.andnotduring normaloperation. .. a test dis mit MT4
you polish is perfekt ;) (na zdrowie) hehe bat im speak better german. (egal)
one problem more.. im will 2 sounds by UP and DOWN
Approach Profit.wav
Approach Stop.wav
is dis posible ? :)
Ich werde versuchen,deutscheZeit,
IhreZIP-Dateiist leer. ( your zip is empty )
DiedoOnceFlaggeist, warum Sienursehen, sindeine Warnung.Wenn Siedieses Flagentfernendann wird esimmerpopingWarnungen, bis IhrKontostandändert.Sie müssendie Menge derMeldungenSignaleunbegrenzt!Tun Sie diesimmer Sie wollen.Dieser Codeist nureine Demo vonsendmail() undalert ()-Funktionen undjetzt mitverschiedenen Soundsfür den Alarm.
(The doOnce flag is why you are only seeing one alert. if you remove this flag then it will keep poping up alerts until your account balance changes. You need to limit the amount of alerts signals! Do this however you want. This code is just a demo of sendmail() and Alert() functions and now with different sounds for the alert.
Zunächstmüssen Sie denAlarmtoninOptionen wie diesedeaktivieren (First, you need to disable the alert sound in options like this)
#include <stderror.mqh>#include <stdlib.mqh>#define NL "\n"#define TAB "\t"externdouble ProfitTarget = 1.00;
externdouble LossTarget = -1.00;
externbool EmailCommunication = true;
string SubjectLine = "A simple rule to follow when posting";
string Body = "I will not post the same question in multiple threads";
int err;
bool doOnce = false;
int init()
{
return(0);
}
int start()
{
if (initVar)
doOnce=false;
double Profit=AccountProfit();
Comment("Account Profit is ",DoubleToStr(Profit,2),NL,"Profit Target is ",DoubleToStr(ProfitTarget,2),NL ,"Loss Target is ",DoubleToStr(LossTarget,2));
if(!doOnce)
{
if(Profit>=ProfitTarget)
{
SendMail(SubjectLine, TAB + Body + NL + "Account Profit\Loss is " + DoubleToStr(Profit,2)); //<---- email must be set up in option for sendmail() to workPlaySound("alert2.wav"); //<---- Will play any wav file in the sounds directory in MT4. You can put any wav file you want in there.Alert("Email sent" + " Account Profit\Loss is ",DoubleToStr(Profit,2));
doOnce = true; // <----
}
if(Profit<=LossTarget)
{
SendMail(SubjectLine, TAB + Body + NL + "Account Profit\Loss is " + DoubleToStr(Profit,2)); //<---- email must be set up in option for sendmail() to workPlaySound("connect.wav"); //<---- Will play any wav file in the sounds directory in MT4. You can put any wav file you want in there.Alert("Email sent" + " Account Profit\Loss is ",DoubleToStr(Profit,2));
doOnce = true;
}
}
return(0);
}
Obwohldies funktioniert, habe ich nichtdiesen Codein meinenEAverwendet.Ich habe nurdiesen Codefür Sie zusammengestelltstecken.Es könnteein besserer Weg, dies zu tun.Testen Sie den Codeselbstwenn Sie esin einerEA.Denken Sie daran,Sie brauchen, umdie Menge, wie oft derAlarmgenanntoder ist eswird einTon aufjedem Tickzu begrenzen.
Although this works, I have not used this code in any of my ea's. I have only stuck this code together for your question. There could be a better way of doing this. Test the code for yourself if you use it in a EA. Remember you need to limit the amount of times the alert is called or it will be playing a sound on every tick.
Viel Glück, ich hoffe,die deutsche Versionwar besser.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
code :D
i have not code.. im testing bat i have not idee ;)
im found dis .. (PriceAlert.mq4)
im need sound and mail alert by -50 .. parheps you can help :D
I think this is what you are trying to do. You will need to put it in an EA, compile it. Drop on a demo account and open a few trades. Email will not work from Tester!
HI
im test dis bat not work ? or im not cant dis.
im have dis in script > and start dis.
bat not alert or mail by -10.00
HI
im test dis bat not work ? or im not cant dis.
im have dis in script > and start dis.
bat not alert or mail by -10.00
Używam do tego tłumacz
Pobierz załączonym demo.mql plik i umieścić go w katalogu ekspertów i skompilować plik. należy wtedy zobaczyć go tutaj .......
Upewnij się, że prawidłowo skonfigurować e-mail, naciśnij przycisk test i sprawdź, czy otrzymasz e-mail wysyłany na adres
Otwieranie pozycji na koncie demo. Upewnij się, że Expert Advisors włączone. Przeciągnij ekspertów na wykresie.
Powinieneś wtedy zobaczyć coś takiego.
Powodzenia .
HI
dis scrips send mail and giv alert. BAT but only if you start/restart the program again. and not during normal operation. .. a test dis mit MT4
you polish is perfekt ;) (na zdrowie) hehe bat im speak better german. (egal)
one problem more.. im will 2 sounds by UP and DOWN
Approach Profit.wav
Approach Stop.wav
is dis posible ? :)
HI
dis scrips send mail and giv alert. BAT but only if you start/restart the program again. and not during normal operation. .. a test dis mit MT4
you polish is perfekt ;) (na zdrowie) hehe bat im speak better german. (egal)
one problem more.. im will 2 sounds by UP and DOWN
Approach Profit.wav
Approach Stop.wav
is dis posible ? :)
Ich werde versuchen, deutsche Zeit,
Ihre ZIP-Datei ist leer. ( your zip is empty )
Die doOnce Flagge ist, warum Sie nur sehen, sind eine Warnung. Wenn Sie dieses Flag entfernen dann wird es immer poping Warnungen, bis Ihr Kontostand ändert. Sie müssen die Menge der Meldungen Signale unbegrenzt! Tun Sie dies immer Sie wollen. Dieser Code ist nur eine Demo von sendmail () und alert ()-Funktionen und jetzt mit verschiedenen Sounds für den Alarm.
(The doOnce flag is why you are only seeing one alert. if you remove this flag then it will keep poping up alerts until your account balance changes. You need to limit the amount of alerts signals! Do this however you want. This code is just a demo of sendmail() and Alert() functions and now with different sounds for the alert.
Zunächst müssen Sie den Alarmton in Optionen wie diese deaktivieren (First, you need to disable the alert sound in options like this)
Obwohl dies funktioniert, habe ich nicht diesen Code in meinen EA verwendet. Ich habe nur diesen Code für Sie zusammengestellt stecken. Es könnte ein besserer Weg, dies zu tun. Testen Sie den Code selbst wenn Sie es in einer EA. Denken Sie daran, Sie brauchen, um die Menge, wie oft der Alarm genannt oder ist es wird ein Ton auf jedem Tick zu begrenzen.
Although this works, I have not used this code in any of my ea's. I have only stuck this code together for your question. There could be a better way of doing this. Test the code for yourself if you use it in a EA. Remember you need to limit the amount of times the alert is called or it will be playing a sound on every tick.
Viel Glück, ich hoffe, die deutsche Version war besser.
Hello :)
im copy dis script in new an old mq4 file.
bat dis not like work.. or im not cant dis read.. google translate ist not the best ;) my women cant english better she translate me wot you write :)
im test dis 2x bat dis script is not active ? whye ?
ps. my sound file :) im have change the name .RAR to .ZIP .. change dis and you see my soundfile in the rar/zip
Hello :)
im copy dis script in new an old mq4 file.
bat dis not like work.. or im not cant dis read.. google translate ist not the best ;) my women cant english better she translate me wot you write :)
im test dis 2x bat dis script is not active ? whye ?
ps. my sound file :) im have change the name .RAR to .ZIP .. change dis and you see my soundfile in the rar/zip
Versuchen Sie dieses, stellen Sie sicher. MMS-Datei ist in Experten-Verzeichnis zu kompilieren. Ich glaube nicht, dass Sie ein. Ex4 in Ihrem Verzeichnis.
1.
2.
3.
4.
HI :)
oky compile not work bat im have one bug
'initVar' - variable not defined D:\..................\MetaTrader4\experts\Profit Alert.mq4 (24, 7)