Skip to content

πŸ—„οΈ Analysis and Summary of US Stock Market Sentiment Indicators and Market Data

Notifications You must be signed in to change notification settings

NE7K/UpStock-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

134 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“– Overview

λ―Έκ΅­ μ¦μ‹œλŠ” μ†Œμ…œ λ―Έλ””μ–΄μ˜ λ°œλ‹¬λ‘œ 인해 정보 ν™•μ‚° 속도가 κ·Ήλ„λ‘œ 빨라쑌으며, 단일 λ‰΄μŠ€ κΈ°μ‚¬λ‚˜ νŠΈμœ—μ΄ 단기적인 변동성을 μœ λ°œν•˜λŠ” 사둀가 λΉˆλ²ˆν•˜κ²Œ λ°œμƒν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. 이에 λ³Έ ν”„λ‘œμ νŠΈλŠ” λ‰΄μŠ€, λΈ”λ‘œκ·Έ, λŒ“κΈ€ λ“±κ³Ό 같은 λΉ„μ •ν˜• 데이터λ₯Ό μžμ—°μ–΄ 처리 기반 인곡지λŠ₯ λͺ¨λΈμ„ ν™œμš©ν•΄ λΆ„μ„ν•¨μœΌλ‘œμ¨, μ‹œμž₯ μ°Έμ—¬μžλ“€μ˜ 심리적 λ°˜μ‘μ„ μ •λŸ‰μ μœΌλ‘œ ν‰κ°€ν•©λ‹ˆλ‹€.

더 λ‚˜μ•„κ°€, λ‹¨μˆœν•œ 감성 뢄석을 λ„˜μ–΄ μ‹œμž₯ 고평가/저평가 μ—¬λΆ€λ₯Ό λ°˜μ˜ν•˜λŠ” VIX 변동성 μ§€ν‘œ, κ³Όλ§€μˆ˜Β·κ³Όλ§€λ„ νŒλ‹¨μ„ μœ„ν•œ RSI λ³΄μ‘°μ§€ν‘œ, 이동평균선 기반 μΆ”μ„Έ μ§€ν‘œ 등을 ν†΅ν•©μ μœΌλ‘œ κ³ λ €ν•©λ‹ˆλ‹€. 이λ₯Ό 톡해 μ‹œμž₯ 심리λ₯Ό 0μ—μ„œ 100 μ‚¬μ΄μ˜ κ°’μœΌλ‘œ ν™˜μ‚°ν•œ Market Sentiment Indexλ₯Ό μ‚°μΆœν•©λ‹ˆλ‹€.

λ³Έ μ‹œμŠ€ν…œμ€ μ „λ¬Έ 투자 지식이 λΆ€μ‘±ν•œ 개인 투자자뿐 μ•„λ‹ˆλΌ, μ‹œκ°„ μ œμ•½μœΌλ‘œ 인해 μ‹œμž₯ λͺ¨λ‹ˆν„°λ§μ΄ μ–΄λ €μš΄ νˆ¬μžμžλ“€μ—κ²Œλ„ μ‹€μ§ˆμ μΈ μ˜μ‚¬κ²°μ • 보쑰 λ„κ΅¬λ‘œ κΈ°λŠ₯ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

The U.S. stock market has become highly sensitive to the rapid spread of information driven by the rise of social media, where a single news article or tweet can frequently trigger short-term volatility. To address this, the project leverages a natural language processing (NLP)–based artificial intelligence model to analyze unstructured data such as news articles, blogs, and comments, thereby quantifying market participants’ psychological responses.

Beyond sentiment analysis alone, the system also incorporates key market indicators, including the VIX volatility index to capture overvaluation and undervaluation, the RSI oscillator to identify overbought and oversold conditions, and moving averages to assess price trends. These elements are integrated to calculate a Market Sentiment Index, expressed as a numerical value ranging from 0 to 100.

This system is designed not only for individual investors with limited expertise in financial indicators but also for those constrained by time, providing a practical decision-support tool to better understand the prevailing psychological state of the U.S. stock market.

Project file structure

upstock-python/
│── upstock/
β”‚   β”‚
β”‚   β”œβ”€β”€ builders/
β”‚   β”‚   β”œβ”€β”€ pipeline.py            # pipline builder
β”‚   β”‚
β”‚   β”œβ”€β”€ indicators/
β”‚   β”‚   β”œβ”€β”€ core.py                # calculation logic
β”‚   β”‚   β”œβ”€β”€ indexer.py             # Indicator indexing/management
β”‚   β”‚
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ artifacts.py           # Model artifact management
β”‚   β”‚
β”‚   β”œβ”€β”€ nodes/
β”‚   β”‚   β”œβ”€β”€ predict.py             # Predict node -> News predict part, market predict part
β”‚   β”‚   β”œβ”€β”€ train.py               # Train node
β”‚   β”‚
β”‚   β”œβ”€β”€ storage/
β”‚   β”‚   β”œβ”€β”€ downloader.py          # Data download management
β”‚   β”‚   β”œβ”€β”€ market_data.py         # Stock Data Processing
β”‚   β”‚
β”‚   β”œβ”€β”€ config.py                  # Environment
β”‚
│── main.py                        # Main entry point

πŸ“ Data Set : Dataset used in the sentiment model

Text Label
ANA with the conference tomorrow, I guess we will hit 10.05 after all... 1
NFX - hearing PJCO out cautious following comScore data: Following Weak December, Overall 4Q Traffic Again Turns Negative user 0
se pullback 2 initiate quick trades, not invest, long. Keep stops tight & sell up. AAP EGN OCN AMH DDD NSM 1
Piper Jaffray making negative comments on NFX and CST ed Box : comScore Q4 data weak for edbox, Netflix 0
Maybe a good time to buy TD the 44 level appears to be holding as a key support level 1
CSN option trader buys 1,500 of the Jan 11-16 call spread against low OI indicating entering a position for .50. Bet on data bef. Jan 19 1
AA there goes the kids college fund! 1

Sentiment Model Training result and history

Epoch Loss Accuracy Val Loss Val Accuracy
1 0.6352 0.6516 0.5148 0.7498
2 0.3841 0.8314 0.4343 0.8007
3 0.1724 0.9359 0.5599 0.7869
4 0.0806 0.9743 0.7665 0.7826
5 0.0433 0.9853 0.9666 0.7627

Early Stopping: Best epoch β†’ 2

Sentiment Model summary()

Layer (type) Output Shape Param #
InputLayer (None, 141) 0
Embedding (None, 141,128) 1,304,192
Bidirectional(LSTM) (None, 141,128) 98,816
GlobalMaxPooling1D (None, 128) 0
Dense (None, 64) 8,256
Dropout (None, 64) 0
Dense (None, 32) 2,080
Dense (None, 1) 33

Total params: 1,413,377 (5.39 MB)
Trainable params: 1,413,377
Non-trainable params: 0

System configuration diagram

system diagram

Predict result saved in Supabase Table

예츑 κ²°κ³ΌλŠ” News Sentiment와 Market Sentiment Index ν…Œμ΄λΈ”λ‘œ λ‚˜λˆ„μ–΄μ„œ μ €μž₯되고 λ³΄κ΄€λ˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

News Sentiment Table

SELECT text, percent, label FROM news_sentiment LIMIT 10
text percent label
Dow jumps 400 points to record as August inflation increase likely won't derail Fed rate cut 0.0548475 negative
Dow jumps and S&P touches all-time high while Treasury yields fall as Wall Street reacts to rising inflation and jobless claims 0.25916 negative
The Fed’s 2% inflation target might not be hit for years, says Janus portfolio manager β€” unless there’s a recession 0.295348 negative
Dow, S&P 500 and Nasdaq push deeper into record territory 0.88824 positive
Stocks, Bonds Rise as Data Seal September Fed Cut: Markets Wrap 0.813471 positive
Mexico hikes China auto tariff, S. Korea warns on US investment 0.141901 negative
Stocks, Gold Set New Records in Run-Up to Fed Meet: Markets Wrap 0.821933 positive
Vietnam Urges US to Rethink Seafood Ban as Trade Talks Grind On 0.212265 negative
Stocks climb toward record closes 0.813072 positive
Shell LNG Plant Wins Place on Carney’s List of Favored Projects 0.924645 positive

Market Sentiment Index Table

SELECT date_utc, score, zone, rsi, vix, macd_val FROM market_sentiment_index LIMIT 10
date_utc score zone rsi vix macd_val
2025-09-18 58 Neutral 67.892115296438 15.5600004196167 6.48942949393609

πŸ–₯️ Training environment

Tensorflow 2.10

Cpu : AMD 5600
Ram : 32GB
Gpu : RTX 4060 8GB

WBS

WBS

Flow

Flow

πŸ“§ Contact

For questions or feedback, please contact NE7K or NeighborSoft.

About

πŸ—„οΈ Analysis and Summary of US Stock Market Sentiment Indicators and Market Data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages