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

 
Vladislav Andruschenko:
Alert(""); such a script?

No thanks, I've already found it. Maybe someone could use it.

Files:
alert.mq4  1 kb
 
amenrazp:

Looks like it. Do you have the option of attaching here?

This is actually all the code. I'll make it into a script when I get home.
 

Please see my post. Please tell me what the problem is.

https://www.mql5.com/ru/forum/160683/page433#comment_6385422

Любые вопросы новичков по MQL4, помощь и обсуждение по алгоритмам и кодам
Любые вопросы новичков по MQL4, помощь и обсуждение по алгоритмам и кодам
  • 2018.01.23
  • www.mql5.com
В этой ветке я хочу начать свою помощь тем, кто действительно хочет разобраться и научиться программированию на новом MQL4 и желает легко перейти н...
 
wisor2006:

Please advise on the answer to a specific question. I'm redoing the Bollinger.

Changed a couple of lines, doesn't draw bars. What is it, logarithms?

Volatility formula from https://research-journal.org/economical/analiz-razlichnyx-metodov-ocenki-istoricheskoj-volatilnosti-dlya-opcionnoj-torgovli/


         sum+=log(fabs(High[k]/Close[k]))*log(fabs(High[k]/Open[k]))+log(fabs(Low[k]/Close[k]))*log(fabs(Low[k]/Open[k]));

2018.01.26 16:40:03.920 BS_Bands_TRO USDJPY,H1: zero divide in 'BS_Bands_TRO.mq4' (206,32)


 

Good evening! Once again I'm looking for help. My EA has main function in OnInit, which reads file, and then according to different conditions builds different graphical objects. Also on the chart is a button which, when clicked, operates the function to remove these objects, for example, text labels. How to make, that after the press of the button has removed text labels, at release of the button it is possible to start not all Function entirely, which will completely construct all objects, but to construct only text labels. The only thing that comes to mind is to create an analogue of the main function for each type of object with all the actions associated with opening and reading the file, but I want to use some clever solution, but I do not know what and how, in the main function or in the functions of the buttons?

 
WinProject:

Good evening! Once again I'm looking for help. My EA has only one Function in OnInit, which reads the file and then builds different graphical objects according to different conditions. I also have buttons on the chart which, when clicked, have the function to delete these objects, e.g. text labels. How to make, that after the press of the button has removed text marks, at release of the button it is possible to start not all Function entirely, which will construct all objects, but to construct only text marks. The only thing that with my "level" of programming and lack of fundamental knowledge comes to mind is to prescribe separately for each type of object a function with all actions related to opening and reading the file, but I want to use some clever solution, but do not know what and how; and where in the function itself or in the functions of the buttons?

One "kulibin" tried to make a universal tool, a topror, a hoe, a scythe and a rake... All in one.... The result is predictable.

 
Alexey Viktorov:

One "craftsman" tried to make a universal tool, a topror, a hoe, a scythe and a rake... All in one.... The result is predictable.

Thank you!) From your reply I conclude that you need to make a separate function for each type of object. I was thinking that somehow we could make it possible to separately run the functions to build objects nested in the While loop of the main function to read the file. How about Switch?
Использование аналитических объектов - Графики котировок, технический и фундаментальный анализ - MetaTrader 5
Использование аналитических объектов - Графики котировок, технический и фундаментальный анализ - MetaTrader 5
  • www.metatrader5.com
Определение трендов, построение каналов, выявление циклов и уровней поддержки/сопротивления — все эти и многие другие задачи решаются при помощи аналитических объектов. Всего в торговой платформе доступно 46 таких инструментов. Среди них имеются геометрические фигуры, различные каналы, инструменты Ганна, Фибоначчи, Эллиотта и многое другое. В...
 
WinProject:
Thank you!) From your reply I conclude that a separate function should be made for each type of object. I was thinking that somehow we could make it possible to separately run the functions to build objects nested in the While loop of the main function to read the file. How about Switch?
Do you know about the flags? First, all flags are raised. The function sees - all flags are raised - and builds everything. Press the button, something is removed there and the corresponding flag is lowered. Press the button - the program sees - if(flag is omitted) - and builds a part. You can have a lot of flags. That's all. Have you already guessed what the flag is? Well, now you are a software engineer. And those who have not heard much about flags and arrays - those coders = technicians.
 
STARIJ:
Do you know about the flags? First, all flags are raised. The function sees - all flags are up - and builds everything. Press the button, something is removed and the corresponding flag is lowered. Press the button - the program sees - if(flag is omitted) - and builds a part. You can have a lot of flags. That's all. Have you already guessed what the flag is? Well, now you are a software engineer. And those who have not heard much about flags and arrays - those coders = technicians.
Thank you very much, no, I did not know about flags, I will study the question. And you have a good weekend.
 
WinProject Thank you very much, no, I didn't know about the flags, I will study the question. And you have a good weekend.

Flags are variables. Or bool: false=empty, true=raised or int - then there are many flags in one number at once: 0 - all omitted, 1=lower first, 2=lower second, 3=lower first and second, 4=lower third, 5=lower third and first, 6=lower third and second, 7=lower first, second, third, 8=lower fourth.... Well that's in binary code. How do you find out?

int x=12;
if(x & 1) alert("Первый поднят"); else alert("Первый опущен");
if(x & 2) alert("2-й поднят"); else alert("2-й опущен");
if(x & 4) alert("3-й поднят"); else alert("3-й опущен");
if(x & 8) alert("4-й поднят"); else alert("4-й опущен");
Reason: