Skip to content
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

Date range not fully pulled by get_data_yahoo #1

Closed
focussedmonk opened this issue Sep 25, 2021 · 2 comments
Closed

Date range not fully pulled by get_data_yahoo #1

focussedmonk opened this issue Sep 25, 2021 · 2 comments

Comments

@focussedmonk
Copy link

THE BELOW CODE IS RUNNING

  • BUT WHEN YOU RUN THE TICKER TABLE SEPERATELY, THE LAST FEW DATES ARE ONLY GETTING PULLED AND NOT ALL 10 DAYS - SO THE RESULT EVENTUALLY IS FALSE.

THE DATE RANGE IS BETWEEN 9/13 - 9/24....but only the last 4 days data is getting pulled ??

`import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import datetime as dt
import statistics
import yfinance as yf

import pandas_datareader.data as web

stock_data = {
'Eicher': 'eichermot.ns',
'Nestle': 'nestleind.ns'}

yf.pdr_override()
start = dt.datetime(2021,9,13)
end = dt.datetime.now()
#end = datetime.datetime.now()

for name, ticker in stock_data.items():

ticker = web.get_data_yahoo(ticker, start, end)


for day in ticker:

    ticker['True_Range'] = (ticker['Adj Close'].shift(1) - ticker['Low'])
    
    ticker.dropna(inplace=True)
    
    weekly_dynamic_sigma = 1.5 * statistics.pstdev(ticker['True_Range'])
    mean_tr = statistics.mean(ticker['True_Range'])
    gap = mean_tr + weekly_dynamic_sigma      


    prev_close = ticker['Adj Close'][-1]
    current_price = ticker['Adj Close']
    Buy_Zone = ticker['Adj Close'][-1] - gap
    

print(f'\t~~~~~~~~~~\n\tBUY  zone:  {Buy_Zone.round(2)}\n\t~~~~~~~~~~\n')`
@orville-wright
Copy link
Owner

I think you've got the wrong github project with this issue submission. It looks like you your issue is against the YFINANCE python module, based on your code snippet (import yfinance as yf). My app (ticker_data) is works with finance.yahoo.com as one of its data sources (but not exclusively). The yfinance module (by https://pypi.org/user/ranaroussi) singularly focuses on Yahoo Finance only.
I think you should re-submit your GitHub issue to the yfinaince project team here: https://github.com/ranaroussi/yfinance

@focussedmonk
Copy link
Author

Thank you for the detailed feedback and reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants