Git Product home page Git Product logo

autodd_rev2's People

Contributors

drsig avatar gobbedy avatar kaito1410 avatar napo2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autodd_rev2's Issues

Definition of key_stats_measures is missing

It looks like in the latest code the definition of key_stats_measures dict disappeared which is causing an error when running. I added it back in at lines 64/65 and everything worked as it should.

Returning Empty Tables

I am not sure what happened. The program was working perfectly until I tried to use it today. Now it just returns nothing. I attempted a new install and it still reproduced the same result. There are no error logs so it's a little difficult to isolate the problem.

Screen Shot 2021-01-27 at 12 24 46 PM

Has Reddit changed something on their end?

Yahoo 403 Client Error: Forbidden URL

Kaito, you are the patron saint of day-traders and swing-traders!

It seems, Yahoo pushed our nose to the glass:
image

I hope you can resolve it. 🤘🏼

Division by zero exception found

Hi,

found this exception by running script today(13:00 CET, 2020/1/26 on Win10).

Getting submissions...
Searching for tickers...
Populating results...
Counting rockets...
Getting quick stats...
Traceback (most recent call last):
  File "main.py", line 101, in <module>
    main()
  File "main.py", line 92, in main
    results_tbl = getQuickStats(results_tbl)
  File "C:\Users\Rado\Desktop\AutoDD\AutoDD_Rev2-main\AutoDD.py", line 489, in getQuickStats
    change_50day = ((float(price) - float(avg50day))/float(avg50day))*100
ZeroDivisionError: float division by zero

My temporal "fix" was:

 if price is not None and price != 0:
                if avg50day > 0:
                    change_50day = ((float(price) - float(avg50day))/float(avg50day))*100
                else:
                    change_50day = 0

on line 489 in AutoDD.py

fiftyDayAverage not returned by yahoo, causes error

I just tried the code, it's awesome!

Although I just tried to run this command:
main.py --interval 2 --sub wallstreetbets

And got this error output:

Traceback (most recent call last):
  File "C:\Users\guillaume\PycharmProjects\AutoDD_Rev2\main.py", line 101, in <module>
    main()
  File "C:\Users\guillaume\PycharmProjects\AutoDD_Rev2\main.py", line 92, in main
    results_tbl = getQuickStats(results_tbl)
  File "C:\Users\guillaume\PycharmProjects\AutoDD_Rev2\AutoDD.py", line 491, in getQuickStats
    if avg50day > 0:
TypeError: '>' not supported between instances of 'NoneType' and 'int'

After some debugging I was able to narrow it down to the ticker "WIN" for which yahoo does not return 'fiftyDayAverage'. I wrote a little standalone to isolate the error:

from yahooquery import Ticker
ticker=Ticker('WIN')
data=ticker.summary_detail.get('WIN')
if data.get('fiftyDayAverage') is None:
    print("Houston...")

I doubt "WIN" was meant as a stock ticker in the reddit submission, but regardless, it is a valid ticker, so this error should not occur?

In the meantime I added "WIN" to the list of banned words locally. Works as a temp fix.

Table Columns Incorrect

python3 main.py --allsub

Maybe I am missing something in the documentation but I don't believe the numbers in specific columns are adding up correctly. For example, the price of ZOM has never been 186. (It looks like price is under Industry???)

Is this a bug?

Screen Shot 2021-01-13 at 3 17 10 PM

undercounting of symbols?

I just went through your code, I love it and will try my hand at using it tomorrow.

I just found what seems to be an undercounting of tickers:

        # title_extracted is a set, duplicate tickers from the same title counted once only
        for k in title_extracted:

            if k in all_dict:
                all_dict[k] += increment
            else:
                all_dict[k] = increment

        # avoid counting additional point for the tickers found in the text body
        # only search the text body if ticker was not found in the title
        if len(title_extracted) > 0:
                continue

        for m in selftext_extracted:

            if m in all_dict:
                all_dict[m] += increment
            else:
                all_dict[m] = increment

Doesn't the above miss out on instances when a ticker appears in the selftext but not in the title? (eg say the title contains AAPL and the selftext contains MSFT, it would skip MSFT).

Since rocket_tickers is already a set, shouldn't the above be replaced by the following?

        for k in rocket_tickers:

            if k in all_dict:
                all_dict[k] += increment
            else:
                all_dict[k] = increment

Thanks again for sharing this code.

error if no selftext

Me again :)

I just got this error:

Traceback (most recent call last):
  File "C:\Users\guillaume\PycharmProjects\AutoDD_Rev2\main.py", line 101, in <module>
    main()
  File "C:\Users\guillaume\PycharmProjects\AutoDD_Rev2\main.py", line 65, in main
    prev_tbl, prev_rockets = get_freq_list(results_from_api[1])
  File "C:\Users\guillaume\PycharmProjects\AutoDD_Rev2\AutoDD.py", line 171, in get_freq_list
    rocket_tickers = selftext_extracted.union(title_extracted)
UnboundLocalError: local variable 'selftext_extracted' referenced before assignment

I assume this happens when there is no selftext. Easy fix is to add the line pointed to below

        # search the text body for the ticker/tickers
        selftext_extracted = set()   # <------------- INSERT
        if hasattr(i, 'selftext'):
            selftext = ' ' + i.selftext + ' '
            selftext_extracted = set(re.findall(pattern, selftext))

Issue running on Ubuntu/macOS

Hey there,

I'm getting the following error trying to run the main.py on both Ubuntu and macOS.

Traceback (most recent call last):
  File "main.py", line 101, in <module>
    main()
  File "main.py", line 98, in main
    print_tbl(results_tbl, args.filename, args.allsub, args.yahoo, args.csv)
  File "/app/auto-dd/AutoDD.py", line 378, in print_tbl
    writer.writerow(row)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2014' in position 87: ordinal not in range(128)

Do you have any idea on what I can do to get it running? It seems to have trouble printing the table after gathering the data. I can get it running on Windows though.

Thanks in advance!

redundancy?

Am I right that or row[1][1] >= min_val is redundant in the code below?

tbl = [row for row in tbl if row[1][0] >= min_val or row[1][1] >= min_val]

If I'm not mistaken row[1][0] is the total score (prev + current) for the ticker, and row[1][1] is the current score.

I'm removing the redundant part in my version of the code, just making sure I haven't misunderstood something?

issue with rocket count?

Hello,

rockets seem to be counted in an odd way. Let's take an example. Suppose a reddit submission has the following title:
"PLEASE BUY AAPL, MSFT, GME NOW"

then for that submission you would have

rocket_dict['PLEASE'] += 6
rocket_dict['BUY'] += 6
rocket_dict['AAPL'] += 6
rocket_dict['MSFT'] += 6
rocket_dict['GME'] += 6
rocket_dict['NOW'] += 6

Shouldn't it be +=1 for each one?

Could you please clarify what rockets count?

PS. I should have finished the refactored code by Monday or so if you're interested. Speedup is in the order of 100x when there are many tickers.

Error Code 429 pushshift.io

On first time running, recieve the following:

C:\Users*\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\psaw\PushshiftAPI.py:192: UserWarning: Got non 200 code 429
warnings.warn("Got non 200 code %s" % response.status_code)
C:\Users\Shokkatweej\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\psaw\PushshiftAPI.py:180: UserWarning: Unable to connect to pushshift.io. Retrying after backoff.
warnings.warn("Unable to connect to pushshift.io. Retrying after backoff.")

And then stalls at 'Getting quick stats...'

Running with -sub wallstreetbets slow

Hi there,

First of all thank you for your excellent work.

Running main.py with wallstreetbets sub option is incredibly slow. My thought is that because of the huge dataset, but processing one entry a second is not ideal.

Thank you frou your app.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.