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

 

Good afternoon, forum users.

Please help me to organize correctly the sound in the indicator. The standard means of MT4 do not work well.

As I understand it, at the moment of the bar start from different charts there is a stream of signals to be played in Windows. They are not put in queue but they are played last and the rest are lost. Of the two adjacent PlaySound() functions, only one is played. It creates mess in messages, and message organization causes loading of the terminal.

The solution seems to be using waveOut API or Winampa. It allows to form some kind of playlist in indicator and pass the playback to the external device. It must relieve the load on the terminal. In general, the problem is in the queue arranging.
Googled. I haven't found any detailed description for dummies, and I can't figure it out myself.
If anyone has solved this problem, or knows a detailed description, please advise. I think this will be of interest to many.

 

Can someone please help!!!!

Can you tell me how to make in MT4 so that on the right side of the price chart, at stop levels, the price is highlighted the same as on the lines ask and bid????

Files:
27c3ncf5hf2.jpg  355 kb
 
zctac:

Can someone please help!!!!

Can you tell me how to make in MT4 so that on the right side of the price chart, at stop levels, the price is highlighted in the same way as the ask and bid???? lines

Display your horizontal line (OBJ_HLINE) at stop order price.

Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов / OBJ_HLINE
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов / OBJ_HLINE
  • www.mql5.com
//| Создает горизонтальную линию                                     |                 price=0,                         width=1,            //| Перемещение горизонтальной линии                                 | //| Удаляет горизонтальную линию                                     |...
 
Algus:

Good afternoon, forum users.

Please help me to organize correctly the sound in the indicator. The standard means of MT4 do not work well.

As I understand it, at the moment of the bar start from different charts there is a stream of signals to be played in Windows. They are not put in queue but they are played last and the rest are lost. Of the two adjacent PlaySound() functions, only one is played. It creates mess in messages, and message organization causes loading of the terminal.

The solution seems to be using waveOut API or Winampa tools. The formation of something like a playlist in indicator and transmission of playback to the external device. This should relieve the load on the terminal. In general, the problem is in the organization of the queue.
Googled. I haven't found any detailed description for dummies, and I can't figure it out myself.
If anyone has solved this problem, or knows a detailed description, please advise. I think this will be of interest to many.

It is easier to do in Expert Advisor or looping script, because Sleep() works there, unlike in indicator and between playing melodies this slip can be set to wait until the end of music.

And call the indicator from a script or an EA.
 
Aleksey Vyazmikin:

It's easier to do this in an auxiliary advisor or looping script, as Sleep() works there, unlike in an indicator, and you can put this slip between playing tunes to wait until the music is over.

The indicator can be called from a script or Expert Advisor.

Thanks, I'll think about it, maybe as an option to get out.

It's not the duration that's the problem, it's the queue. The messages are short, but a lot and at the same time. Again, puts a strain on the terminal. I'd like to give this to the system. There this problem seems to be solved by standard Windows means.

Although... maybe.

 
Algus:

Thanks, I'll think about it and see if I can work it out.

The problem isn't the length, it's the queue. The messages are short, but lots of them at once. Again, puts a load on the terminal. I'd like to give this to the system. This task seems to be solved by standard Windows means.

Although. maybe.

If many same signals come at once, group them and play them as one. Or collect them in arrays by signal type and execute step by step :)

 

At a certain date and time you have to check the signal. What is wrong?

input datetime Input1=D'23.02.2019 08:00:27';
input datetime Input2=D'08.03.2019 09:30:20';
input datetime Input3=D'01.04.2019 12:30:27';
______________________________________________

{
//---
 A=1;B=2;
   if(rates_total<2) return(0);
     {
      int limit=rates_total-prev_calculated;
      if(limit>1) 
        {
         ArrayInitialize(BufferUP,EMPTY_VALUE);
         ArrayInitialize(BufferDN,EMPTY_VALUE);
        }
      for(int i=limit; i>=0; i--) 
        {
         if(A>B&&(TimeCurrent()==Input1 || TimeCurrent()==Input2 || TimeCurrent()==Input3))
           {
            BufferUP[i]=low[i]-10*Point;
            Alert("__",TimeCurrent());
           }
        }
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
 
Artyom Trishkin:

Output its horizontal line (OBJ_HLINE) at the stop order price.

Thank you for your reply!
 
volyal:

At a certain date and time you have to check the signal. What is wrong?

if( (A>B) && (TimeCurrent()==Input1 || TimeCurrent()==Input2 || TimeCurrent()==Input3) )

You have "hard" conditions, so you are probably not hitting the true value of the whole expression.

Indicators and Expert Advisors work upon the tick receipt, but the tick may occur a second later than your condition

you should try to write such conditions on >=

SZY: Well, in general, when I write complex logical conditions, I usually try not to lose the logic of following the conditions, then I can reduce them to a more compact form, it's easier to find logical errors in case they occur at the debugging stage

if(A>B)
{
   if(TimeCurrent()==Input1 || TimeCurrent()==Input2 || TimeCurrent()==Input3))
        {
            BufferUP[i]=low[i]-10*Point;
            Alert("__",TimeCurrent());
        }
}

but that's a matter of taste.

 
Igor Makanu:

You have "hard" conditions, so you most likely do not hit the true value of the whole expression

Indicators and experts work upon the tick receipt, but the tick may come one second later than your condition

you should try to write such conditions on >=

SZY: Well, in general, when I write complex logical conditions, I usually try not to lose the logic of following the conditions, then I can reduce them to a more compact form, it's easier to find logical errors in case they occur at the debugging stage

but that's a matter of taste.

Thank you. Simply>= is not possible, there will be a constant signal after the first date, you need to set the time range. How do you set it?
Reason: