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

 

Hello, could you tell me how to add a sound signal to the indicator source code?

Can you tell me if it is possible to combine two indicators in one indicator and add sound at the moment when the indicators cross each other?

 
tni3711:

Hello, could you tell me how to add a sound signal to the indicator source code?

i would like to know if it is possible to combine two indicators in one indicator and add a sound when the indicators cross?

here is an article on how to add a sound to the indicatorshttps://www.mql5.com/ru/articles/1448

or your question is "write it for me" ?


Seric29:

I still don't understand how to get access to the internal code of functions like ArrayResize() orArrayCopy(), who knows how to look at the internal code of these functions?

no way, these are built-in functions, they are highlighted in purple in the meta-reader

https://www.mql5.com/ru/articles/1496

Звуковые сигналы в индикаторах
Звуковые сигналы в индикаторах
  • www.mql5.com
Первый вариант по моему мнению наиболее правильный, но требует либо навыков программиста либо денег на реализацию. Второй - очень трудоемкий, утомительный и нерациональный. А третий вариант - нечто среднее между первыми двумя. Для его реализации необходимо намного меньше времени и умений, но он значительно облегчит жизнь (работу) трейдеру...
 
Alexey Viktorov:

Check if it will work with time in the future. Otherwise only by checking on the day of the week and adding up without days off.

Not.... to the future doesn't want to work..... to the past works
 
Igor Makanu:

no, these are built-in functions, they are highlighted in purple in the meta-reader

But they should have a source code. You could refine them and get something better, or create something interestingly similar.

 
Seric29:

But they must have source code. You could refine them and get something better or create something interestingly similar.

It shouldn't.

 
Igor Makanu:

it shouldn't

If it shouldn't or doesn't exist then how does it work, the code must still be there.

 

Which function can I use to reverse the direction of array indexing, I tried ArraySetAsSeries and I also tried ArrayReverse, the numbers remain on their indexes as before, I output with Print()?

 
Seric29:

Which function can I use to reverse the direction of array indexing, I tried ArraySetAsSeries and I also tried ArrayReverse, the numbers remain at their indexes as before, I output with Print()?

ArraySetAsSeries()

script to test:

#property strict
//+------------------------------------------------------------------+
void OnStart()
  {
   int arr[10] = {1,2,3,4,5,6,7,8,9,10};
   string s="";
   for(int i=0;i<10;i++) s += IntegerToString(arr[i]) + " , ";
   Print(s);
   ArraySetAsSeries(arr,true);
   s="";
   for(int i=0;i<10;i++) s += IntegerToString(arr[i]) + " , ";
   Print(s);
  }
//+------------------------------------------------------------------+

results:

2019.04.16 14:20:55.493 Script tst EURUSD,H1: removed

2019.04.16 14:20:55.489 tst EURUSD,H1: uninit reason 0

2019.04.16 14:20:55.489 tst EURUSD,H1: 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ,

2019.04.16 14:20:55.489 tst EURUSD,H1: 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ,

2019.04.16 14:20:55.489 tst EURUSD,H1: initialized

2019.04.16 14:20:55.464 Script tst EURUSD,H1: loaded successfully


Seric29:

if it shouldn't or doesn't exist, how does it work, the code should still be there.

I have a feeling you're trying to persuade me to show you the source code of ArrayResize() or ArrayCopy().

No, you can't, there's no source code anyway, these are built-in functions, and the fact that you opened the file ArrayDouble.mqh means only that you got acquainted with the standard libraryhttps://www.mql5.com/ru/docs/standardlibrary

))

Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека MQL5 написана на языке MQL5 и предназначена для облегчения написания программ (индикаторов, скриптов, экспертов) конечным пользователям. Библиотека обеспечивает удобный доступ к большинству внутренних функций MQL5.
 
Igor Makanu:

I have a feeling that you're trying to persuade me to show you the source code of ArrayResize() or ArrayCopy()

I don't get the impression that it's just a crooked array handling in mql4, and I'd like to create more such functions.

 
Seric29:

I don't get the feeling but it is, crooked array handling in mql4 and would like to create more of such a function.

Do you have a crooked one? It's never too late to learn.
Reason: