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

Notification

Icon
Error

Options
Go to last post Go to first unread
betycook  
#1 Posted : Tuesday, July 27, 2010 9:05:15 AM(UTC)
betycook

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/27/2010(UTC)
Posts: 6

Please help to prepare EXPERTS ADVISOR for

Example :

L = 10000

REF(L,-1) = 10020
REF(L,-2) = 10019
REF(L,-3) = 10018
,
,
,
REF(L,-(n-1)) = 10002
REF(L,-n) = 10001
REF(L,-(n+1)) = 10002
REF(L,-(n+2)) = 10003

Please advise how can I express

when “L” drop below Ref(L, -n)
i.e. the nearest lowest value,

of which “n” to be the bar counting back from “L”.

Thanks in Advance.

Betycook
johnl  
#2 Posted : Wednesday, July 28, 2010 8:16:07 PM(UTC)
johnl

Rank: Advanced Member

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


How about something like:

a1:=LLV(L,5);
a2:=Cross(a1,L);
a2

betycook  
#3 Posted : Thursday, July 29, 2010 5:01:54 AM(UTC)
betycook

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/27/2010(UTC)
Posts: 6

Hi John,

Thanks for the reply.

I tried yours but seemed no indication yet.
We don't know when will the "L" drop below the last lowest.

Can we first locate the last lowest by :

Ref(L,-1)>L and
L<Ref(L,1)

and define "L" be someting, say "X", the current Candlestick will always compare with 10001.

Have you got any suggestion ?

Thanks

vienna  
#4 Posted : Thursday, July 29, 2010 6:17:51 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

Hi,

what do you mean with last L - do you mean the low of the previous day or do you mean the lowest value of the previous n days?

x:=ref(L,-1); {x is the low of previous day}
y:=LLV(ref(L,-1),5); {y is the lowest low of the previous 5 days}

L<x;

L<y;


edit: sorry have forgotten to add the ref -1 at the lowest low function - without the ref the actual low would be included
oztrader  
#5 Posted : Thursday, July 29, 2010 6:30:36 PM(UTC)
oztrader

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 7/12/2007(UTC)
Posts: 134
Location: Perth Western Australia

L < Ref(LLV(L,10),-1)
betycook  
#6 Posted : Friday, July 30, 2010 11:02:30 AM(UTC)
betycook

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/27/2010(UTC)
Posts: 6

Dear Vienna,

Thanks for your reply.
I will try and come back to you.

Cheers

Betycook
betycook  
#7 Posted : Friday, July 30, 2010 11:05:16 AM(UTC)
betycook

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/27/2010(UTC)
Posts: 6

Hi oztrader,

Thanks.

I will test and back to you.

Cheers

betycook
betycook  
#8 Posted : Friday, July 30, 2010 10:09:11 PM(UTC)
betycook

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/27/2010(UTC)
Posts: 6

Hi Vienna and Oztrader,

Thank you for your help.

I don’t know how to post a jpg file here. However, I would like to forward a snap chart showing the nearest lowest “L” for your reference.

If you don’t mind checking out the chart, please forward a short note to my email betycook@gmail.com. So that I can feedback.

Thanks

vienna  
#9 Posted : Thursday, August 5, 2010 3:07:15 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

Hi betycook,

now I have an example for you with which you can get something equal like you showed in the chart.
You can change the periods slightly to adjust it in a way you like it more..

period1:=10;
period2:=3;

bottomoccured:=LLV(L,period1) AND Ref(Cross(0,LinRegSlope(L,period2)),-(period2-1));

previousbottom:=ValueWhen(1,bottomoccured=1, LLV(L,period1));

belowbottom:=Cross(previousbottom,L);
previousbottom;
belowbottom*LastValue(C);

The "*LastValue(C)" Part is only used to show the bottoms and the Signals in the same chart.

Notice also that there are a lot of different way's to determine the "real" previous low, with their advantages and disadvantages..

cheers
vienna
PS: I have only access to my e-mail at night...
betycook  
#10 Posted : Thursday, August 5, 2010 8:24:29 AM(UTC)
betycook

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/27/2010(UTC)
Posts: 6

Dear Vienna,

Thank you so much for your effort.

I will test and try to understand the expressions.

However,could you pls let me know how and where I can learn more and strengthen my Metastock language. MetaStockFormulaPrimer does not provide detail and sufficient codes. Pls advise any other sources which may be useful.

Again, thanks a lot.

Cheers

betycook
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.