Programming

You find my code on GitHub

https://github.com/thomasekdahlN/

https://github.com/thomasekdahlN/wealthprognosis-app

## Wealth prognosis predicts your yearly future economy from now until you die

Makes a qualified prognosis of your economic future year for year until your death. It takes into account your income, expences, assets/liabilities, loans, taxes, inflation and more.

Configure all your assets, mortgage, income and expences.

The program takes into account all known taxes in Norway, like fortune tax, property tax, income tax, capital tax, pension tax, rental tax, company tax, dividend tax, interest tax, wealth tax, inheritance tax, gift tax, sales tax and tax shield and calculates it for every asset every year
The program looks at how much your max possibel mortgage can be

The program looks at different F.I.R.E metrics so you can see when you can become financially independent and retire early. But recommends a different approach than the 4% rule – it will take the number of years from you wish to retire until the year you die – and sell the sellable assets until zero (fully configurable). You will still have your house, car, boat and cabin left after these sales.
Supports correct taxation when transfering an asset from a company to private (first correct taxation on realization in company, then correct taxation when transfering to private)

Supports normal annuitets mortgage and extra downpayments.

On each asset you can do a rule based addition or subtraction, like adding 5000 to a equity fund every month.
On each asset you can do an calculation based on other assets value and add it to this asset. Like taking 5% of the salary and add it to OTP (this does not change your salary but it increases your OTP)
On each asset you can do an transfer to another asset. This will correctly calculate the taxes for the sale involved before transfer.

#### Examples
Like taking 1/15 part of a equity fund each year and add it to your income for spending
taking 50% of the positive cachflow of one asset to make a extra mortgage downpayment for finish mortgage earlier.
Take 100% of the sales value of a stock/company and transfer it to a equity fund on your exit from the stock.
Transfer the value from one asset to another (to simulate if it gives you more wealth)
Children asset has both income and expences until the children move out, then they are removed from your economy
Public pension is added to your income the year you pension
Public pension is added to your income the year you pension until you ar 77 years.

Your asset configuration can then be run with different prognossis, like realistic, positive, negative, tenpercent, zero, variable, all, private, company.
Each asset can have a changerate, that can be different for each year on how the asset behaves. The different prognosis configurations has different yearly change paths for each type of asset or you can make your own.
Assets can both increase and decrease in value based on the changerates.

#### Example:
Change path for interest can på 4% in 2023, 6% in 2024 and then 5% in 2025, etc
Change path for your car or boat would be -10% in 2023, -10% in 2024 and then -10% in 2025, etc
It then sums everything up and shows you all the details on how your economy behaves.

It outputs a very detailed excel spreadsheet of your future economy prognosis where you can see how well a single asset performs, or you can look at the total performance for your private or company economy – or the sum of your private and company economy. Se examples and definitions below.
It also outputs a page with the spread of your different asset types – so you can see where you are most heavily invested.

### Supports
Supports % changerates on expences, income and asset values
Supports mortage calculations and new mortages taking over for a previous mortage
Support incrementell decrease of income / expence / asset (using negative amount as input)
Supports calculation of fortune tax in norway (but not adding it to expences)
Calculates all values for all assets
Groups assets into groups for group overview
Groups assets into total, company and private for a total overview of your economic future
Estimates your max loan capasity from banks.

### F.I.R.E calculations
Calculate 4% retirement on asset cash flow (FIRE)
F.I.R.E income = income + asset value + deductable taxes + loan principal
F.I.R.E expence = expence + mortgage + taxable taxes
F.I.R.E cashflow = FIRE income – FIRE expence amount
F.I.R.E % = FIRE income / FIRE expence = How close you are to fire
F.I.R.E SavingRate = FIRE cashflow / FIRE income (in progress)

### Support for more sophisticated dynamics in income/expence/asset –

rule – support:
— +10% – Adds 10% to amount
— -10% – Subtracts 10% from amount
— 10% – Calculates 10% of the amount
— +1000 – Adds 1000 to amount
— -1000 – Subtracts 1000 from amount
— +1/10 – Adds 1 tenth of the amount yearly
— -1/10 – Subtracts 1 tenth of the amount yearly
— 1/10 – Calculates 1/10 of the amount. Does not change the amount
— +1|10 – Adds 1 tenth of the amount yearly, and subtracts nevner with one(so next value is 1/9, then 1/8, 1/7 etc)
— -1|10 – Subtracts 1 tenth of the amount yearly. Then subtracts nevner with one. (so next value is 1/9, then 1/8, 1/7 etc). Perfect for usage to i.e empty an asset over 10 years.
— 1|10 – Calculates 1|10 of the amount. Does not change the amount.

**source**

Default den asset man står på, medmindre annet er spesifisert. Brukes for å beregne beløpet basert på verdiene i en annen asset enn den man står på. Will not reduce the value of the source asset,

**transfer**

Overføring av beløp fra den asset regelen er på til den asset som er spesifisert i regelen,
Beløp blir kun overført hvis det er spesifisert en transfer på asset som skal sende beløpet, hvis ikke blir beløpet lagt til den asset man står på.
Transfer kan kun foregå til tidligere prosesserte assets i rekkefølgen om det er extraDownPayment på lån, ellers så må transfer alltid skje til en kommende asset.

### Supported assets types for prognosis and tax calculation
* ask – Aksjesparing med skattefradrag
* boat – Båt
* cabin – Hytte
* car – Bil
* bank – Bankkonto
* cash – Kontanter
* child – Barn. Skattefritt men kjekt å klassifisere.
* crypto – Krypto
* bondfund – Rentefond
* equityfund – Aksjefond eller fond som det kalles på, populært
* gold – Gull
* inheritance – Arv.
* ips – Pensjonssparing med spesielle skatteregler.
* loantocompany – Når du har gitt et lån til et firma (Skjermingsfadrag
* income – her samler vi inntekt fra alle assets. Det blir aldri regnet skatt her. income regnes som ferdig skattet fra en transfer/rule/source fra annen asset
* kpi – Konsumpris indeksen. For å se om investeringene dine gjør det bedre eller dårligere enn denne.
* otp – Offentlig tjenestepensjon
* pension – public pension / folketrygd
* property – Eiendom du ikke leier ut. Sekundærboliger.
* rental – Utleieeiendom
* salary – Lønn
* soleproprietorship – Enkeltpersonforetak
* stock – Aksjer. Må hensynta fritaksregelen. Ingen skatt på salg av aksjer fra et firma, kun skatt ved salg av aksjer for privatpersoner