Add Adjusted Quant Score v2 documentation#1
Conversation
Reviewer's GuideIntroduces 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-metricsclassDiagram
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
Flow diagram for Quant Score v2 calculation processflowchart TD
A[Input Raw Metrics] --> B[Calculate Sub-scores]
B --> C[Apply Component Weights]
C --> D[Sum Weighted Scores]
D --> E[Final Quant Score]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| | **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))` | |
There was a problem hiding this comment.
issue (bug_risk): Division by zero risk in D/E Score formula.
Add a check to prevent division by zero when B3 is zero.
| | **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)` | |
There was a problem hiding this comment.
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%.
| | **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)` | |
There was a problem hiding this comment.
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.
| | **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)` | |
There was a problem hiding this comment.
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.
| | **F2** | Revenue Growth Score | `=MIN(1, YoYRevenueGrowth/Target_RevenueGrowth)` | | |
| | **F2** | Revenue Growth Score | `=MIN(1, MAX(0, YoYRevenueGrowth)/Target_RevenueGrowth)` | |
Summary
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: