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

Notification

Icon
Error

Options
Go to last post Go to first unread
trab  
#1 Posted : Tuesday, October 4, 2011 7:23:26 PM(UTC)
trab

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/24/2009(UTC)
Posts: 5

I am lookng to trade a long breakout strategy which follows the points below. But I am seeking guidance on begining the formula or using base formula that comes with metastock. Any help will be much appreciated? 1) daily price gaps up represented by gap and high price for last 10 periods (number of periods to be a parameter); 2) daily price gap is maintained – represented by latest period opening and closing price keeping gap with previous periods open or close (whichever is higher); 3) Exclude stocks that have an ATR (10) (to be a parameter) of less than $0.05 (to be a parameter); 4) Exclude stocks that have a Volume EMA (10 - to be a parameter) of less than 500,000 (to be a parameter).
jjstein  
#2 Posted : Wednesday, October 5, 2011 11:55:48 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
You're going to have to explain things a bit better; particularly items 1) and 2).

1) If the price gaps up, it's a gap. What the rest of your condition means, I don't know -- are you trying to say something about the gap not closing?

2) No idea what this means.

You might want to have a look at the Metastock Formula Primer, here: http://forum.equis.com/files/19673/download.aspx


trab  
#3 Posted : Wednesday, October 19, 2011 12:20:43 AM(UTC)
trab

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/24/2009(UTC)
Posts: 5

Johnathan, thanks very much for responding to me.

You are correct in your assumption about my point 1. All I am trying to do is find stocks where there has been a gap compared to the previous period and it hasn't closed. Some of the formulas that came with Metastock find the stock using a gap on the open price but still report the stock even if the gap closes during the trading day. My point 1 was also noting that I would like to use a parameter to filter stocks according to them achieving a new high price. That is, I am not interested in stocks that just gap, but ones that gap and take out a recent high eg. new high over last 10 days or new high over last 20 days etc.

My point 2 was also trying to say this but not very clearly.

Is there a formula that comes with Metatock that I could amend to achieve this?

Thanks for your guidance.

David

jjstein  
#4 Posted : Wednesday, October 19, 2011 10:32:21 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
David, I think this will do what you want -- it returns 1 (true) or 0 (false):

{ _My Indicator }
------------------------------------------------------
Lookback:=Input("Lookback",1,500,10);
LowVolume:=Input("Volume",1,500,10);
RangeATR:=Input("RangeATR",1,500,10);
ValueATR:=Input("ValueATR",.01,100,.05);
VolumeLevel:=Input("VolumeLevel",1000,1000000000,500000);

RecentHigh:=Ref(HHV(H,Lookback),-1);
TakenOut:=H>RecentHigh;
VolumeMA:=Mov(V,LowVolume,E);

TakenOut
AND GapUp()
AND ATR(RangeATR)>ValueATR
AND VolumeMA>=VolumeLevel;
------------------------------------------------------

If you put the following in the FILTER tab of an Exploration, it will show signals from the past month:

Alert(Fml("_My Indicator"),21);

Just change the "21" to a "1" if you are doing this daily. I ran it on the S&P 500 and only got three results.

trab  
#5 Posted : Thursday, October 20, 2011 2:08:45 AM(UTC)
trab

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/24/2009(UTC)
Posts: 5

Johnathan, I wanted to thank you so much for your answer it is perfect. I am using it on the Australian ASX300 and it has already drammatically reduced the time it takes for me to scan the market looking for potential trades.

I don't want to push the friendship too far but one further question would be in relation to the presentation of the indicator on my charts. I have seen some charts where the indicator is represented as an arrow below the price candles on the days where the conditions of the indicator are meet. Ie. in the case of the code you provided, this would be the days that the indicator currently returns 1 (true). Is this something you could show me how to do?

Thanks again for your help.

David

jjstein  
#6 Posted : Thursday, October 20, 2011 11:35:48 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
You just need to create and attach an Expert.

Press Ctrl-R, click NEW and give it a name, then click the SYMBOLS tab. Click NEW and name it BUY, put in the code, then click the GRAPHIC tab and pick your Symbol and Color.

Code:
--------
Fml("_My Indicator"); { on the BUY tab }

Don't forget to click ATTACH so it hooks to the Chart. Also, you can edit the Expert more quickly by double-clicking the little rectangle at the bottom-right, just above the arrows and security selection button (the rectangle is part of the Expert -- actually, there are several parts, so when you're done with this, you have a new toy to explore & play with!)

You've probably learned by now that you cannot copy Indicator code with INPUT() statements in certain areas of Metastock, like Experts and Explorations. You can use or "call" the Indicator through FML() or FMLVAR(), in which case the default value you specified is used. If you want to copy the code from an Indicator, you must change ("hardwire") any variables which use INPUT(). Example:

MyVar:=Input("Periods",1,10,2); { default "2" is used by FML() and FMLVAR() }

needs to be:

MyVar:=2;


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.