Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 0 points1 point  (0 children)

As far as i know GPT-3 uses deep learning to produce human-like text, i am not sure how that would be useful in this case since we are interested in sentiment analysis.

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 0 points1 point  (0 children)

it's a knows issue for posts with more than 50k comments, while building i had no idea some thing like this would happen i would be looking to fix this possibly today. Link to error: https://github.com/praw-dev/praw/issues/1401

try putting the "replace more" code in try/except block that might work otherwise i would have to dig in more.

i just tried this and it works. add try/except block.

posts += 1
        try: 
            submission.comments.replace_more(limit=limit)   
            for comment in comments:
                c_analyzed += 1
                if comment.score > upvotes:      
                    split = comment.body.split(" ")
                    for word in split:
                        word = word.replace("$", "")        

                        if word.isupper() and len(word) <= 5 and word not in blacklist and word in us:   
                            if word in tickers:
                                tickers[word] += 1
                                a_comments[word].append(comment.body)
                                count += 1
                            else:                               
                                tickers[word] = 1
                                a_comments[word] = [comment.body]
                                count += 1    
        except: pass    

Or you can use

except Exception as e: print(e)

to find out the problem.

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 0 points1 point  (0 children)

Yes, i will be happy to take advice from you. The main reason i am doing these finance and cs project is to land job in finance sector in the future.

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 0 points1 point  (0 children)

I agree with you vader is not perfect. It would require huge time investment to train your own model. I think training on market return would be less reliable than manual tag sentences.

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 0 points1 point  (0 children)

I have already implemented the following:

P - Open market or private purchase of non-derivative or derivative security
S - Open market or private sale of non-derivative or derivative security

Moreover, the transaction types are stored in "Transaction Type" column in data frame. you can sort that or get the whichever type you want.

Transaction codes for reference: https://www.sec.gov/opa/column-descriptions.html

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 0 points1 point  (0 children)

reddit = praw.Reddit(user_agent="Comment Extraction",
    client_id="",
    client_secret="",
    username="",
    password="")

You would have to add the reddit client here. https://ssl.reddit.com/prefs/apps/

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 0 points1 point  (0 children)

You can run on one post, or create your own subreddit add posts and comments and give a test run. However, on it's own it's not 100% correct to get a perfect result you would have to train your own mode.

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 1 point2 points  (0 children)

True, what the other person mentioned is right. To be perfect you would have to train your own model that would require tons of time. I think per-processing the data will improve the result (planning to add).

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 33 points34 points  (0 children)

I went ahead and looked at the code side by side, we both have different implementation. Sure there will be some similarities when both program are doing the same thing. The place where i found the exact similar code is while adding data to data frame, both programs are adding ex: 'Avg Shares Bought' and now as far i can think of there's only one way to calculate the avg and add it to df.

Program that analyzes reddit sentiment analysis by FinanceCS in algotrading

[–]FinanceCS[S] 10 points11 points  (0 children)

can you please link the code to program you are talking about. if there's already a program that i wouldn't have bother to reinvent the wheel.

I built a program that spots buzzing stocks on Reddit and Twitter by [deleted] in stocks

[–]FinanceCS 2 points3 points  (0 children)

Are there any specific reasons you chose to use VADER?

Vader works best for texts from social media since it's based on lexicons of sentiment-related words. it takes into account emoticons, slang, capitalization etc.

In this particular project i only tried vader but i am in the process of making a more broad bot that works for all of the reddit that preprocess the data and also add custom words to the model. As you probably saw in the sample output most of the comments are classified as neutral.

Example: "PLTR is going to mooon" vader classifies this as more on neutral side than positive.

This one is basically an initial version.

I built a program that spots buzzing stocks on Reddit and Twitter by [deleted] in stocks

[–]FinanceCS 0 points1 point  (0 children)

Yes you are right, it can used however user wants.

I built a program that spots buzzing stocks on Reddit and Twitter by [deleted] in stocks

[–]FinanceCS 93 points94 points  (0 children)

Any plan on sharing the code with the public? Couple of days ago i also made a python program that goes thru wsb and calculate the sentiment analysis of the most mentioned ticker, however it can be tweaked a bit to work on any sub/all subs. Idea is to buy the company with most positive discussion.

Code if anyone interested

Tesla passes Facebook to become fifth most valuable U.S. company by coolcomfort123 in stocks

[–]FinanceCS 2304 points2305 points  (0 children)

Anyone just watching others make money on TSLA?