add earnings-date guard — warn when a report falls in the target horizon
Finnhub's earnings calendar now supplies next_earnings_date through the fundamentals chain; persisted on fundamental_data (migration 006) and exposed in the fundamentals API. The recommendation panel warns when earnings fall within the ~30-day target horizon (a report can gap price through stop/target) and otherwise shows the next date. Informational only. Deploy: run alembic upgrade (new fundamental_data.next_earnings_date column). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime
|
||||
from datetime import date, datetime
|
||||
|
||||
from sqlalchemy import DateTime, Float, ForeignKey, Text
|
||||
from sqlalchemy import Date, DateTime, Float, ForeignKey, Text
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.database import Base
|
||||
@@ -17,6 +17,7 @@ class FundamentalData(Base):
|
||||
revenue_growth: Mapped[float | None] = mapped_column(Float, nullable=True)
|
||||
earnings_surprise: Mapped[float | None] = mapped_column(Float, nullable=True)
|
||||
market_cap: Mapped[float | None] = mapped_column(Float, nullable=True)
|
||||
next_earnings_date: Mapped[date | None] = mapped_column(Date, nullable=True)
|
||||
fetched_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), nullable=False
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user