Hello
I'm trying to count the number of trading days in a month in any intraday interval
Here is what I came up with and I THINK it's working
var nCount = 1;
var vTemp2 = 0;
for(var i = 0; i < 30; i++) {
vTemp = day(-i, inv("D") );
if (vTemp < vTemp2) {
nCount++;
} else {
tDays = nCount;
nCount = 1;
}
vTemp2 = vTemp;
}
tDays is the number of trading days, I have a feeling there is a BETTER way of doing this.
Thank you
Ketoma
I'm trying to count the number of trading days in a month in any intraday interval
Here is what I came up with and I THINK it's working
var nCount = 1;
var vTemp2 = 0;
for(var i = 0; i < 30; i++) {
vTemp = day(-i, inv("D") );
if (vTemp < vTemp2) {
nCount++;
} else {
tDays = nCount;
nCount = 1;
}
vTemp2 = vTemp;
}
tDays is the number of trading days, I have a feeling there is a BETTER way of doing this.
Thank you
Ketoma
Comment