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

 
a.lxrn:

Good afternoon everyone, can you please help me to solve this problem, the problem is in logic, I've broken my brain today and I've come to the point where I'm in a mess.

I have written an elementary code sample, there is a signal if candle's close is bigger than waggon, one order is opened.

The signal will stay and stay true for a long time. I am sure you know what I mean,

As a matter of fact, how should I make a signal to buy open one order and that's it, until the situation changes and the close price is lower than the Mask.

I am also thinking about it, how to do it.
 
Igor Makanu:

You have the wrong task, hence the lack of understanding of how to do it.

The task should look like this: on bar 1 there is a "buy signal", while bar 2 has no such signal - it means it is a buy signal

respectively there will be a prohibition on reopening and a prohibition to trade "in the middle of the signal".

So how is it possible to do this ???
 
Igor Makanu:
the brackets can be removed, I wrote the condition for easy reading
What if the trawl works ??? Then it will start all over again !
 
Does the indicator handle need to be written in the initialisation?
 
abandoned this thread altogether
 
I don't understand why you need to get the handle first and then copy the buffer, I don't understand why the function doesn't return the indicator value at once. Probably, the data of other indicators does not fit into one variable, and they left it like that not to change it for specific indicators. Perhaps, it makes no difference where to write the intermediate handle?
 
Ivan_Invanov:
Why do I get the handle first, and then copy the buffer? I do not understand why the function does not return the indicator value at once. Maybe, the data of other indicators doesn't fit in one variable, and they left it like that to avoid re-doing it for specific indicators. Perhaps, it makes no difference where to write the intermediate handle?

there is not much difference

 
Does anyone know? #12140
 
AIGUL SALMANOVA:
And if a trawl is triggered ??? Then everything will start all over again !

Flags either control the number of order types or if there is a ticket control the closing time of the market order, if not equal to zero then the order has closed and the order opening flag is false.

 
prom18:

Please advise. I have an EA that takes data (time) from an indicator and counts the difference in milliseconds between ticks.

I output it via Alert and get the following (see picture). As I see it, first I get the total number of milliseconds and then the difference in milliseconds between the last 4 ticks (between 1 and 2, 2 and 3, 3 and 4).

Why is it like this? I only need the values for the 4th tick.


Honestly, I don't understand what you need. Write in formulas how you understand what is output and what you need.

Reason: