UI enhancemnts
This commit is contained in:
@@ -143,7 +143,7 @@ export class ScreenerEngine {
|
||||
asset,
|
||||
fundamental,
|
||||
inflated,
|
||||
signal: this.signal(fundamental.label, inflated.label),
|
||||
signal: this.signal(fundamental, inflated),
|
||||
});
|
||||
} catch (err) {
|
||||
results.ERROR.push({
|
||||
@@ -184,13 +184,13 @@ export class ScreenerEngine {
|
||||
}
|
||||
}
|
||||
|
||||
private signal(fundamentalLabel: string, inflatedLabel: string): Signal {
|
||||
const green = (l: string) => l.startsWith('🟢');
|
||||
const yellow = (l: string) => l.startsWith('🟡');
|
||||
if (green(fundamentalLabel)) return SIGNAL.STRONG_BUY;
|
||||
if (green(inflatedLabel) && yellow(fundamentalLabel)) return SIGNAL.MOMENTUM;
|
||||
if (green(inflatedLabel) && !green(fundamentalLabel)) return SIGNAL.SPECULATION;
|
||||
if (yellow(fundamentalLabel) || yellow(inflatedLabel)) return SIGNAL.NEUTRAL;
|
||||
// Signal derives from the structured verdict tier — never from label strings.
|
||||
// Rewording a display label can no longer silently corrupt signals.
|
||||
private signal(fundamental: ScoreResult, inflated: ScoreResult): Signal {
|
||||
if (fundamental.tier === 'PASS') return SIGNAL.STRONG_BUY;
|
||||
if (inflated.tier === 'PASS' && fundamental.tier === 'HOLD') return SIGNAL.MOMENTUM;
|
||||
if (inflated.tier === 'PASS') return SIGNAL.SPECULATION;
|
||||
if (fundamental.tier === 'HOLD' || inflated.tier === 'HOLD') return SIGNAL.NEUTRAL;
|
||||
return SIGNAL.AVOID;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user