RE: financial_class.php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
you saying problem from the section below
 
 
case 1: // anual payments
return 365 - ($dsm % 360);
case 2: // semiannual
return 365 - ($dsm % 360); 
case 4: // quarterly
return $this->DATEDIFF('day',$this->DATEADD('day',-ceil($dsm/90)*90 -
($dsm%90),$maturity),$settlement);


 
so must be giving you problem from these functions, because input coming
from top.
 
Thirty360USdayCount , ActualActualdayCount, Actual360dayCount,
Actual365yearFraction
 
Debug these functions
 
Thanks,
Muthukumar Selvarasu,
Project Manager (Web Development),
Webmasters Ltd.
From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On
Behalf Of Kaneshalingam
Sent: Wednesday, January 02, 2008 7:11 PM
To: php-object
Subject:  financial_class.php
 
Can anyone help me to use financial functions in financial_class.php
(http://www.phpclasses.org)

COUPDAYBS () returns wrong output

function COUPDAYBS($settlement, $maturity, $frequency, $basis =
FINANCIAL_BASIS_MSRB_30_360) {
if (!$this->_is_valid_basis($basis)) return null;
if (!$this->_is_valid_frequency($frequency)) return null;
if ($settlement >= $maturity) return null;

switch ($basis) {
case FINANCIAL_BASIS_MSRB_30_360: // US(NASD) 30/360
$dsm = $this->Thirty360USdayCount($settlement, $maturity);
break;
case FINANCIAL_BASIS_ACT_ACT: // Actual/actual
$dsm = $this->ActualActualdayCount($settlement, $maturity);
break;
case FINANCIAL_BASIS_ACT_360: // Actual/360
$dsm = $this->Actual360dayCount($settlement, $maturity);
break;
case FINANCIAL_BASIS_ACT_365: // Actual/365
$dsm = $this->Actual365yearFraction($settlement, $maturity);
break;
case FINANCIAL_BASIS_30E_360: // European 30/360
$dsm = $this->Thirty360EUdayCount($settlement, $maturity);
break;
}
// PROBLEM MAY BE IN BELOW LINES
switch ($frequency) {
case 1: // anual payments
return 365 - ($dsm % 360);
case 2: // semiannual
return 365 - ($dsm % 360); 
case 4: // quarterly
return $this->DATEDIFF('day',$this->DATEADD('day',-ceil($dsm/90)*90 -
($dsm%90),$maturity),$settlement);
}
return null;
}
I need the following functions also
COUPDAYS ()
COUPDAYSNC ()
PRICE ()
ACCRINT ()

Can anybody help me.
Urgent

-- 
Best Regards

Eng. T. Kaneshalingam, AMIE(SL)
Project Manager,

E-commerce & Content Services
LankaCom Services (Pvt) Ltd
65C, Dharmapala Mawatha,
Colombo 07.
Sri Lanka.
E - kanesh@xxxxxxxxxxxx <mailto:kanesh%40lankacom.net> 
M - +94 777227960
T - +94 112437545
F - +94 112437547
W - www.lankacom.net

---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]
 


[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux