FinMan AlphaCore Current setup

 FinMan AlphaCore

Current Implementation Architecture, GitHub Setup, and User Guide


1. Executive Summary

AlphaCore is the technical stock forecasting component of the FinMan project. The current implementation is best described as an adaptive technical-strategy forecasting engine. It combines OHLCV market data, technical indicators, strategy scoring, dynamic weighting, historical similarity matching, backtesting metrics, and confidence scoring to produce 5-day, 10-day, and 14-day forecasts.

Important clarification: the current implementation should not yet be described as a full neural-network-per-strategy architecture. It is closer to a rule-based and adaptive ensemble engine with backtesting and learning-style weight updates. A neural meta-network can be added later as an experimental benchmark, but the current baseline is a strong and practical starting point for stock forecasting.

2. Current Architecture Image

Figure 1 - AlphaCore current implementation architecture: technical strategies, dynamic weighting, similarity matching, backtesting, and forecasting.

3. What the Current Implementation Does

Layer

Purpose

Data Input

Downloads or loads OHLCV data for a stock ticker: open, high, low, close, and volume.

Technical Indicators

Calculates technical signals such as Turtle breakout, momentum, RSI, MACD, Bollinger Bands, mean reversion, volatility, and market regime.

Strategy Scores

Converts each technical indicator into a comparable strategy score. Each score can be bullish, bearish, or neutral.

Dynamic Weighting

Adjusts the importance of each strategy based on regime, historical performance, signal strength, volatility, time decay, correlation, and risk adjustment.

Forecast Engine

Combines weighted strategy scores into expected return forecasts for 5, 10, and 14 trading days.

Similarity Engine

Finds historical market setups that look similar to the current setup and calculates average similarity and historical success rate.

Confidence Engine

Produces a confidence score based on strategy agreement, historical success, similarity quality, and regime reliability.

Backtesting / Validation

Tracks historical accuracy, win rate, returns, drawdown, and strategy attribution. This is the proof layer for whether the model is useful.

4. What It Is and What It Is Not

Area

Current Status

Plain-English Explanation

Technical strategies

Implemented

The system calculates multiple technical trading strategies.

Dynamic weighting

Implemented

The system adjusts strategy influence instead of using fixed weights.

Similarity matching

Implemented

The system compares the current setup to historical setups.

Backtesting

Implemented / evolving

The system validates historical results, but can be expanded with stronger walk-forward testing.

Continuous learning

Partial

The system can adjust weights from historical performance, but this should be strengthened.

Meta neural network

Not yet the core implementation

The current model is not confirmed as a true PyTorch/TensorFlow neural network.

Neural network per strategy

Not implemented

Each strategy is not yet its own trained neural network.

5. GitHub Installation

Use these steps on a Linux server, VM, or local machine. Replace the GitHub URL with the actual AlphaCore repository URL if it is different.

# 1. Clone the repository
git clone https://github.com/emadaaiskander-AI/FinManAlphaCore.git
cd FinManAlphaCore

# 2. Create and activate a Python virtual environment
python3 -m venv .venv
source .venv/bin/activate

# 3. Upgrade pip and install dependencies
python -m pip install --upgrade pip
pip install -r requirements.txt

If the project is already on the server under the working path used during development, use:

cd /home/finmanalphacore/finmanalphacore-sandbox/FinManAlphaCore
source .venv/bin/activate

6. Expected Python Dependencies

The exact requirements.txt should be maintained in GitHub. At minimum, the current implementation usually needs packages similar to the following:

pandas
numpy
yfinance
scikit-learn
scipy
matplotlib
python-dateutil

If the project later adds a true neural meta-network, add PyTorch or TensorFlow separately and document the training commands.

7. How to Run a Stock Prediction

From the project root, activate the environment and run the prediction script with a ticker symbol:

source .venv/bin/activate
python predict.py --ticker AAPL

Expected output should include the latest price, bias, confidence, current regime, similar setup count, average similarity, historical accuracy, and 5-day / 10-day / 14-day expected returns and prices.

==============================
FinMan AlphaCore Prediction
==============================
Ticker: AAPL
Latest Price: $XXX.XX
Bias: Bullish / Bearish / Neutral
Confidence: XX.X%
Historical Accuracy: XX.X%
Similar Setups: 25
Avg Similarity: XX.X%
Current Regime: Bull Trend / Bear Trend / Sideways / High Volatility

Forecast
5 Trading Days:  Expected Return %, Predicted Price
10 Trading Days: Expected Return %, Predicted Price
14 Trading Days: Expected Return %, Predicted Price

8. How to Run Backtesting

If the repository contains a dedicated backtest script, run it like this:

python backtest.py --ticker AAPL --years 2

If backtesting is integrated into predict.py, use the available flag from the codebase, for example:

python predict.py --ticker AAPL --backtest

Backtesting should track direction accuracy, win rate, average return, profit factor, Sharpe ratio, max drawdown, similarity success rate, and per-strategy contribution.

9. How the Code Should Be Structured

A clean GitHub implementation should use a structure similar to this:

FinManAlphaCore/
├── predict.py                  # CLI entry point for predictions
├── backtest.py                 # CLI entry point for backtesting
├── requirements.txt
├── README.md
├── data/
│   └── cache/                  # Optional local cached price data
├── alphacore/
│   ├── data_loader.py          # Load OHLCV data
│   ├── indicators.py           # RSI, MACD, Bollinger, ATR, etc.
│   ├── strategies.py           # Turtle, momentum, mean reversion, volatility, regime
│   ├── weighting.py            # Dynamic strategy weights
│   ├── forecast.py             # 5d / 10d / 14d forecast logic
│   ├── similarity.py           # Historical similar setup search
│   ├── confidence.py           # Confidence and reliability scoring
│   ├── backtesting.py          # Historical validation and metrics
│   └── reporting.py            # Console/table output

10. How to Interpret the Output

Output Field

Meaning

Bias

Overall bullish, bearish, or neutral direction based on weighted strategies.

Confidence

How strongly the model trusts the prediction. This is not a guarantee.

Historical Accuracy

How often similar historical setups moved in the expected direction.

Similar Setups

Number of historical setups used for comparison, commonly top 25.

Average Similarity

How close the historical matches are to the current setup.

Current Regime

The current market condition, such as bull trend, bear trend, sideways, or high volatility.

Expected Return

Projected percentage return over the selected horizon.

Predicted Price

Current price adjusted by the expected return.

11. Recommended Next Implementation Steps

  • Keep the current implementation as AlphaCore Baseline.

  • Strengthen walk-forward backtesting before adding more model complexity.

  • Add a clean results log so every prediction can be evaluated later.

  • Improve confidence calibration by comparing predicted confidence against actual outcomes.

  • Create a separate AlphaCore NN Lab branch for experimenting with a true meta neural network.

  • Benchmark Baseline vs NN Lab using the same tickers, dates, and metrics.

12. GitHub README Summary

Use the following short description in the GitHub README:

FinMan AlphaCore is an open-source technical stock forecasting engine. It combines multiple trading strategies, dynamic weighting, regime detection, historical similarity matching, backtesting, and confidence scoring to generate 5-day, 10-day, and 14-day forecasts for a selected stock ticker.

The current implementation is an adaptive ensemble-style forecasting baseline, not a full neural-network-per-strategy system. Future versions may include a benchmarked meta neural network, but performance will be decided by backtesting rather than architecture complexity.

13. Important Disclaimer

AlphaCore is a research and educational forecasting system. It should not be treated as financial advice or an automatic trading recommendation. Any live trading use should require independent validation, risk controls, position sizing rules, and paper-trading before real capital is used.


Comments

Popular Posts