logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
crwinnr5  
#1 Posted : Wednesday, November 2, 2005 6:51:58 AM(UTC)
crwinnr5

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 7/21/2005(UTC)
Posts: 74
Location: Oklahoma USA

Jose has been so kind as to post in the public domain various calendar reference indicators and my thanks goes out to him. However, I am attempting to relate date indicators to trading days. Has any work been done on this? Specifically, I am trying to test the Stock Trader's Almanic theory of trading on the first two trading days of the month, the 9th to 11th trading days and the last 3 trading days of the month. I tried to modify Jose's Calendar Week of Month indicator but it did not really give me what I was after. Any suggestions? Thanks, Charley
Jose  
#2 Posted : Wednesday, November 2, 2005 8:26:30 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Charley, how about using a simple month's bar counter for your purpose? [code:1:6b65fa78a6] ================= Month's bar count ================= ---8<------------------------- { Counts bars in current month. http://www.metastocktools.com } { Message } message:=Input("Plot signals in own window", 0,0,0); { Start of month } nuMonth:=Month()<>Ref(Month(),-1) OR Cum(1)=2; { Month's bar count } count:=BarsSince(nuMonth OR Cum(1)=1)+1; { Plot bar count signals in own window } count ---8<------------------------- [/code:1:6b65fa78a6] You could then use the count to single out specific days, such as:
Quote:
the first two trading days of the month
count<3
Quote:
the 9th to 11th trading days
count>8 AND count<12
Quote:
the last 3 trading days of the month
This is tricky to code (it requires hindsight) because MetaStock cannot possibly know in advance the total number of trading days in the current month. jose '-)
crwinnr5  
#3 Posted : Wednesday, November 2, 2005 4:30:13 PM(UTC)
crwinnr5

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 7/21/2005(UTC)
Posts: 74
Location: Oklahoma USA

Thanks so much Jose, here is how I handeled the last three days of the month. I had to hard code the trading days for 2005. I will have to work on automation later but it works for me and is what I was after. Charley { Counts bars in current month. http://www.metastocktools.com } { Message } message:=Input("Plot signals in own window", 0,0,0); { Start of month } nuMonth:=Month()<>Ref(Month(),-1) OR Cum(1)=2; { Month's bar count } count:=BarsSince(nuMonth OR Cum(1)=1)+1; { Plot bar count signals in own window } m:= If(Month()=1,20, If(Month()=2,19, If(Month()=3,22, If(Month()=4,21, If(Month()=5,21, If(Month()=6,22, If(Month()=7,20, If(Month()=8,23, If(Month()=9,21, If(Month()=10,21, If(Month()=11,20, If(Month()=12,21,0 )))))))))))); count>m-3
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.