I throw out of the dataset all the clocks except for the right ones. There's no way to go wrong here.
Next, I just take the 5 minutes of each hour and make columns of them, sequentially
# leave only n hours in the dataset
prices = prices.drop(prices.index[~prices.index.hour.isin([first_hour,first_hour+1])])
# get the df datetime indexes objects
minute = prices.index.minute
hour = prices.index.hour
# filter df to combine hourly patterns into rows by minute and hour
grouped_prices = pd.DataFrame()
for h in range(first_hour,first_hour+2):
for i in range(0,60,5):
grouped_prices[str(i) + " " + str(h)] = prices.iloc[(minute==i) & (hour==h)].reset_index()['close']
"code - ifit's hour 5then takethe indexes from that placeand add 24 hours, those take the full two hours,and output the result"
you add by index. If the next index contains not the 5th hour but 5000006489, then you just copy it. That is, there was a skip in the right hour, and you copied the next to this skip. Although you were supposed to copy the 5-minute symbols of the needed hour, but you did not know about it.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I'm not dividing any twos there.
here's the code in normal language :Z
I throw out of the dataset all the clocks except for the right ones. There's no way to go wrong here.
Next, I just take the 5 minutes of each hour and make columns of them, sequentially
here's the code in normal language :Z
Some scribbles, ugh, it's hard to understand.
I don't understand any of the scribbles, yuck, it's not clear.
In short, the point is that if you do it right, there will be omissions because of missed quotes. They can not not be
you have to fix them with reindex
In short, the point is that if you do it right, there will be skips due to missed quotes. They can not not be
you have to fix them via reindex
I don't see them.
I don't see them.
No, I divide simply and beautifully
1) I find the beginning of the 5th hour in 5 minutes
those - 444445555 this place I get the index i
2) then I take from this index + 23 values
ii <- i:(i+23)and that's it, and I get my 2 o'clock 5 and 6, the total is 24 values
If there were some gaps, there would be other values instead of the 6th hour, because the indexes are in order
No, I divide simply and beautifully
"code - ifit's hour 5then takethe indexes from that placeand add 24 hours, those take the full two hours,and output the result"
you add by index. If the next index contains not the 5th hour but 5000006489, then you just copy it. That is, there was a skip in the right hour, and you copied the next to this skip. Although you were supposed to copy the 5-minute symbols of the needed hour, but you did not know about it.
If there were any omissions, then instead of the 6th hour there would be other ones, because my indexes are in order
The indexes are in order, but the hours are missing. How much to explain )
the indices are in order, but the hours are missing. How many times do I have to explain)
But I don't print the indices, but the hours by these indices, you see????
and I get the right cut
otherwise it would be
but I don't print the indices, but the hours according to these indices, you see????
and I get the right cut.
and the days can be different for these hours, no?
I had the same thing, that's why there were inconsistencies in the charts, and you don't have them for some reason