Mail or sms by -X profit ? - page 2

[Deleted]  
wolfoo:

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!

#include <stderror.mqh>
#include <stdlib.mqh>

#define NL                 "\n"
#define TAB                "\t"

extern double ProfitTarget = 1.00;
extern double LossTarget = -1.00;
extern bool 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 chart

  if((Profit>=ProfitTarget)||(Profit<=LossTarget)) //<--- comment out to test email and alert
     if(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 work
           Alert("Email sent" + " Account Profit\Loss is ",DoubleToStr(Profit,2)); //<---- example of alert
        }
     }
return(0);
}
[Deleted]  

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

Simon Gniadkowski
17400
Simon Gniadkowski  
-4.4 is not less than -10 . . why should it Alert ?
[Deleted]  
wolfoo:

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 .

Files:
demo.mq4  2 kb
qjol
3201
qjol  
SubjectLine & Body ;-) (u should translate to german LOL)
[Deleted]  

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 ? :)

Files:
xalert.zip  119 kb
[Deleted]  
wolfoo:

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)

#include <stderror.mqh>
#include <stdlib.mqh>

#define NL                 "\n"    
#define TAB                "\t"

extern double ProfitTarget = 1.00;
extern double LossTarget = -1.00;
extern bool 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 work
           PlaySound("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 work
           PlaySound("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);
}

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.

[Deleted]  

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

[Deleted]  
wolfoo:

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.

[Deleted]  

HI :)

oky compile not work bat im have one bug



'initVar' - variable not defined D:\..................\MetaTrader4\experts\Profit Alert.mq4 (24, 7)