add sound to TP of a position

Post Reply
FreddyFX
Trader
Posts: 28
Joined: Sun Dec 04, 2011 6:51 pm
Location: Puerto Vallarta - Mexico

add sound to TP of a position

Post by FreddyFX »

Hi guys.

I would like to add sound to my EA if it takes out a position.
Anybody that can help me with that, please?

Freddy
Trading forex is easy, making money is simple.
It is the mental part that is difficult.
User avatar
NeoTrader
Trader
Posts: 436
Joined: Wed Apr 04, 2012 2:52 pm
Location: small Village at Lake Chiemsee, Bavaria, Germany

Re: add sound to TP of a position

Post by NeoTrader »

Hi Freddy,
FreddyFX wrote:I would like to add sound to my EA if it takes out a position.
Anybody that can help me with that, please?
Look into the PlaySound Function to get what you want.
Hope this helps.

happy trading,

NeoTrader

-
FreddyFX
Trader
Posts: 28
Joined: Sun Dec 04, 2011 6:51 pm
Location: Puerto Vallarta - Mexico

Re: add sound to TP of a position

Post by FreddyFX »

NOT so far at the moment, guess I should not mess with coding and leave it to the professionals, lol.

But I have sounds on taking a position, so figured would be nice when it takes out in profit.
Trading forex is easy, making money is simple.
It is the mental part that is difficult.
ZeppDK
Posts: 1
Joined: Fri Oct 04, 2013 12:46 pm

Re: add sound to TP of a position

Post by ZeppDK »

FreddyFX wrote:Hi guys.

I would like to add sound to my EA if it takes out a position.
Anybody that can help me with that, please?

Freddy
i took a Little other aproach than putting it into all EA's
instead i made a seperate EA that makes an TP sound, and sends a push message to my phone telling me that i earned Money, and how much..
it should properbly be made different, but for my personal use its sufficient.

Code: Select all

double AccountB;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
AccountB = AccountBalance();
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {

   
      if(AccountB < AccountBalance())
   {
double AllAc = (AccountCredit()+AccountBalance());
double Nuff = (AccountBalance()-AccountB);     
      PlaySound("alert2.wav");
      SendNotification("TP reached <=> +"+DoubleToStr(Nuff, 2)+"$ <=> new balance " +DoubleToStr(AllAc, 2)+"$");
      AccountB = AccountBalance();
   }
   else
   {   
   }


   return(0);
Post Reply

Return to “Scripts”