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
|