finalynx.simulator.events

Module Contents

Classes

Event

Program an action to happen at a certain (optionally recurring) date.

Salary

Add your salary to your account every month (nicer shortcut).

YearlyPerformance

Earn your investments’ interests at the end of each year.

API

class finalynx.simulator.events.Event(action: finalynx.simulator.actions.Action, planned_date: Optional[datetime.date] = None, recurrence: Optional[finalynx.simulator.recurrence.RecurrenceBase] = None, name: Optional[str] = None)[source]

Program an action to happen at a certain (optionally recurring) date.

Initialization

An event associates a date to an action.

Parameters:
  • actionAction instance to execute.

  • planned_date – Date when the action should be executed.

  • recurrence – Optional recurrence to repeat the action every month/year/other.

  • name – Optional name of the event, defaults to the action’s name.

apply(portfolio: finalynx.portfolio.folder.Portfolio) List[finalynx.simulator.events.Event][source]

Apply this event’s consequence. This event can generate several new Events.

__str__() str[source]
class finalynx.simulator.events.Salary(target_line: finalynx.portfolio.line.Line, income: float, expenses: float = 0, day_of_the_month: int = 1, start_date: Optional[datetime.date] = None, end_date: Optional[datetime.date] = None, income_growth: float = 0, expenses_follow: float = 0, name: str = 'Salary')[source]

Bases: finalynx.simulator.events.Event

Add your salary to your account every month (nicer shortcut).

Initialization

Add your salary to your account every month (nicer shortcut). The salary amount can grow with a fixed percentage every year. The expenses can follow the income gains with a fixed percentage every year (0 means every new gain is invested, 100 means every gain is used to increase your way of life).

Parameters:
  • target_lineLine reference in the portfolio to add the salary to.

  • income – Monthly salary amount.

  • expenses – Monthly expenses amount.

  • day_of_the_month – Day of the month to add the salary to the portfolio.

  • start_date – When to start adding the salary to the portfolio, defaults to today’s next month.

  • end_date – When to stop adding the salary to the portfolio, defaults to no end date.

  • income_growth – Annual salary growth rate.

  • expenses_follow – Annual expenses growth rate (percentage of income gains reinvested).

  • name – Name of the event.

apply(portfolio: finalynx.portfolio.folder.Portfolio) List[finalynx.simulator.events.Event][source]

Update the salary amount with the growth rates. Creates a new salary with the updated income/expense amounts depending on the growth rates.

class finalynx.simulator.events.YearlyPerformance(inflation: float, start_year: Optional[int] = None, repeat_annual: bool = True, name: str = 'Yearly Performance')[source]

Bases: finalynx.simulator.events.Event

Earn your investments’ interests at the end of each year.

Initialization

An event associates a date to an action.

Parameters:
  • actionAction instance to execute.

  • planned_date – Date when the action should be executed.

  • recurrence – Optional recurrence to repeat the action every month/year/other.

  • name – Optional name of the event, defaults to the action’s name.