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

Notification

Icon
Error

Options
Go to last post Go to first unread
William  
#1 Posted : Monday, May 14, 2007 2:00:40 PM(UTC)
William

Rank: Newbie

Groups: Registered, Registered Users
Joined: 5/14/2005(UTC)
Posts: 4

Hello,

I was wondering if someone can help me decipher this code, i have a very basic understanding how to lay formulas out. All i basically want is to be able to find the support over the past 50 days or whatever. This seems to work out fine, but not sure how i turn this into an exploration. Thx for any help that can be provided.

LookBack := Input("Look Back Periods",1,1000,10);
Resistance :=ValueWhen(1,Cross(Mov(C, LookBack,
S),C),HHV(H, LookBack));
Support :=ValueWhen(1,Cross(C,Mov(C, LookBack,
S)),LLV(L, LookBack));
Resistance;
Support;

*PP  
#2 Posted : Monday, May 14, 2007 3:30:07 PM(UTC)
*PP

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/1/2006(UTC)
Posts: 135
Location: Romania

hi William

U must copy ur code in filter section of an exploration and then, depending on what are u trying to do, replace last two lines of code. For example if u want to buy when the price breaks the provided resistance level within ur code u should add something like

cross(c,resistance)

U could specify exactly what do u want and if i can i will do it for u, but what i advice u to do is to read metastock manual in there u have all answers.

Cheers

wabbit  
#3 Posted : Monday, May 14, 2007 6:04:50 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)
*PP wrote:
U must copy ur code in filter section of an exploration and then, depending on what are u trying to do, replace last two lines of code. For example if u want to buy when the price breaks the provided resistance level within ur code u should add something like

cross(c,resistance)

William,

In addition to what *PP has advised, yuo need to hard code the value for the 'LookBack' period as Input() function canot be used in explorations. (Although I am sure you figured this bit out already when you read your MS Users Manual!)

{Column A}
LookBack := 10;
Resistance :=ValueWhen(1,Cross(Mov(C, LookBack,S),C),HHV(H, LookBack));
C>Resistance;

{Column B}
LookBack := 10;
Support :=ValueWhen(1,Cross(C,Mov(C, LookBack,S)),LLV(L, LookBack));
C<Support;

{filter}
ColA OR ColB;


Hope this helps.

wabbit [:D]

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.