yacoubb / stock-trading-ml

A stock trading bot that uses machine learning to make price predictions.
GNU General Public License v3.0
612 stars 254 forks source link

error #4

Open sander655 opened 5 years ago

sander655 commented 5 years ago

(venv) C:\Users\sander\PycharmProjects\autotrader>python save_data_to_csv.py usage: save_data_to_csv.py [-h] symbol {intraday,daily,daily_adj} save_data_to_csv.py: error: the following arguments are required: symbol, time_window

zedb123 commented 5 years ago

just create a csv file with header date , open , high , low , close , volume (obviously with data in it !) and just run tech_ind_model .. should all be fine ..

XyzzyX44 commented 4 years ago

The correct way to run is: python -m save_data_to_csv.py [stock Symbol] [daily] replace [stock Symbol] with MSFT for example for microsoft or TSLA for Tesla replace [daily] with daily, intraday, or daily_adj depending on the type of data you want. I use daily. so my command would look like: python -m save_data_to_csv.py MSFT daily --Hope that helps. -- Also be sure that you have your API key stored in "creds.json" I really don't see how zedb123's comment helped at all. I realized I had used right and left carrots to enclose arguments, and they didn't show - the comment must have thought them html tags, lol. I have updated my answer to be better, sorry, hehe

Eccedustin commented 4 years ago

@XyzzyX44 I am having a bit of trouble running it still. I can't figure out your directions to run it in Pycharm. Could you advise?

When running in Pycharm Terminal I get this error:

Error while finding module specification for 'save_data_tocsv.py' (ModuleNotFoundError: _path__ attribute not found on 'save_data_to_csv' while trying to find 'save_data_to_csv.py')

XyzzyX44 commented 4 years ago

@Eccedustin Running in pycharm venv terminal is different-- run it from there like this.

save_data_to_csv.py [stock Symbol] [daily]

replace [stock Symbol] with MSFT for example for microsoft or TSLA for Tesla replace [daily] with daily, intraday, or daily_adj depending on the type of data you want. I use daily.

so my command would look like: save_data_to_csv.py MSFT daily

You would not be able to run it directly in pycharm as it takes arguments. Run it from the terminal tab at the bottom as above. When running from pycharm venv, you cannot call python -m module.py, pycharm is not set up like that. I have updated the answer on this post for pycharm specific answer. Also you would want to make sure that your venv includes all of the modules, and that you have your API key from alpha_vantage.com saved in the creds.json file. Modules to include in the venv: alpha_vantage pprint import time datetime os json

Eccedustin commented 4 years ago

How would you do it in Google colab? That's what I'm using currently.

XyzzyX44 commented 4 years ago

I am not familiar with google colab.

On Tue, Aug 11, 2020, 19:18 Eccedustin notifications@github.com wrote:

How would you do it in Google colab? That's what I'm using currently.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yacoubb/stock-trading-ml/issues/4#issuecomment-672470494, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7WPTWTR5DHETNH3553L7LSAH3WJANCNFSM4JA3UEDA .