Kapalı

Write short rebalancing calculation code in Javascript or Php

Write rebalancing calculation code in Javascript or Php.

The code must be data based: arrays / objects of data.

The goal of the project is to write a short rebalancing calculation code in Javascript or Php.

Rebalancing is when you define a portfolio of x% of stock A, y% of stock B, and z% of stock C.

After a while, stocks prices change, and we need to sell some stocks and buy others, to rebalance.

E.g:

We have 1000$.

Stock A - cost 10$, we want our portolio to have 20% of stock A - 20 stocks total value 200$.

Stock B - cost 15$, we want our portolio to have 30% of stock B - 20 stocks total value 300$.

Stock C - cost 50$, we want our portolio to have 50% of stock C - 10 stocks total value 500$.

a year has passed, now the prices are:

Stock A - 5$, worth 100$ (5*20).

Stock B - 15$, still worth 300$.

Stock C - 40$, worth 400$ (10*40).

Total worth: 800$.

Now, stock A is 12.5% of the portfolio, so we need to buy more of it to make it 20%.

stock B is 37.5% of the portfolio, so we need to sell some of it to make it 30%.

stock C is 50% which is the goal, so we need to do nothing.

Then another year will pass, and the same calculation again...

Beceriler: Javascript, JSON, node.js, PHP, Yazılım Mimarisi

Daha fazlasını gör: html javascript php mysql profile system code, calculation system javascript php, convert javascript php code, calculator html code free, javascript calculator examples, html calculator template, simple javascript calculator form, simple calculator in javascript, javascript calculator function, simple calculator program using javascript in html, simple calculator using javascript w3schools, create short unique code email php, protect code html php javascript jquery, php code javascript smarty arcadem, using javascript php amount calculation, project code javascript interest calculation, write information file code javascript, javascript source code captcha php, html form javascript calculation code, collapse table rows javascript php code script

İşveren Hakkında:
( 17 değerlendirme ) Raanana, Israel

Proje NO: #18798589