BusDaysInMonth

See Also...

Related Topics

 

 

Description

Displays the number of business days in a specified month of the current calendar year.

 

 

Formula

BusDaysInMonth(instrument, thisMonth)=begin

   cMo = vchart(instrument.month[-1])

 

   if thisMonth == cMo then begin

      dt = date

   end

   if thisMonth < cMo then begin

      dt = AddMonths(date, -(cMo - thisMonth))

   end

   if thisMonth > cMo then begin

      dt = AddMonths(date, thisMonth - cMo)

   end

   retval = BusDays(FirstOfMonth(dt), LastOfMonth(dt))

   retval

end

 

 

Parameters

instrument

This parameter specifies an instrument. Any instrument can be used. The instrument is used to derive the current month, so if you elect to use a futures contract, ensure the contract has not expired.

 

thisMonth

This parameter identifies the month for which you want the number of business days. Valid values are 1 through 12, where 1 is January, 2 is February, 3 is March, and so on.

 

 

Return Value

The number of business days in the specified month.

 

 

Examples

BusDaysInMonth(IBM, 6)

 

This example returns the number of days in June of the current year.

 

 

Comments

NA

 

©2008 Aspen Research Group, Ltd. All rights reserved. Terms of Use.