-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem with 30 mins Time frame for ^NSEI (national stock exchange of india) #1436
Comments
This is because If someone wants to solve, do this:
|
Regarding 60m - I can't reproduce, all the hourly intervals start/end at hh:15 |
I do not understand your solution. Can you please explain how to solve this in python? or, can you please provide the python code? |
I am sorry, As i recheck now, the 60 mins time frame working well. |
That's ok. Someone else will, someone familiar with |
It means, We have to wait for the update of yfinance. |
I have solved this issue.
|
There's a real bug here, leave it open. Your hack doesn't fix the underlying problem, the first interval of day is wrong. |
You are right, I didn't notice this. |
Line 726 in 7b95f55
|
Hi @AbhishekSRaut, 30min intervals for ^NSEI on YahooFinance start at HH:00 - [9:00AM; 9:30AM], [9:30AM; 10:00AM], [10:00AM; 10:30AM], ... [2:30PM; 3:00PM] 60min intervals for ^NSEI on YahooFinance start at HH:15 - [9:15AM; 10:15AM], [10:15AM; 11:15AM], [11:15AM; 12:15PM], ... [2:15PM; 3:15PM]
|
@ivan23kor Read the thread carefully, you are wrong. |
@ValueRaider you are right that As I understood @AbhishekSRaut, he wants |
No they want it aligned to HH:15. Yahoo returns this, but |
I am running this script: import yfinance as yf
print(yf.download('^NSEI', start='2023-03-03', interval='30m'))
print(yf.download('^NSEI', start='2023-03-03', interval='60m'))
print(yf.download('^NSEI', start='2023-03-03', interval='1h')) and this is the output I am getting: [*********************100%***********************] 1 of 1 completed
Open High Low Close Adj Close Volume
Datetime
2023-03-03 09:30:00 17467.300781 17495.250000 17453.099609 17485.949219 17485.949219 0
2023-03-03 10:00:00 17485.750000 17527.300781 17474.000000 17521.199219 17521.199219 0
2023-03-03 10:30:00 17520.500000 17555.849609 17516.750000 17542.099609 17542.099609 0
2023-03-03 11:00:00 17542.599609 17569.000000 17534.900391 17561.750000 17561.750000 0
2023-03-03 11:30:00 17562.150391 17578.449219 17561.050781 17566.599609 17566.599609 0
2023-03-03 12:00:00 17566.300781 17578.050781 17559.550781 17560.650391 17560.650391 0
2023-03-03 12:30:00 17559.949219 17563.949219 17535.900391 17556.199219 17556.199219 0
2023-03-03 13:00:00 17557.250000 17579.050781 17553.400391 17573.150391 17573.150391 0
2023-03-03 13:30:00 17573.449219 17607.650391 17572.699219 17598.000000 17598.000000 0
2023-03-03 14:00:00 17597.750000 17628.349609 17596.949219 17624.250000 17624.250000 0
2023-03-03 14:30:00 17623.800781 17644.699219 17615.099609 17627.400391 17627.400391 0
2023-03-03 15:00:00 17626.699219 17627.050781 17585.000000 17592.300781 17592.300781 0
[*********************100%***********************] 1 of 1 completed
Open High Low Close Adj Close Volume
Datetime
2023-03-03 09:15:00 17451.250000 17514.300781 17430.500000 17512.650391 17512.650391 0
2023-03-03 10:15:00 17513.900391 17555.849609 17508.550781 17547.849609 17547.849609 0
2023-03-03 11:15:00 17547.500000 17578.449219 17534.900391 17570.550781 17570.550781 0
2023-03-03 12:15:00 17570.550781 17575.250000 17535.900391 17561.650391 17561.650391 0
2023-03-03 13:15:00 17561.050781 17613.750000 17560.550781 17609.750000 17609.750000 0
2023-03-03 14:15:00 17609.699219 17644.699219 17587.199219 17591.900391 17591.900391 0
2023-03-03 15:15:00 17592.449219 17598.349609 17585.000000 17594.349609 17594.349609 0
[*********************100%***********************] 1 of 1 completed
Open High Low Close Adj Close Volume
Datetime
2023-03-03 09:15:00+05:30 17451.250000 17514.300781 17430.500000 17512.650391 17512.650391 0
2023-03-03 10:15:00+05:30 17513.900391 17555.849609 17508.550781 17547.849609 17547.849609 0
2023-03-03 11:15:00+05:30 17547.500000 17578.449219 17534.900391 17570.550781 17570.550781 0
2023-03-03 12:15:00+05:30 17570.550781 17575.250000 17535.900391 17561.650391 17561.650391 0
2023-03-03 13:15:00+05:30 17561.050781 17613.750000 17560.550781 17609.750000 17609.750000 0
2023-03-03 14:15:00+05:30 17609.699219 17644.699219 17587.199219 17591.900391 17591.900391 0
2023-03-03 15:15:00+05:30 17592.449219 17598.349609 17585.000000 17594.349609 17594.349609 0 which corresponds to Yahoo Finance: @AbhishekSRaut please provide your code, the output you are getting and explain what is the desired output, if not the same as finance.yahoo.com |
@ivan23kor You are presuming the data returned by Yahoo via the API matches the chart contents. Not necessarily, and not in this case. PLEASE review |
@ValueRaider @ValueRaider can you explain me what's the problem, if the output of |
Problem 1: ask Yahoo for 30m data and response is aligned to HH:15, but the 15m->downsampled->30m is aligned to HH:00, so Problem 2: first 15m interval disappears during downsampling, so the Open, High and Low of first downsampled 30m interval are wrong. |
@ivan23kor My issue is not with 60 mins time frame. |
I have solved this problem by following code:
Maybe this code can looks like complicated, but I can't make it more simplify, since, I am not professional developer or not having good skills of pandas. |
@AbhishekSRaut I'm not reviewing that code, it's awful. Pandas isn't difficult, do some tutorials, and Numpy tutorials too because I suspect you don't understand vector programming. |
Yes. You are right, I do not know vector programming. |
Impossible because this is fundamentally wrong way to fix bug. You could look inside So please don't close Issue. |
yeah, you are right. Will try... |
You are right. |
@ValueRaider, referring to the two problems you mentioned here:
@AbhishekSRaut is right that ^NSEI opens at 9:15AM and closes 3:15PM local time. However, Yahoo Finance's frontend returns HH:00 timestamps for some reason and |
I am against switching to |
I think exchange-specific code bad idea, and better fix is moving resampling to after. I don't have strong opinion on hh:00 vs hh:15. @AbhishekSRaut why do you need 30m aligned to hh:15? |
Because for ^NSEI the main time frame for 30 mins interval, starts as market starts at 9:15. not only ^NSEI, its applicable to both indian stock exchanges, "NSE" and "BSE" |
Good argument. @ivan23kor I must point out that Yahoo doing something isn't necessarily a good thing. They routinely have errors in non-US price data that |
@AbhishekSRaut thanks for pointing out the two Indian stock exchanges that have this issue. @ValueRaider the order of @AbhishekSRaut @ValueRaider I've opened #1447 to fix this issue. Let's move the conversation there. |
#2027 is merges, and solves this issue. It should be closed |
There is problem with 30 mins time frame with indian stocks.
the 30 mins time interval data is showing wrong open and close.
for example:
in nifty, the first 30 mins candle is starts from 9:15 and, ends at 9:30.
and after that it is continueing from 9:30 to 10:00.
but, because of this, our all strategies getting destroied, as normal candle starts at 9:15, and ends at 9:45.
the last candle of nifty should be of 15 mins, i.e. starts at 15:15, and ends at 15:30.
Please solve this issue as soon as possible, because due to this, our all strategies / scanner gets destroied.
Thank you.
regards,
Abhishek Raut.
The text was updated successfully, but these errors were encountered: