[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 400

 
Good afternoon all Could you please tell me how to make an indicator work that is posted without source code I put it in the indicators folder but MT does not see it For example these indicators What's wrong with them the program does not see
 
splxgf писал(а) >>

Strange use of return, conditions and if nesting can be reduced.

You can cut it down, but it doesn't solve the problem. I also tried OrdersTotal()-1, but it makes no difference. I don't know why ii++ makes everything work properly and closes all orders, for instance, 2, 5, 6 and 10, but ii-- I don't know why only 10 orders close but all the rest stay functional. Where is the problem here?

 
Andrei-1 писал(а) >>
Let's give it a try. Yes catching savchenkoandrei-ya@yandex.ru or link.

Sent by

 
xoxol писал(а) >>
How do I get an indicator to work without source code? I put it in the indicators folder but MT doesn't see it, i.e. these indicators What's wrong with them?

There are two sources and one library in the archive. You probably put the library in the wrong place, as a result indicators do not compile.

 

Hello.

Who can tell me how the code of the indicator differs from the code of the Expert Advisor.

I tried to copy the indicator code to the Expert Advisor's code and added commands to open-close orders.

The code compiles without errors, but does not start in the chart window.

What should I do to run the indicator code in Expert Advisor mode?

The indicator draws signals for entry and exit on the screen and I wanted to try binding commands for orders at those positions but it did not pass.

Whether it is possible to call the value of a variable from the indicator, which it uses in its calculations and how to access the custom indicator.

If you write iMA (...) for example, it will get data from the built-in indicator and I want it to get data from a custom indicator.

 

Vekker, you cannot use trading functions in an indicator and you cannot use indicator arrays in an EA. There are no other fundamental differences in the code, except that good indicators calculate their values only once at program start, then they just update the information. If you put it in the indicators folder and compile it, it will become an indicator for the program (not working of course :) It may not even compile, it depends on the code).

So, the solution is for your EA to read the information from the indicator, the iCustom function is used for this, read its description in the documentation. It writes the value from the indicator array for the corresponding bar in the variable you need in your EA.

Here is the description of this function https://docs.mql4.com/ru/indicators/iCustom

 

the EA cannot use indicator buffers as the indicator does,

the indicator cannot work with orders (open/change/close/delete)...


if the code is not an indicator or if the Expert Advisor is specific (what is above), i.e. does not perform its main purpose,

the difference is in availability of #property indicator_chart (#property indicator_separator) for the indicator and their absence for the Expert Advisor

 
Good afternoon. I have one question about the if statement. Let's imagine that there is the following operator in a program - if (A && B) { ... } where A and B are some conditions. It is clear that the entire logical formula is true only when each of its components is true. My question is this: does MQL check each operator for truth or does it check each component from left to right, and if there is just one false component, it will interrupt the program and return the value of its truth as false?
 

How do I get the time from a "double" value in datetime format? And is it possible to perform operations between 2 variables in datetime format? Just TimeCurrent() returns datetime, and the other functions int values.

The goal is to get a segment of the start and end of the previous day by current time, and on this segment find high and low.

 

Ether писал(а) >>
Доброго времени суток. Есть у меня один вопрос по оператору if. Представим, что в программе идет следующий оператор - if (A && B) { ... }, где A и B - некоторые условия. Понятно, что вся логическая формула истинна только тогда, когда истин каждый его компонент. Вопрос - MQL проверяет каждый оператор на истинность или все таки проверяет истинность каждой компоненты слева направо и если есть хоть одна ложная компонента, то прерывает работу и возвращает значение истинности - ложь?

Try reading it again.

Reason: