-
Notifications
You must be signed in to change notification settings - Fork 157
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
Forex Data not runs? #35
Comments
Hi, |
Thanks @liebig I tested again and runs OANDA for EURUSD but not for other pairs. I find this URL https://tvdb.brianthe.dev/ to search what exchange can download for any ticker and take "FX_IDC" for all forex pairs and runs ok. But I've another problem, I use a for loop to download many tickers and when one ticker can't download returns "ERROR:tvDatafeed.main:no data, please check the exchange and symbol" and stop the loop. Should print the error message but continue with other pairs. At the moment I am deleting the problematic tickers but it is a heavy work for any market. Any idea to protect this problem? |
A loop should actually work, as no error is thrown here, only an error message is logged. This is roughly what my loop looks like: for symbol in symbols:
logger.info(f"Download {symbol} from {exchange} for {interval} interval and {bars} bars")
hist_df = tvl.get_hist(symbol,
exchange,
interval=Interval(interval),
n_bars=bars,
fut_contract=None,
extended_session=False)
if hist_df is None or hist_df.empty:
logger.error(
f"Could not download data for {symbol} from {exchange} for {interval} interval and {bars} bars")
continue
hist_df.to_csv(basename, index=True) Currently I use my fork of this library to get more historical data via Pro membership and to save the login token as token.txt and not always have to log in again. EDIT |
Thanks for your answer. My loop error is when can't download one ticker data, the lib stops the loop and not continue with next tickers (this tickers exist in TV) but returns error. I deleted manually this conflictive tickers and now runs perfect for all TV pairs, about 2000. I made a reduced list with majors, minors and exotics pairs with 115 results and it is enought in my app for forex marquet. |
Hi team,
I find this excellent lib today and I'm testing it with my PRO TV account and runs for stocks, crypto or futures but not for forex pairs.
I didn't found any example for forex pair in the guide and I'm testing with majors pairs like EURUSD and not run in any exchange (FXCM, ICE, OANDA, etc)
Print this error in the terminal:
I'm using this code to get EURUSD FX data:
eurusd_data = tv.get_hist(symbol='EURUSD',exchange='FXCM',interval=Interval.in_daily,n_bars=10000)
Can be an issue or forex needs other code?
Thanks a lot.
The text was updated successfully, but these errors were encountered: