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

Notification

Icon
Error

Options
Go to last post Go to first unread
nuisance  
#1 Posted : Thursday, May 19, 2005 3:10:52 PM(UTC)
nuisance

Rank: Newbie

Groups: Registered, Registered Users
Joined: 5/19/2005(UTC)
Posts: 3

I am at learning stage therefore even it may so simple i could not write a formula for the following case, Thanks in advance any helpful comments, The aim for the formula is to create a moving stop loss - start win indicator, Instead of using Close values of the prices, the system should use a little bit more smoothed values, thus i would like to use 3 periods exponential moving average for the price signal as Mov (C,3,E). Moving Stoploss should have a trailing nature and should act also as Start Win indicator. Therefore i prefer to call it Moving StopLoss StartWin indicator. MSL-SW MSL-SW should always follow the MovA (price signal) with 2% of intervals ; MSL-SW lower than the MovA (Uptrend) Condition A When MovA is increasing MSL-SW should follow the MovA and should be equal to 98% of MovA. When MovA is unchanged or decreasing in comparison with the one day before value, MSL-SW should stay at the same value. Crossing down of MovA with MSL-SW should be considered as SELL signal. (Stop-loss) and MSL-SW should be upside down as described in the following condition. MSL-SW is higher than MovA (Downtrend) Condition B When MovA is decreasing MSL-SW should follow the MovA and should be equal to 102% of MovA. When MovA is unchanged or increasing in comparison with the one day before value, MSL-SW should stay at the same value. Crossing up of MovA with MSL-SW should be considered as BUY signal. (Start-Win) and MSL-SW should be upside down as described in condition A. An example for the indicator... UserPostedImage
hayseed  
#2 Posted : Thursday, May 19, 2005 5:35:51 PM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey nuisance.... does your sell have to be the """"Crossing down of MovA with MSL-SW should be considered as SELL signal. """"" that seems hard to do.... unless i'm looking at it incorrectly the two lines would be always equidistant..... this might be some of your codes.....the stop loss is easy enough, but the cross eludes me......h trailing 98% stop loss based on a 3 bar exponential Mov(C,3,E)*.98 trailing 102% stop loss based on a 3 bar exponential Mov(C,3,E)*1.02
nuisance  
#3 Posted : Friday, May 20, 2005 9:57:10 AM(UTC)
nuisance

Rank: Newbie

Groups: Registered, Registered Users
Joined: 5/19/2005(UTC)
Posts: 3

hayseed wrote:
hey nuisance.... does your sell have to be the """"Crossing down of MovA with MSL-SW should be considered as SELL signal. """"" that seems hard to do.... unless i'm looking at it incorrectly the two lines would be always equidistant..... this might be some of your codes.....the stop loss is easy enough, but the cross eludes me......h trailing 98% stop loss based on a 3 bar exponential Mov(C,3,E)*.98 trailing 102% stop loss based on a 3 bar exponential Mov(C,3,E)*1.02
Hey hayseed thanks for your interest, however if we plot Mov(C,3,E)*0.98 and Mov(C,3,E)*1.02 we would get an envelope..Which aLways following the 3 periods of exp. Moving average one edge on the upper side and the other one at the bottom... The curve obtained should be some how clever and when prices are goes down or stay same (horizontal) it should be stay at the same level and therefore it would give us a STOP signal. The opposite situation when prices goes up it would give us a START signal... Ahhh I know it is terrible... IS there anybody for thyis challenging formula ?
Patrick  
#4 Posted : Friday, May 20, 2005 4:25:26 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)
Have you looked at this : http://forum.equis.com/v...t=316&highlight=trailing Try replacing roc(C,1,$)>0 by your Roc(moving average ..... I'm sure this could be of help. Patrick :mrgreen:
hayseed  
#5 Posted : Saturday, May 21, 2005 3:45:31 AM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey nuisance.... talk about a fumble, somehow missed the ""MSL-SW should stay at the same value.""" part of your post, even after reading it several times ..... sorry about that..... and thanks patrick for the recovery...... using patricks code gives very good results.... i created an expert advisor to test .... its easy to see the accuracy when you plot both your stop and a 3 exp moving average in the same window..... nuisance long stop loss
{put in your buy code, bc} bc:=C>Mov(C,10,S); lvl:=Mov(C,3,E)*.98; If(bc,lvl, If(ROC(C,1,%)>0,Max(lvl,PREV),PREV))
nuisance short stop
bc:=C<Mov(C,10,S); lvl:=Mov(C,3,E)*1.02; If(bc,lvl, If(ROC((Mov(C,3,E)),1,%)<0,Max(lvl,PREV),PREV));
just playing here with expert advsor to test bullish trend
Fml("nuisance long stop loss")<Mov(C,3,E)
bearish trend
Fml("nuisance long stop loss")>Mov(C,3,E)
that might not be exactly what you were hunting but should get you a little closer , nuisance..... and thanks again patrick......h
Patrick  
#6 Posted : Saturday, May 21, 2005 6:02:22 AM(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)
You don't need to thank me hayseed, I'm not even sure that's what nuisance wanted :D I worked in the formula department for a few years and you can't image the amount of request I received and completely misunderstood :lol: I got in trouble for it to :cry: Anyways next time I'm completely wrong just remember that I do it with the best intentions. Patrick :P
nuisance  
#7 Posted : Sunday, May 22, 2005 5:00:56 AM(UTC)
nuisance

Rank: Newbie

Groups: Registered, Registered Users
Joined: 5/19/2005(UTC)
Posts: 3

Thank you so much guys.. This is not 100% the same what i required, but it works anyway... :)
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.