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

Notification

Icon
Error

Options
Go to last post Go to first unread
robcpettit  
#1 Posted : Monday, June 6, 2005 5:53:37 PM(UTC)
robcpettit

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/6/2005(UTC)
Posts: 52
Location: England

Is it possible to draw horizontal lines using an indicator. What Id like to be able to do is, when the close is rising draw a horizontal line say 5 bars wide under that close. When the close is not rising do nothing. I want to be able to draw these lines over the whole history of the chart and not ust at todays value. Basically its a stop loss signal if I can draw lines I can offset a certain percentage from the close. The reason for drawing them over the history of the stock is so I can test past sell signals. Thankyou for any advice Regards Robert
Patrick  
#2 Posted : Tuesday, June 7, 2005 5:30:11 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)
How do you reset your horizontal line? If you do not know what I mean, plot this on your chart and see what happens ... If(Roc(C,1,$)>0,Max(C*1.05,Prev),Prev) Patrick :mrgreen:
robcpettit  
#3 Posted : Wednesday, June 8, 2005 7:53:19 AM(UTC)
robcpettit

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/6/2005(UTC)
Posts: 52
Location: England

Patrick, Thanlyou for your reply. Yes, see what you meen. Still learning metastock so this hadnt occured to me. Great indicator though. Have to play with it. Ive written and indicator that gives me buy signals, Im geussing that I could use this as a basis for resetting the horizontal line. Im thinking along the lines of using 'if' buy signal given then plot lines. if I had several buy signals would I be able to have several lines. Regards Robert
robcpettit  
#4 Posted : Wednesday, June 8, 2005 2:47:00 PM(UTC)
robcpettit

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/6/2005(UTC)
Posts: 52
Location: England

hi Patrick Sorry to ask but struggling a bit with this, this is my buy signal in expert advisor Mov(C,5,S)>Ref(Mov(C,5,S),-1) AND Ref(Mov(C,5,S),-1)<Ref(Mov(C,5,S),-2) AND C>Ref(C,-1) AND Ref(C,-5)< Ref(C,-6) AND (C - Ref(C,-1))>(Ref(C,-6)-Ref(C,-5)) AND (C - Ref(C,-5))>(Ref(C,-6)-Ref(C,-5)), my atempt anyway, probably could be written better but it works. Im struggling to work out how to use as a reset trigger your indicator, I thought Id use a variable for the buy signal. Any pointers appreciated Regards Robert
Patrick  
#5 Posted : Wednesday, June 8, 2005 3:00:46 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)
Try this : PercentageValue:=0.05;{this represents 5%} BuyCondition:= Mov(C,5,S)>Ref(Mov(C,5,S),-1) AND Ref(Mov(C,5,S),-1)<Ref(Mov(C,5,S),-2) AND C>Ref(C,-1) AND Ref(C,-5)< Ref(C,-6) AND (C - Ref(C,-1))>(Ref(C,-6)-Ref(C,-5)) AND (C - Ref(C,-5))>(Ref(C,-6)-Ref(C,-5)); HorizontalLine:=if(BuyCondition,C*(1+PercentageValue), If(Roc(C,1,$)>0,Max(C*(1+PercentageValue),Prev),Prev)); HorizontalLine
robcpettit  
#6 Posted : Wednesday, June 8, 2005 3:22:40 PM(UTC)
robcpettit

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/6/2005(UTC)
Posts: 52
Location: England

Patrick. Thanyou, this is perfect. Thanks for time on this, I have to say this group is a great benifit to persons like myself just starting out. Regards Robert
Patrick  
#7 Posted : Wednesday, June 8, 2005 3:48:54 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)
Thank you oz_pdt_01o
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.