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

 
ANDREY:

Thank you for your answer. What accuracy is there. And how do you know the time of formation of a candle's low with the accuracy that is?

For example, if on the candlestick N10 an order is opened, how to know whether it was opened before the formation of the minimum of this candle, or it was opened after the formation of the minimum of this candlestick.
Thank you.

decent brokers have an archive of tick history for each symbol (and type of account).
Go in, download, find the tick.

 
ANDREY:

Thank you for your answer. What accuracy is there. And how do you know the time of formation of a candle minimum with the accuracy that is there?

For example, if on a candlestick N 10 an order is opened, how to learn it was opened before the formation of the minimum of this candlestick, or it was opened after formation of the minimum of this candlestick.
Thank you.
It depends on the bar price used for the calculation. If opener, then at the time of the opening of the zero bar, if cloze, high, low, then at the time of closing of the zero bar. High Low prices are fixed when the bar closes.
Yupd. Nothing can open on candle 10 anymore. This candle is already in the past)
 
Valeriy Yastremskiy:
Nothing can open on candle 10 anymore. That candle is already in the past)

I agree that it is in the past. But once it was the zero candle, and it was then that the order was opened on it. At the current moment, this candlestick (on which the order was opened) is the tenth.
How do I know if the order was opened on it when it was a zero candle, was it opened before its low , or after its low ? At the current moment, this candle, on which the order was opened, is now the tenth. So I need to know what happened on the tenth candle at the time it was a zero candle. Of course, nothing can happen on the tenth candle. It can only happen when it was a zero candle. But one should know what happened not at the moment when it was a nought candle but when it was the tenth.

There can be two variants.

1. After the opening of the zero-minute candle, the price within the minute candle goes down first and forms the minimum of this minute candle, and then goes upwards and opens an order and does not fall below the formed minimum in the future. That is, the order will open after the formation of the minimum of this candle
2.After the opening of a zero-minute candle, the price within a minute candle goes up first, opens the order, and then goes down and forms the minimum of the minutecandle.

For example, the last order I had opened 10 minutes ago (i.e. conditionally on the tenth candle).

Thanks for the help.

 

ANDREY:

And now I need to know if it opened before the low of the candle, which is now the tenth, or after

Create an"Object Text" with a maximum or minimum price time

 
MakarFX:

Create a "Text Object" with a maximum or minimum price time

Thanks for the tip. But what you suggest is from mql5 . Will it work on mql4?
And then .... I don't need information for my eyes which will be contained in TEXT object, but information for program code
Thanks for the help.

 
ANDREY:

Thanks for the tip. But what you suggest is from mql5 . Will it work on mql4?
Thanks for the help.

It works, I do not know mql5 at all.

In brief, the point is

If price of a marker is higher than low, then price of a marker equals low and text of a marker equals time.

 
ANDREY:

Thank you very much. And did I understand correctly that checking this ratio will happen on every tick?

".... if the price of the tick is greater than low....." QUESTION Greater than the low of which candle? Is it zero or tenth?


Thank you for your help.

You can determine the time of price change to the second on the history only if you have a tick history, but in real time, the time of minimum price will be fixed in the marker above/below each candle and after any amount of time (provided that the terminal was not shut down) will be visible on each candle the real time of min/max price.


As in this picture, only time and not price


 
MakarFX:

You can determine the time of price change to the second on the history only if you have a tick history, but in real time, the time of minimum price will be fixed in the marker above/below each candle and after any amount of time (provided that the terminal is not switched off) will be visible on each candle the real time of min/max price.


As on this picture, but time and not price


Got it. Thanks a lot for the help. No further questions.

 
ANDREY:

Thank you very much. And did I understand correctly that checking this ratio will happen on every tick?

".... if the price of the tick is greater than low....." QUESTION Greater than the low of which candle? Is it zero or tenth?


Thank you for your help.

You have the task of getting the time of the Hai and Low. The timeseries only has the bar creation time. So in the current time you need to zero the maxhai, minlow assign a value of 10000 and every tick of maxhai and minlow compare with the current one for more less and if more then assign a value of maxhai and remember the time of maxhai. And in the same way with minlou if less. In this way you get the real time of highest and lowest price at each bar if needed or reset all of them and get the data at the 1st bar. And if you have a market order open, then remember the time data and compare it with the time of bar opening. And remember the result. And when the bar is 10m, you will see the result.) You don't have orders on every bar.

yupd. maxhai and minlow are better made global variables.
 
Valeriy Yastremskiy:

You have the task of getting the times of Hay and Low. The timeseries only has a bar creation time. So in the current time you have to zero the maxhai, assign the minlow to 10000 and compare every tick of maxhai and minlow with the current one for more less and if more, assign the maxhai value and remember the maxhai time. And in the same way with minlou if less. In this way you get the real time of highest and lowest price at each bar if needed or reset all of them and get the data at the 1st bar. And if you have a market order open, then remember the time data and compare it with the time of bar opening. And remember the result. And when the bar is 10m, you will see the result.) You don't have orders on every bar.

yupd. maxhai and minlow are better to make global variables.


But I have one more question concerning this subject.
An order is opened on a minute candle at X price. After a few seconds, on the same candlestick, one more order is placed at the price of X+2 points. Between the two points X and X+2, there is a price low.
I need to find out the low. If we deal with different candlesticks, I would use the iLow and iLowest functions
but these functions must specify bars as interval bounds. But my interval bounds are not bars, but the X and X+2 prices because there is only one bar.
I know how to find the minimum I need. But to do it, I need to track the price value on every tick. I also know how to do it with a cycle at the time of X+2. And how to do it all at once at the time of X+2 as in the case of iLow andiLowest.
I would be very grateful if you could teach me how to do this.
Thanks