finalynx.simulator.timeline

Module Contents

Classes

Simulation

Configuration class to launch a Finalynx simulation.

Timeline

Main simulation engine to execute programmed actions on your portfolio.

API

class finalynx.simulator.timeline.Simulation[source]

Configuration class to launch a Finalynx simulation.

events: Optional[List[finalynx.simulator.events.Event]]

None

inflation: float

2.0

end_date: Optional[datetime.date]

None

default_events: bool

True

print_final: bool

False

print_each_step: bool

False

step_years: int

5

metrics_record_frequency: str

β€˜MONTH’

class finalynx.simulator.timeline.Timeline(simulation: finalynx.simulator.timeline.Simulation, portfolio: finalynx.portfolio.folder.Portfolio, buckets: List[finalynx.portfolio.bucket.Bucket])[source]

Main simulation engine to execute programmed actions on your portfolio.

Initialization

The timeline is a list of programmed events. The user can set his own list of events with optional recurring settings. The timeline will automatically apply each event and generate the recurring events until duration_years is reached.

run() None[source]

Step all events until the simulation limit is reached.

goto(target_date: datetime.date) None[source]

Step until the target date is reached (in the future or past).

step_until(target_date: datetime.date) None[source]

Execute all events until the specified date is reached.

step() bool[source]

Execute the next event. This may generate new events in the stack.

Returns:

True if the simulation ended (no more events).

abstract unstep_until(target_date: datetime.date) None[source]

Undo all events until the specified date is reached.

abstract unstep() None[source]

Undo the last event and go back to the previous date.

property is_finished: bool

The timeline is finished if there are no events left to step or the limit date is reached.

_record_metrics() None[source]

Record the portfolio’s metrics at the current date to display later.

chart_timeline(title: str, valuesToGraph: Dict[str, List[float]], colors: Dict[str, str] = {}, visible_by_default: bool = True) Dict[str, Any][source]

Plot a Highcharts chart of the portfolio’s caracteristics and amounts over time.

_convert_data_series(data: List[float]) List[Any][source]

Convert DataSeries in a time series format to allow non regular data

_sort_events() None[source]

Internal method to sort the event list by planned date.

__str__() str[source]