Skip to content

RUEI4341/Bottom-Detect

Repository files navigation

Bottom Detection Project

This repository provides a Python-based pipeline to train a deep learning model and determine whether today is a potential price bottom for a given Taiwan stock ticker.


1. Environment Setup

1.1 Create Python Virtual Environment

Make sure you have Python 3.9 or newer installed.

python3 -m venv venv

1.2 Activate the virtual environment:

macOS / Linux:

source venv/bin/activate

Windows:

venv\Scripts\activate

2. Install Dependencies

Upgrade pip first:

pip install --upgrade pip

Install required packages:

pip install -r requirements.txt

3. Run the Project

Execute the main entry script with a Taiwan stock ticker:

python run.py 2317

What happens automatically:

  • Downloads historical price data (if not already cached)
  • Trains the model (if no checkpoint exists)
  • Evaluates the trained model
  • Runs inference for today
  • Prints whether today is a bottom signal

4. Output Example

Ticker: 2412
Predicted reward: -0.6329
Bottom today: False
Bottom strength: -0.1266

5. Notes

  1. Price data is cached under data/prices/
  2. Trained models are saved under checkpoints/
  3. Re-running the same ticker will reuse cached data and model

6. (Optional) Retrain Model Manually

If you want to force retraining, delete the checkpoint file:

rm checkpoints/2317_reward_model.pt

Then rerun:

python run.py 2317

Enjoy!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages