Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Can't plot using fetch_csv (Research)
def initialize(context):  
    fetch_csv('https://drive.google.com/uc?export=download&id=11_c99NLukD2SDevj9QNmf7NTLE67wxkx',  
             date_column='Local time',  
             date_format='%d.%m.%Y %H:%M%S',  
             symbol='EURUSD')

def handle_data(context, data):  
    if 'Close' in data['EURUSD']:  
        my_data = data['EURUSD']['Close']  
        record(my_data=my_data)  

I added direct download link from Google Drive and I'm positive that the date format is correct, too. But the code returns nothing. Anyone know where the problem might be?

Also, the data looks like this:

Local time,Open,High,Low,Close,Volume  
01.01.2015 00:00:00,1.20969,1.20976,1.20969,1.20976,1500  
1 response

Hi Mario,

When obtaining the link to this file, could you make sure you change the 'web page' option to 'comma-separated values (.csv)' before clicking Publish and pasting the resulting URL into the fetcher query? The exact steps on how to import files from google drive can be found here.

If this doesn't work, you could use the optional parameters pre_func and post_func to test the dataframe obtained from the fetcher query. You can create and pass in the name of a function to pre_func that returns the dataframe before it is processed by Fetcher, and observe if the raw data's contents are what you want. You can also create and pass in the name of a function to post_func that will return the dataframe after it has been processed by Fetcher and undergone any calculations you include in the function. If you simply return the dataframe in both pre_func and post_func functions without performing any calculations, observing the differences in output could isolate in what part of the process the code returns null.

I hope this helps!

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.