ranaroussi / quantstats

Portfolio analytics for quants, written in Python
Apache License 2.0
4.73k stars 827 forks source link

Download Returns with Proxy Server #294

Closed MuslemRahimi closed 8 months ago

MuslemRahimi commented 1 year ago

Hi,

I have the issue that I want to run my python code

import quantstats as qs
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--ticker', type=str, required=True,
                    help='Type the ticker for comparison')

args = parser.parse_args()
ticker = args.ticker

# Fetch the daily returns for a stock

stock = qs.utils.download_returns(ticker)

df = qs.reports.metrics(stock, 'SPY', mode='full', display=False)
print(df)

on my linux VPS Server.

However, Im not sure how to setup a proxy server in order to make download_returns(ticker) work?

If anyone can help me out I would appreciate it alot.

Thanks

djl0 commented 1 year ago

So you're having trouble downloading the returns, or downloading the final report? If the latter, probably easier to write it to a file using the html function with output = local_path, then scp the html report off the server.

MuslemRahimi commented 1 year ago

no what i meant is i cant do "stock = qs.utils.download_returns(ticker)" on my VPS Server. for that i need a proxy but i dont know how to do this

brubrant commented 1 year ago

I suggest you create a notebook and try to download some datt using yfiance (or something else) to check if the problem is really this.

If it is, then you should check this with your VPS provider.

On Mon, 21 Aug 2023 at 04:45, Muslem Rahimi @.***> wrote:

no what i meant is i cant do "stock = qs.utils.download_returns(ticker)" on my VPS Server. for that i need a proxy but i dont know how to do this

— Reply to this email directly, view it on GitHub https://github.com/ranaroussi/quantstats/issues/294#issuecomment-1685819741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGFM4UHKPUKYTXM26FGZHLXWMGYTANCNFSM6AAAAAA3TFNCNE . You are receiving this because you are subscribed to this thread.Message ID: @.***>