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

Notification

Icon
Error

Options
Go to last post Go to first unread
mark91345  
#1 Posted : Tuesday, August 16, 2016 3:54:39 AM(UTC)
mark91345

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/6/2009(UTC)
Posts: 36
Location: Los Angeles

Thanks: 4 times

Using Metastock version 13, in Explorer, I want to find stocks in which:

Over a two-week period, find OPEN that is at least 8% lower than prior day's CLOSE.


I started a couple lines:

Pctg:=0.08;

Yest:=Ref(CLOSE, -1);

But... I am not sure how to complete the code to search for Opening prices that are 8% lower than prior day's Closing price.

 

Can you help?

 



 

MS Support  
#2 Posted : Tuesday, August 16, 2016 3:35:27 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Hi, The Explorer by default runs from a specific date, not over a range. You can write the formula to look back over a period of time using the "Alert" function which extends a conditional statement over a number of periods. Are you wanting the Explorer to notify you when a stock has made a 8% drop in a single day (within a 2-week window) or are you wanting to look at a Weekly rate of change? If you are looking for a Weekly rate of change, are you using Daily or Weekly data for this?
mark91345  
#3 Posted : Tuesday, August 16, 2016 6:01:22 PM(UTC)
mark91345

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/6/2009(UTC)
Posts: 36
Location: Los Angeles

Thanks: 4 times
I want the Explorer to notify me when a stock has made a 8% drop in a single day (within a 2-week window)
MS Support  
#4 Posted : Tuesday, August 16, 2016 6:03:56 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Something like the following should work. Note that the "Alert" function on the last line is what extends the look-back period for your condition. I used 10 periods (which would be a rolling 2 weeks of trading data). Today:=OPEN; Yest:=Ref(HIGH,-1); PctChg:=((Today - Yest) / Yest) * 100; Alert(PctChg <= -8,10)
thanks 1 user thanked MS Support for this useful post.
mark91345 on 8/16/2016(UTC)
mark91345  
#5 Posted : Tuesday, August 16, 2016 6:11:16 PM(UTC)
mark91345

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/6/2009(UTC)
Posts: 36
Location: Los Angeles

Thanks: 4 times
This is exactly what I needed. Thank you for your very quick response! Mark
mark91345  
#6 Posted : Tuesday, August 16, 2016 7:06:54 PM(UTC)
mark91345

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/6/2009(UTC)
Posts: 36
Location: Los Angeles

Thanks: 4 times
I am using your code, but I am noticing that several stocks appear in my Explorer results, even when the most recent 8% (or more) drop goes back to June or early July (way farther back than 10 days). Do you know why? A couple stocks for your reference are BCRX and AEMD. Today:=OPEN; Yest:=Ref(HIGH,-1); PctChg:=((Today - Yest) / Yest) * 100; Alert(PctChg <= -8,10)
MS Support  
#7 Posted : Tuesday, August 16, 2016 8:01:26 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
We might have to look at the data, here is what I see on those securities below: BCRX.O 8/15/2016 = 5.11 Open 8/12/2016 = 5.798 High This looks to be an 11% drop from the previous day's high. AEMD.O 8/12/2016 = 7.8 Open 8/11/2016 = 9.0899 High This looks to be an 14% drop from the previous day's high.
mark91345  
#8 Posted : Wednesday, August 17, 2016 9:19:59 PM(UTC)
mark91345

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/6/2009(UTC)
Posts: 36
Location: Los Angeles

Thanks: 4 times
Hi, I am fine-tuning this code now (comparing today's Open with yesterday's Close). I want to examine Pink Sheet stocks, whose LOW, over the past 30 days, ranged between $0.50 to $3.00, and with average 10-day volume > 10,000. But I seem to be doing something wrong with the LOW, as Explorer is giving me stocks far below my minimum $0.50. Can you help? Today:=OPEN; Yest:=Ref(CLOSE,-1); PctChg:=((Today - Yest) / Yest) * 100; Alert(PctChg <= -8 OR PctChg >= 8 AND LLV(LOW, 30) >= 0.50 AND LLV(LOW, 30) <= 3.00 AND Mov( V, 10, S) > 10000,10)
MS Support  
#9 Posted : Wednesday, August 17, 2016 10:01:55 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Could be the use of the OR boolean that is causing the issue. Basically the last line is stating: That the first part of the condition (PctChg <= -8) can be true, OR the entire rest could be true and the formula will still report a true result. It sounds like you want either the 1st PctChg to be true OR the 2nd PctChg to be true AND the rest of the criteria is also true along with the first or second condition. Additionally, I would think you would want to use HHV for the upper boundary of the LOW price. To that end I think you would want to change the last line of the formula to: Alert((PctChg <= -8 OR PctChg >= 8) AND LLV(LOW, 30) >= 0.50 AND HHV(LOW, 30) <= 3.00 AND Mov( V, 10, S) > 10000,10)
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.