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

[amibroker] trading days in a week



PureBytes Links

Trading Reference Links




Hi,
 
So far the following code works to calc number of 
trading days in a week except the first week and the last week of the 
ticker. I do not understand why tday still return 5 even though last week only 
have 2 trading days (since the week is not over yet) ? Any help is much 
appreciated.

dw=DayOfWeek<FONT color=#000000 
size=1>();
firsttday = IIf<FONT color=#000000 
size=1>(Cum<FONT color=#000000 
size=1>(1<FONT color=#000000 
size=1>)==1<FONT color=#000000 
size=1>,1,dw 
< Ref( 
dw, -1 
));
tday = ValueWhen<FONT color=#000000 
size=1>( firsttday, 1<FONT 
color=#000000 size=1>+ BarsSince<FONT 
color=#000000 size=1>(Ref<FONT 
color=#000000 size=1>(firsttday,-1<FONT 
color=#000000 size=1>)),<FONT color=#ff00ff face="Courier New" 
size=1>0); 
Many thanks
KK 






Yahoo! Groups Sponsor












Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.