Skip to content

news_feed

NewsEvent dataclass

Represents a structured news event in the market simulation.

Parameters:

Name Type Description Default
timestamp datetime

The time at which the news event occurs.

required
headline str

The text headline summarizing the news.

required
impact float

The numerical indicator of the news impact (e.g. positive/negative shift).

required

NewsFeed

Manages structured news events for the market simulation.

Parameters:

Name Type Description Default
events list[NewsEvent]

The list of news events.

None

get_news(timestamp)

Retrieve all news events published up to the given timestamp.

Parameters:

Name Type Description Default
timestamp datetime

The query timestamp.

required

Returns:

Type Description
list[NewsEvent]

The list of matching news events.