This is a trading object shared by a member. You can use this object as well as hundreds of others with QuantShare - Trading Software.
Click on the Like button or on one of the share buttons to share this object and spread the word about QuantShare.
QuantShare is an advanced trading software for stock, forex, futures, ETF and options markets. It is the best and the most complete EOD trading software software and it is FREE (beta version).
Correspondence between bars of trading days and their actual dates is sometimes needed in trading. In fact, trading days do not include neither weekends nor some holidays. Besides, the trading period does not correspond to a particular interval of the calendar; it starts and ends dependently on the trader's choice. Consequently, the bar index rarely corresponds to the actual day of the month.
This is why many trading softwares have date functions. You can get here a function named 'BarsFromMonthStart' which returns the number of trading bars from the beginning of the actual month in the calendar. For example, for the first trading day in the last month of November, i.e. 2nd November, BarsFromMonthStart could return 1. For the last trading day of this month of December, i.e. December 30th, it could return 22.