Skip to content

thes3513/EventTrendLab-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventTrendLab

Research Framework for Signal Selection, Portfolio Construction, and Quantitative Strategy Evaluation


Overview

EventTrendLab is a research framework designed to evaluate how different stock-selection layers affect the performance of the same underlying trading strategy.

The framework separates:

  • Signal Generation
  • Selection Models
  • Portfolio Construction
  • Risk Management
  • Benchmark Analysis

This allows researchers to isolate the contribution of the selection layer while keeping all other components unchanged.


Research Question

Can portfolio performance be improved through better trade selection while keeping the underlying strategy unchanged?

This project evaluates the impact of different selection approaches on:

  • CAGR
  • Sharpe Ratio
  • Maximum Drawdown
  • Capital Efficiency
  • Exposure Utilization

Research Results

No Selection (Baseline)

None

Characteristics:

  • Highest exposure
  • Highest drawdown
  • Weakest risk-adjusted return
  • No capital allocation optimization

Rule-Based Selection

Rule

Characteristics:

  • Improved signal quality
  • Lower drawdown
  • Better Sharpe ratio
  • More efficient capital deployment

Machine Learning Selection

AI

Characteristics:

  • Strongest long-term performance
  • Improved portfolio concentration
  • Better capital efficiency
  • Superior risk-adjusted return

Framework Architecture

TradingView Strategy Exports
                │
                ▼
        Signal Loader
                │
                ▼
        Selection Layer
                │
        ┌───────┴────────┐
        │                │
        ▼                ▼
 Rule-Based      Machine Learning
 Selection           Selection
        │                │
        └───────┬────────┘
                │
                ▼
         Position Sizing
                │
                ▼
      Portfolio Aggregation
                │
                ▼
       Mark-to-Market Engine
                │
                ▼
        Performance Analysis
                │
                ▼
      Benchmark Comparison

Key Components

Market Panel Engine

Builds a cross-sectional market panel from historical stock data.

Example fields:

  • Open
  • High
  • Low
  • Close
  • Volume
  • Turnover
  • Sector Information

Signal Ingestion

Converts TradingView strategy exports into standardized portfolio events.

Output:

  • Entry Events
  • Exit Events
  • Position Records

Selection Layer

Supports multiple selection methodologies:

  • No Selection
  • Rule-Based Selection
  • Machine Learning Selection

Selection models are evaluated independently while maintaining the same underlying trading strategy.


Portfolio Engine

Portfolio-level simulation including:

  • Position Sizing
  • Exposure Control
  • Capital Allocation
  • Daily Mark-to-Market Accounting

Benchmark Analysis

Performance comparison against:

  • Buy & Hold Benchmark
  • Exposure-Matched Benchmark

Metrics:

  • CAGR
  • Sharpe Ratio
  • Max Drawdown
  • Exposure Statistics

Repository Structure

EventTrendLab/

├── backtest/
│   ├── analyze_portfolio.py
│   └── position_sizing.py
│
├── ingestion/
│   └── tv_loader.py
│
├── selection/
│   ├── config.py
│   └── demo_selection.py
│
├── data/
│   └── _sample/
│       ├── market_panel_sample.csv
│       └── tv_exports/
│
├── images/
│   ├── none.jpg
│   ├── rule.jpg
│   └── ai.jpg
│
├── exports/
│
├── main.py
│
└── README.md

Quick Start

Clone Repository

git clone https://github.com/YOUR_USERNAME/EventTrendLab-public.git
cd EventTrendLab-public

Install Dependencies

pip install pandas numpy matplotlib

Run Demo

python main.py

Outputs:

exports/

portfolio_equity_curve.csv
portfolio_summary.csv
portfolio_vs_0050.png
portfolio_exposure_stats.png

Public Version

This repository contains a simplified public implementation of the research framework.

The production research environment includes additional components that are intentionally excluded:

  • Proprietary alpha generation modules
  • Production datasets
  • Advanced feature engineering
  • Extended stock universes
  • Research infrastructure
  • Portfolio optimization modules

The public version is intended to demonstrate framework architecture and research workflow only.


Tech Stack

  • Python
  • Pandas
  • NumPy
  • Matplotlib

Research Topics:

  • Quantitative Research
  • Portfolio Construction
  • Risk Management
  • Relative Strength Selection
  • Machine Learning Selection
  • Systematic Trading

Disclaimer

This repository is provided for research and educational purposes only.

Nothing in this repository should be interpreted as investment advice or a recommendation to buy or sell any financial instrument.

Past performance does not guarantee future results.


Author

Independent Quant Researcher

Research Interests:

  • Portfolio Construction
  • Quantitative Investing
  • Systematic Trading
  • Selection Models
  • Risk Management

About

Research framework for signal selection, portfolio construction, and quantitative strategy evaluation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages