Find Jobs
Hire Freelancers

Code to Update Values in MYSQL table

$30-5000 USD

Terminado
Publicado hace casi 14 años

$30-5000 USD

Pagado a la entrega
I have a mysql table that contains one month (18 buisiness days total) of daily prices and share amounts of a mutual fund portfolio that consists of five holdings. I php code that will calculate the 'Value of $10,000 (val10k)' figures for each of these holdings for each day and add it to a column in the table. All the information required to do this is in the table, but I don't know how to do the caculation code in php. ## Deliverables I have a mysql table that contains one month (18 buisiness days total) of daily prices and share amounts of a mutual fund portfolio that consists of five holdings. I've attached this table. I php code that will calculate the 'Value of $10,000 (val10k)' figures for each of these holdings for each day and add it to a column in the table. All the information required to do this is in the table, but I don't know how to do the caculation code in php. The val10k is what the value of $10,000 would be worth if it was invested in a holding. It is used in finance to easily compare performance of two or more investments. You'll see the mutual fund portfolio tracked in the attached table contains four mutual funds and a cash resevere. The ticker symbols (column 'ticker') of the four mutual funds are XBI, NAESX, VFICX, MFCFX, and the cash reserve is represented by 'cash'. To determine each day's val10k for a holding, the code will have to calculate the performance of the holding on a given day, then compare it to the performance of the holding on the previous day, then take the result and multiply it by the previous day's val10k figure. Then the code insert the new val10k number into the table and move on to the next day. To calculate the performance of a holding, the code needs to calculate the holding's current normalized value and compare it to the previous value. To do this the code should multiply a holdings price (price column) by the number of shares held (amount column), then divide that number by the number in the divisor field on that day (the divisor is used to normalize values a holding if shares have been added to or removed from a holding and is usually, but not always, 1), then do the same for the previous day and compare the two. Here's an example the steps the code needs to do in which we'll determine the val10k for XBI on 2010-01-05: In the included table you'll see the val10k of each of these five holdings on the first day is $10,000 as this is the first day these funds appear in the portfolio. 1. Determine target day's value: XBI on 2010-01-05 has a price of 54.71, a share amount of 183.48, and a divisor of 1.0. 54.71 x 183.48 = 10038.19/1.0 = 10038.19. The value of our XBI holding on 2010-01-05 is $10038.19. 2. Determine previous day's value: XBI on 2010-01-05 has a price of 54.50 and a share amount of 183.48 and a divisor of 1.0. 54.50 x 183.48 = 9999.66/1.0. The value of our XBI holding on 2010-01-05 is $9999.66. 3. Calculate one day performance: 10038.19/9999.66=1.003853131 then subtract 1 = .003853131 or .3853131%. 4. Multiply one day's performance by previous day's val10k, then add result to previous day's val10k. The val10k for XBI on 2010-01-04 is 10000. 10000 x .3853131 = 38.53131 10000 + 38.53131 = 10038.53131 val10k for 2010-01-04 is 10038.53. So the code would then insert 10038.53 into the val10k field in the record with the pa-num of 7 and move on.
ID del proyecto: 3478257

Información sobre el proyecto

16 propuestas
Proyecto remoto
Activo hace 14 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
See private message.
$15 USD en 3 días
4,9 (137 comentarios)
5,4
5,4
16 freelancers están ofertando un promedio de $71 USD por este trabajo
Avatar del usuario
See private message.
$170 USD en 3 días
5,0 (381 comentarios)
8,6
8,6
Avatar del usuario
See private message.
$339,15 USD en 3 días
4,9 (131 comentarios)
7,0
7,0
Avatar del usuario
See private message.
$42,50 USD en 3 días
4,9 (300 comentarios)
6,9
6,9
Avatar del usuario
See private message.
$85 USD en 3 días
4,7 (244 comentarios)
6,3
6,3
Avatar del usuario
See private message.
$25,50 USD en 3 días
4,8 (79 comentarios)
5,8
5,8
Avatar del usuario
See private message.
$8,50 USD en 3 días
5,0 (55 comentarios)
5,7
5,7
Avatar del usuario
See private message.
$85 USD en 3 días
4,9 (84 comentarios)
5,3
5,3
Avatar del usuario
See private message.
$17,84 USD en 3 días
5,0 (92 comentarios)
5,1
5,1
Avatar del usuario
See private message.
$102 USD en 3 días
5,0 (44 comentarios)
5,1
5,1
Avatar del usuario
See private message.
$42,50 USD en 3 días
4,9 (23 comentarios)
4,4
4,4
Avatar del usuario
See private message.
$51 USD en 3 días
4,5 (9 comentarios)
3,2
3,2
Avatar del usuario
See private message.
$42,50 USD en 3 días
5,0 (8 comentarios)
2,8
2,8
Avatar del usuario
See private message.
$4,25 USD en 3 días
5,0 (4 comentarios)
1,3
1,3
Avatar del usuario
See private message.
$21,25 USD en 3 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
See private message.
$85 USD en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
United States
5,0
55
Forma de pago verificada
Miembro desde feb 13, 2007

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.