Skip to content

Add Adjusted Quant Score v2 documentation#1

Open
Rbh2733 wants to merge 1 commit into
mainfrom
codex/add-detailed-guide-for-quant-score-v2-implementation
Open

Add Adjusted Quant Score v2 documentation#1
Rbh2733 wants to merge 1 commit into
mainfrom
codex/add-detailed-guide-for-quant-score-v2-implementation

Conversation

@Rbh2733

@Rbh2733 Rbh2733 commented Aug 21, 2025

Copy link
Copy Markdown
Owner

Summary

  • add Quant Score v2 article detailing weighted financial, sentiment, technical, and earnings components

Testing

  • npm test (fails: Could not read package.json)

https://chatgpt.com/codex/tasks/task_e_68a2b4442348832ca6eadc23c6f51d28

Summary by Sourcery

Add documentation for Adjusted Quant Score v2, including detailed breakdown of financial, sentiment, technical, and earnings components, final calculation formula, and example Excel implementation.

Documentation:

  • Introduce a new MDX article outlining the Quant Score v2 model with component weights, sub-scores, and final weighted sum formula
  • Provide a sample Excel template with cell layouts and formulas to compute each sub-metric and the overall Quant Score

@sourcery-ai

sourcery-ai Bot commented Aug 21, 2025

Copy link
Copy Markdown

Reviewer's Guide

Introduces a new MDX documentation page for the Adjusted Quant Score v2 model, detailing component definitions, weighted scoring formulas, and an Excel implementation template.

Class diagram for Quant Score v2 components and sub-metrics

classDiagram
class QuantScoreV2 {
  +FinancialHealth: float
  +FundFlows: float
  +OptionsFlow: float
  +SMI: float
  +AnalystRevisions: float
  +TechnicalSetup: float
  +EarningsSurprise: float
  +calculateFinalScore(): float
}
class FinancialHealth {
  +PERatioScore: float
  +DebtToEquityScore: float
  +FCFYieldScore: float
  +calculate(): float
}
class MarketSentiment {
  +FundFlows: float
  +OptionsFlow: float
  +SMI: float
  +AnalystRevisions: float
  +calculate(): float
}
class TechnicalSetup {
  +RSIScore: float
  +MACDScore: float
  +TrendScore: float
  +calculate(): float
}
class EarningsSurprise {
  +RevenueGrowthScore: float
  +EPSSurpriseScore: float
  +calculate(): float
}
QuantScoreV2 o-- FinancialHealth
QuantScoreV2 o-- MarketSentiment
QuantScoreV2 o-- TechnicalSetup
QuantScoreV2 o-- EarningsSurprise
MarketSentiment o-- FundFlows
MarketSentiment o-- OptionsFlow
MarketSentiment o-- SMI
MarketSentiment o-- AnalystRevisions
Loading

Flow diagram for Quant Score v2 calculation process

flowchart TD
    A[Input Raw Metrics] --> B[Calculate Sub-scores]
    B --> C[Apply Component Weights]
    C --> D[Sum Weighted Scores]
    D --> E[Final Quant Score]
Loading

File-Level Changes

Change Details Files
Add Adjusted Quant Score v2 documentation article
  • Create new MDX file with frontmatter (title, description)
  • Outline four scoring components with weights and metric definitions
  • Provide final Quant Score formula as a code snippet
  • Include an example Excel layout table and explanatory notes
quant-score-v2.mdx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `quant-score-v2.mdx:58` </location>
<code_context>
+| **B2** | P/E Ratio | Enter raw P/E (e.g., `35.2`) |
+| **C2** | P/E Score | `=MIN(1, (Industry_PE/B2))` |
+| **B3** | Debt-to-Equity | Enter raw D/E (e.g., `0.48`) |
+| **C3** | D/E Score | `=MIN(1, (Max_DE/B3))` |
+| **B4** | FCF Yield | Enter FCF yield (e.g., `0.55%`) |
+| **C4** | FCF Score | `=MIN(1, B4/Target_FCF_Yield)` |
</code_context>

<issue_to_address>
Division by zero risk in D/E Score formula.

Add a check to prevent division by zero when B3 is zero.
</issue_to_address>

### Comment 2
<location> `quant-score-v2.mdx:60` </location>
<code_context>
+| **B3** | Debt-to-Equity | Enter raw D/E (e.g., `0.48`) |
+| **C3** | D/E Score | `=MIN(1, (Max_DE/B3))` |
+| **B4** | FCF Yield | Enter FCF yield (e.g., `0.55%`) |
+| **C4** | FCF Score | `=MIN(1, B4/Target_FCF_Yield)` |
+| **C5** | Financial Health | `=AVERAGE(C2:C4)` |
+| **D2** | Fund Flows Score | `=MIN(1, FundFlowRatio/Max_FundFlowRatio)` |
</code_context>

<issue_to_address>
Potential unit mismatch in FCF Score calculation.

Verify that B4 and Target_FCF_Yield use consistent units to prevent calculation errors.

Suggested implementation:

```
| **B4** | FCF Yield | Enter FCF yield (e.g., `0.55%` or `0.0055`). **Use the same unit (decimal or percent) as Target_FCF_Yield.** |
| **C4** | FCF Score | `=MIN(1, B4/Target_FCF_Yield)` |

```

```
| **C4** | FCF Score | `=MIN(1, B4/Target_FCF_Yield)` |  
**Note:** Ensure both B4 (FCF Yield) and Target_FCF_Yield use consistent units (e.g., both as decimals like `0.0055` or both as percentages like `0.55%`) to avoid calculation errors. For example, if Target_FCF_Yield is `0.05` (for 5%), enter FCF Yield as `0.055` for 5.5%.

```
</issue_to_address>

### Comment 3
<location> `quant-score-v2.mdx:64` </location>
<code_context>
+| **C5** | Financial Health | `=AVERAGE(C2:C4)` |
+| **D2** | Fund Flows Score | `=MIN(1, FundFlowRatio/Max_FundFlowRatio)` |
+| **D3** | Options Flow Score | `=MIN(1, CallPutRatio/Target_CallPut)` |
+| **D4** | SMI Score | `=MIN(1, (SMI_Today - SMI_Mean)/SMI_StdDev)` |
+| **D5** | Analyst Revisions Score | `=IF(AnalystRaisePct > AnalystLowerPct,1,IF(AnalystRaisePct=AnalystLowerPct,0.5,0))` |
+| **E2** | RSI Score | `=RSI/100` |
</code_context>

<issue_to_address>
Division by zero risk in SMI Score formula.

Please add a condition to prevent division by zero when SMI_StdDev is zero.
</issue_to_address>

### Comment 4
<location> `quant-score-v2.mdx:70` </location>
<code_context>
+| **E3** | MACD Score | `=IF(MACD > SignalLine, 1, 0)` |
+| **E4** | Trend Score | `=IF(CurrentPrice > SMA50,0.5,0) + IF(CurrentPrice > SMA200,0.5,0)` |
+| **E5** | Technical Setup | `=AVERAGE(E2:E4)` |
+| **F2** | Revenue Growth Score | `=MIN(1, YoYRevenueGrowth/Target_RevenueGrowth)` |
+| **F3** | EPS Surprise Score | `=IF(Actual_EPS>Estimate_EPS,1,0)` |
+| **F4** | Earnings Surprise | `=AVERAGE(F2:F3)` |
</code_context>

<issue_to_address>
Clarify handling of negative revenue growth in Revenue Growth Score.

Negative YoYRevenueGrowth values will produce negative scores. Use MAX(0, ...) to keep scores between 0 and 1.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
| **F2** | Revenue Growth Score | `=MIN(1, YoYRevenueGrowth/Target_RevenueGrowth)` |
=======
| **F2** | Revenue Growth Score | `=MIN(1, MAX(0, YoYRevenueGrowth)/Target_RevenueGrowth)` |
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread quant-score-v2.mdx
| **B2** | P/E Ratio | Enter raw P/E (e.g., `35.2`) |
| **C2** | P/E Score | `=MIN(1, (Industry_PE/B2))` |
| **B3** | Debt-to-Equity | Enter raw D/E (e.g., `0.48`) |
| **C3** | D/E Score | `=MIN(1, (Max_DE/B3))` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Division by zero risk in D/E Score formula.

Add a check to prevent division by zero when B3 is zero.

Comment thread quant-score-v2.mdx
| **B3** | Debt-to-Equity | Enter raw D/E (e.g., `0.48`) |
| **C3** | D/E Score | `=MIN(1, (Max_DE/B3))` |
| **B4** | FCF Yield | Enter FCF yield (e.g., `0.55%`) |
| **C4** | FCF Score | `=MIN(1, B4/Target_FCF_Yield)` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Potential unit mismatch in FCF Score calculation.

Verify that B4 and Target_FCF_Yield use consistent units to prevent calculation errors.

Suggested implementation:

| **B4** | FCF Yield | Enter FCF yield (e.g., `0.55%` or `0.0055`). **Use the same unit (decimal or percent) as Target_FCF_Yield.** |
| **C4** | FCF Score | `=MIN(1, B4/Target_FCF_Yield)` |

| **C4** | FCF Score | `=MIN(1, B4/Target_FCF_Yield)` |  
**Note:** Ensure both B4 (FCF Yield) and Target_FCF_Yield use consistent units (e.g., both as decimals like `0.0055` or both as percentages like `0.55%`) to avoid calculation errors. For example, if Target_FCF_Yield is `0.05` (for 5%), enter FCF Yield as `0.055` for 5.5%.

Comment thread quant-score-v2.mdx
| **C5** | Financial Health | `=AVERAGE(C2:C4)` |
| **D2** | Fund Flows Score | `=MIN(1, FundFlowRatio/Max_FundFlowRatio)` |
| **D3** | Options Flow Score | `=MIN(1, CallPutRatio/Target_CallPut)` |
| **D4** | SMI Score | `=MIN(1, (SMI_Today - SMI_Mean)/SMI_StdDev)` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Division by zero risk in SMI Score formula.

Please add a condition to prevent division by zero when SMI_StdDev is zero.

Comment thread quant-score-v2.mdx
| **E3** | MACD Score | `=IF(MACD > SignalLine, 1, 0)` |
| **E4** | Trend Score | `=IF(CurrentPrice > SMA50,0.5,0) + IF(CurrentPrice > SMA200,0.5,0)` |
| **E5** | Technical Setup | `=AVERAGE(E2:E4)` |
| **F2** | Revenue Growth Score | `=MIN(1, YoYRevenueGrowth/Target_RevenueGrowth)` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Clarify handling of negative revenue growth in Revenue Growth Score.

Negative YoYRevenueGrowth values will produce negative scores. Use MAX(0, ...) to keep scores between 0 and 1.

Suggested change
| **F2** | Revenue Growth Score | `=MIN(1, YoYRevenueGrowth/Target_RevenueGrowth)` |
| **F2** | Revenue Growth Score | `=MIN(1, MAX(0, YoYRevenueGrowth)/Target_RevenueGrowth)` |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant