Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1055

 
MakarFX:

Good day to all.

Can you tell me how to attach your own sound to "Alert()"?

only in terminal - service - setup - events

 
MakarFX:

Good day to you all.

Can you tell me how to attach your sound to "Alert()"?

In the "Source" field of the alert editor, press the colon and select the sound you want.

The alert editor can be opened in the "Alerts" tab of the terminal by right-clicking.

If you want to attach a sound to the code, either replace alert.wav file with your sound, or write your file name in the code.

 

Hi all

How do I get back to the right line of code in MQL5?

 
gromaizeka:

Hi all

In MQL5, how do I get back to the right line of code?

There are several options. Here is one.


You can bookmark by ctrl+F2 and navigate by F2 bookmarks.

Also, the "Forward" and "Backward" mouse keys work.

 
Vitaliy Maznev: or write the name of your file in the code.

I am interested in how to write it in the code, as the indicator has Alert on several events, so I want to separate a different sound for each event.

 
MakarFX:

I'm interested in how to write in the code, because the indicator has Alert on several events, so I want to separate a different sound for each event.

Of course, I'm not a coder and have not seen the code itself, but probably need to add variables such as alert1, alert2, etc.. :)

 
MakarFX:

I am interested in how to write it in the code, as the indicator has Alert on several events, so I want to separate a different sound for each event.

no way

Configure the alert without sound in the terminal and play any sound from the PlaySound() code before calling the alert

 
MakarFX:

I am interested in how to write in the code, as the indicator has Alert for several events, so I want to separate a different sound for each event.

Either immediately after Alert or put PlaySound with its own sound instead.

 
Vitaliy Maznev:

Of course, I'm not a coder and haven't seen the code itself, but you probably need to add variables like alert1, alert2, etc. :)

//+----------------------------------------------------------------------------+
//|  Подача сигнала.                                                           |
//|  Параметры:                                                                |
//|    st - строка сообщения                                                   |
//+----------------------------------------------------------------------------+
void Signal(string st) {
  if (UseAlert) Alert(st);
  if (UseComment) Comment(st);
  if (UseSendMail) SendMail(WindowExpertName(), st);
  if (UseSendPush) SendNotification(st);
  if (UsePrint) Print(st);
  if (UseSound) PlaySound(sotFileName);
}

Source code attached

Files:
 
Alexey Viktorov:

There are several options. Here is one


You can bookmark by ctrl+F2 and navigate by F2 bookmarks.

The "Forward" and "Backward" mouse keys also work.


nope. like GoTo or ToDo . when the condition is met, the program starts code execution from the specified mark

Reason: