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

Notification

Icon
Error

Options
Go to last post Go to first unread
b_dunn  
#1 Posted : Saturday, October 1, 2005 1:00:27 AM(UTC)
b_dunn

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/1/2005(UTC)
Posts: 11

Dear all: I need help to code this entry condition. Try many ways but still cant figure it out. Say, my entry condition is A. And the current bar meet the entry condition. But, I won't enter the market yet. I will only enter the market when a Higher high of the current bar being hit within next 2 bars. In other words, buy signal will only hit when a move higher than the high of the current bar, for any bar within next 2 bars. I hope I address my question properly here. Please help and thanx for any help. B.D.
Jose  
#2 Posted : Saturday, October 1, 2005 2:10:32 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)
Try this MS code: [code:1:8220d5d23b]{ Initial setup signal example } setup:=Cross(C,Mov(C,10,E)); { Bars since setup signal } setupCount:=BarsSince(setup); { High at setup signal } setupHi:=ValueWhen(1,setup,H); { Entry } entry:=H>setupHi AND setupCount<3; { Plot in own window } setup*.5;entry [/code:1:8220d5d23b] jose '-) http://www.metastocktools.com
b_dunn  
#3 Posted : Saturday, October 1, 2005 2:15:21 PM(UTC)
b_dunn

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/1/2005(UTC)
Posts: 11

Hi Jose: Thanx for the wonderful codes. Can you please explain this line of code: { Plot in own window } setup*.5;entry What is the function of it? Why *0.5? Thank you! :D
b_dunn  
#4 Posted : Saturday, October 1, 2005 3:01:52 PM(UTC)
b_dunn

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/1/2005(UTC)
Posts: 11

Ok, Jose. Maybe that's only an example of your initial setup signal, right? :lol:
Jose  
#5 Posted : Saturday, October 1, 2005 9:29:39 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)
{ Plot in own window } setup*.5;entry The last line of MS code plots two signals: the original setup signal, and the final signal. This is done to help you verify that the MS code works as intended. Plotting both signals together may get confusing, so I've just halved (*0.5) the setup signal for easier differentiation (sorry - I think I've just invented a new English word). jose '-) http://www.metastocktools.com
b_dunn  
#6 Posted : Sunday, October 2, 2005 4:30:10 AM(UTC)
b_dunn

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/1/2005(UTC)
Posts: 11

Thank you!
b_dunn  
#7 Posted : Sunday, October 2, 2005 4:46:20 AM(UTC)
b_dunn

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/1/2005(UTC)
Posts: 11

Sorry, Jose. I would like to consult you on a question on similiar scenario. In this case, say, my LE condition is A, my LX is B, my SE is D and my SX is E. The current bar meet the LE condition. But, I won't enter the market yet. I will only enter the market when a Higher high of the current bar being hit, whether it is next bar or next 20bars as long as the LE signal is still valid. The codes that I wrote has the 1 all the way - entry:=H>setupHi. I try to limit the all signals to only once. So is for SE. Lower Low of the signal bar. My LE, LX, SE, SX codes are rather long. I am not sure whether I can define that many variables under 1 indicator in MS. Thus, I have to define 4 indicators separetely for LE, LX, SE, SX. Thank you for your time, Jose.
Jose  
#8 Posted : Sunday, October 2, 2005 4:59:46 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)
This looks like a job for... (drum roll)... Super ForumDll! (fanfare) ForumDll.dll available now from a forum thread near you, at: http://forum.equis.com/viewforum.php?f=19 jose '-)
Patrick  
#9 Posted : Sunday, October 2, 2005 7:27:07 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Thanks I really like the fanfare :D But I would recommend you go to the downloads section to download the files unless you have metastock version 8.0 ... Patrick :mrgreen:
b_dunn  
#10 Posted : Sunday, October 2, 2005 2:59:20 PM(UTC)
b_dunn

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/1/2005(UTC)
Posts: 11

Patrick wrote:
Thanks I really like the fanfare :D But I would recommend you go to the downloads section to download the files unless you have metastock version 8.0 ... Patrick :mrgreen:
Hi Patrick: I have MS 8. What can I do with it to solve my problem? Thanx! :shock:
Patrick  
#11 Posted : Sunday, October 2, 2005 3:50:53 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Download this version: http://forum.equis.com/viewtopic.php?t=2047 Patrick :mrgreen:
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.