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

Notification

Icon
Error

3 Pages123>
Options
Go to last post Go to first unread
Jose  
#1 Posted : Thursday, December 8, 2005 9:34:38 PM(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)
Hey... where did that MetaStock programming competition go? :eek: Oh, here it is. Ok, let's see who can work it out before Sunday's release of the first line of code! :roll: jose '-)
Jose  
#2 Posted : Saturday, December 10, 2005 1:22:51 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)
We have a winner! Congratulations to Rodney Platt for his less-than-elegant but workable solution! Rodney has chosen the MACDH Divergence kit for his prize. This competition has been extended, and we are now looking for a new winner who can code the month's High/Low signals without any PREV functions. C'mon guys, it's Xmas - bring out the good code! :) jose '-)
Jose  
#3 Posted : Saturday, December 10, 2005 5:25:26 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)
PremiumData, suppliers of quality data (as used by myself), have kindly offered to add the following to the competition's prize pool: One year's data subscription plus complete data history to any one of ASX, SGX, US Stocks, Futures or Forex markets, valued at between US$290 and US$440. With a choice of five quality prizes to be won, MetaStock code never looked so good! :) jose '-)
kanellop  
#4 Posted : Saturday, December 10, 2005 6:42:02 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

Dear Jose, I saw the Competition that you put in Metastock Forum. I was try yesterday a lot for to write the Formula without Success. My problem was, that can't write the Expressions able to Time meaning the Expressions for Days, Months, Years in this contest. Anyway, Congratulations from my Side to the Person that win. Dear Jose i want to please you to ask that Person and publish in the Forum what is his Profession or if he is a Professional Trader. I want also to please you, to make as Mandatory in the New Competitions, to say the Winner which is her/his Profession or if she/he is a Professional Trader. Kind Regards, George K.
Jose  
#5 Posted : Saturday, December 10, 2005 10:13:16 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)
George, personal details are not relevant to this competition. jose '-)
StorkBite  
#6 Posted : Saturday, December 10, 2005 11:15:54 AM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Quote:
George, personal details are not relevant to this competition.
Or to anything else on the forum either. Per the membership rules and disclaimer, no assumptions are made regarding the quality of any post or member qualifications. This is after all a public forum. Take what you can and discard the rest. Professional advice is by definition a paid service.
StorkBite  
#7 Posted : Saturday, December 10, 2005 11:18:39 AM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Congratulations Ripfree! :D
Jose  
#8 Posted : Sunday, December 11, 2005 12:39:55 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)
The first of eight lines of code has now been posted here. The next hint? Watch for it this coming Wed 14th Dec! jose '-)
wabbit  
#9 Posted : Sunday, December 11, 2005 8:22:48 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Jose, What if a stock only trades on one month per year? Perhaps something like: nuMonth:=Month()<>Ref(Month(),-1) OR (Month()=Ref(Month(),-1) AND Year()<>Ref(Year(),-1)) OR Cum(1)=2 ; might be more bullet-proof?? wabbit :D P.S. Nice way to get around the not-counting-the-first-bar-in-the-chart problem!
wabbit  
#10 Posted : Sunday, December 11, 2005 12:36:22 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
...or even NM:=Month()<>Ref(Month(),-1) OR (Month()=Ref(Month(),-1) AND Year()<>Ref(Year(),-1)); nuMonth:=Cum(NM>-1)=1 OR NM; does the same job.... wabbit :D
wabbit  
#11 Posted : Sunday, December 11, 2005 1:52:23 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
... and another quick question before I sit down and try to think this one out.... What if the monthly hi/lo is reached several times in that month? Does the indicator have to show only one hi/lo per month, or on every occassion it is attained? wabbit :D P.S. I can see this is going to be using up some of my time when I am supposed to be doing other things!
johnl  
#12 Posted : Sunday, December 11, 2005 5:27:06 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

I can get the previous months high/low plotted, three lines of code each, but can't get it to one signal in the correct month...ummmm.. Here is the code but I may be leading you in the wrong direction. mth1:=If((Month()=Ref(Month(),-1)+1) OR (Ref(Month(),-1)-Month()=11),1,0); H1:=HighestSince(1,mth1=1,H); H2 := If((Ref(Month(),-1)<Month()) OR (Ref(Month(),-1)-Month()=11),Ref(H1,-1),0); H3 := HighestSince(1,(H2<>0),H2); H3; L1:=LowestSince(1,mth1=1,L); L2 := If((Ref(Month(),-1)<Month()) OR (Ref(Month(),-1)-Month()=11),Ref(L1,-1),0); L3 := HighestSince(1,(L2<>0),L2); L3
kanellop  
#13 Posted : Sunday, December 11, 2005 5:30:51 PM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

When try to put the Creation of Mr Rodney Platt into my Metastock 9.1 Pro for E-Signal, didn't work correctly. What i mean? I put into the Metastock: --->Start---> Days:=Cum(1); DaysLoaded:=LastValue(Days); DaysRemaining:=DaysLoaded-Days; StartOfMonth:=(Month()>Ref(Month(),-1)) OR (Month()=1 AND Ref(Month(),-1)=12); Months:=Cum(StartOfMonth); MonthsLoaded:=LastValue(Months); MonThsRemaining:=MonthsLoaded-Months; EndOfMonth:=(Month()<Ref(Month(),1)) OR (Month()=12 AND Ref(Month(),1)=1); HighDaysAgo:=If(EndOfMonth,HighestSinceBars(1,StartOfMonth,HIGH),0); LastHigh:=LastValue(HighestSinceBars(1,StartOfMonth,HIGH)); LowDaysAgo:=If(EndOfMonth,LowestSinceBars(1,StartOfMonth,LOW),0); LastLow:=LastValue(LowestSinceBars(1,StartOfMonth,LOW)); DaysPassed:=BarsSince(StartOfMonth); LastDay:=LastValue(DaysPassed); DaysLeftInMonth:=If(MonthsRemaining>0, LastValue(ValueWhen(LastValue(MonthsRemaining+PREV-PREV), Endofmonth,DaysPassed)),LastDay)-DaysPassed; currenthigh:=If(MonthsRemaining>0, LastValue(ValueWhen(LastValue(MonthsRemaining+PREV-PREV), EndOfMonth,HighDaysAgo)),LastHigh); currentLow:=If(MonthsRemaining>0, LastValue(ValueWhen(LastValue(MonthsRemaining+PREV-PREV), EndOfMonth,LowDaysAgo)),LastLow); HighDay:=If(DaysLeftInMonth=Currenthigh,1,0); LowDay:=If(DaysLeftInMonth=CurrentLow,-1,0); HighDay; LowDay; <---End<--- But when i put the same Formula without the: --->Start---> and the <---End<--- into the Metastock, the Formula work! Dear Jose what happen? George K.
maurice  
#14 Posted : Sunday, December 11, 2005 6:03:24 PM(UTC)
maurice

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/27/2005(UTC)
Posts: 1

Hi Jose, I send a little contribute from Italy... StartOfMonth:=Month()<>Ref(Month(),-1); .... EndOfMonth:=Month()<>Ref(Month(),1); maurice
mstt  
#15 Posted : Sunday, December 11, 2005 6:58:14 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Maurice Your "EndofMonth" definition prevents any indicator that it's used with from plotting on the last bar of a chart. Roy MetaStock Tips & Tools
Jose  
#16 Posted : Sunday, December 11, 2005 11:00:11 PM(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)
Wabbit, I'm hoping no one is crazy enough to buy any stock that trades for only one month each year. :) I've thought about using the calendar indicator to do this properly, but I'm trying to keep this competition as simple as possible.
wabbit wrote:
What if the monthly hi/lo is reached several times in that month? Does the indicator have to show only one hi/lo per month, or on every occassion it is attained?
Only two signals per month, one for the High, one for the Low. Obviously this can only be done in retrospect. BTW, you're expected to do well in this competition, Wabbit. ;) jose '-)
Jose  
#17 Posted : Sunday, December 11, 2005 11:23:23 PM(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)
johnl wrote:
I can get the previous months high/low plotted, three lines of code each, but can't get it to one signal in the correct month...ummmm..
Don't give too much away to the competition, John. ;)
kanellop wrote:
When try to put the Creation of Mr Rodney Platt into my Metastock 9.1 Pro for E-Signal, didn't work correctly. Dear Jose what happen?
I don't know, George - that indicator plots signals (in its own window!) just fine here, although a bit slow. Maybe the Highs & Lows in your charts are missing??? :eek: jose '-)
johnl  
#18 Posted : Monday, December 12, 2005 12:51:52 AM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

After the dust settles you may want to discuss the pros and cons of "lastvalue", Jose. Isn't it cheating as far as a indicator is concerned? I like these diversions since they head me off in directions I am not used to. For instance.. plot the indicator below.. mth1:=If((Month()=Ref(Month(),-1)+1) OR (Ref(Month(),-1)-Month()=11),1,0); mth2:=Cum(mth1); H1 :=HighestSince(1,mth1=1,H); H2 := If((Ref(Month(),-1)<Month()) OR (Ref(Month(),-1)-Month()=11),Ref(H1,-1),0); H3 :=HighestSince(1,(H2<>0),H2); H4 :=(BarsSince(H1>H3)); H4 when the indicator comes off zero, it looks like a pretty good "sell"... ....will have to investigate, and also plotting the indicator in my last post gives you a "poor man's" bollinger band. HeHeHe.
Jose  
#19 Posted : Monday, December 12, 2005 1:09:09 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)
johnl wrote:
After the dust settles you may want to discuss the pros and cons of "lastvalue", Jose.
Hindsight-based functions such as LastValue/ZigZag/Peak/Trough have their place in the scheme of things as visual tools, but should not be used to generate backtesting/trading signals, as these will shift. Hindsight is an important component of learning from past experience. The "Month's High & Low signals" in this competition is also a visual tool - it facilitates the spotting of month's Highs & Lows, but cannot be used for backtesting because the last signals are always (except on the last day of month) dynamic - i.e., they shift as a new high/low appears. jose '-)
sportrider  
#20 Posted : Monday, December 12, 2005 1:39:41 AM(UTC)
sportrider

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/12/2005(UTC)
Posts: 141
Location: Brooklyn,NY

Hi Jose, I want to take a stab at the formula.After 2 days and several beers I came up with: [NUMONTH:= Month()<>Ref(Month(),-1); NUMONTH; HighestSince(1 ,NUMONTH ,H ); LowestSince(1,NUMONTH,L);] I think this does the job. Thanks Ralph.
Users browsing this topic
Guest (Hidden)
Similar Topics
MetaStock programming competition! (General Chat)
by StorkBite 12/8/2005 8:43:29 PM(UTC)
MetaStock programming competition! (Welcome!)
by Jose 12/8/2005 8:38:57 PM(UTC)
3 Pages123>
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.