[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] TRAILING STOP LOSS



PureBytes Links

Trading Reference Links

Hello Sharad, was just doing a little (actually, a lot!) of research 
on this very problem and came across this thread. If I understand 
correctly - you are looking for a way to designate / tell the system 
tester on which day a position was opened - such that any trailing 
stop can be programmed to operate from this day? My particular issue 
is that if you have several varying entry signals, yet you want to 
tell the system tester to trail a stop from the day of entry, it is 
impossible for it to discern from which day it should begin 
calculating (since, if one of the entry signals occurred 2 days ago, 
but the system was already long, then the trigger for the 
calculation of the trailing stop would have occurred 2 days ago - 
not the result intended.) Curious if you have found any solution / 
work around to this issue? Haven't given up hope yet..


--- In equismetastock@xxxxxxxxxxxxxxx, "MG Ferreira" <quant@xxxx> 
wrote:
> OK, so this gives the all time high.  Well, then let us work with
> that.  Suppose you want to use a level say 10% below this, then 
simply
> use something like
> 
> StopLevel := 0.9 * X;
> 
> to get it.  Also, if you don't want the all time high, just the
> highest high since entry, then simply reset it on entry.  Suppose 
you
> have a variable, EnterLong, that becomes positive when you enter, 
then
> simply do something like
> 
> X := Max( PREV, Y ) * ( EnterLong > 0 ) + Y * ( EnterLong <= 0 );
> 
> and the level will be equal to Y (probably the close) as long as 
you
> are out.
> 
> Regards
> MG Ferreira
> TsaTsa EOD Programmer and trading model builder
> http://www.ferra4models.com
> http://fun.ferra4models.com 
> 
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, "Sharad Lohia"
> <sharadlohia@xxxx> wrote:
> > Thanks for the suggestion but
> > X := Max( Ref(X,-1), Y )
> > does not provide the solution
> > 
> > and 
> > X := Max( PREV, Y )
> > gives the all the time high so far as the trailing stop loss 
level
> for calculation.
> > Thus each trade gets stopped out on the next bar.
> > It does not reset for every long or short position. 
> > 
> > 
> > Also - i want to program this condition - can someone help pls
> > > 
> > > if current position is long then....... if current position is
> > square then .... if current position is short then ...
> > > 
> > > what is the function for checking the current position ?
> > 
> > Any clues ?
> > 
> > Regards
> > 
> > 
> >   ----- Original Message ----- 
> >   From: MG Ferreira 
> >   To: equismetastock@xxxxxxxxxxxxxxx 
> >   Sent: Tuesday, May 03, 2005 3:32 PM
> >   Subject: Re: [EquisMetaStock Group] TRAILING STOP LOSS
> > 
> > 
> >   Hi Sharad,
> > 
> >   How about using the Max function, something like
> > 
> >   X := Max( Ref(X,-1), Y )
> > 
> >   will let X either take on Y if it is higher than the current X 
or stay
> >   at the current X.  You can also do the same using
> > 
> >   X := Max( PREV, Y )
> > 
> >   but this, I am told, is not good MS practise...
> > 
> >   Regards
> >   MG Ferreira
> >   TsaTsa EOD Programmer and trading model builder
> >   http://www.ferra4models.com
> >   http://fun.ferra4models.com 
> > 
> > 
> >   --- In equismetastock@xxxxxxxxxxxxxxx, "Sharad Lohia"
> >   <sharadlohia@xxxx> wrote:
> >   > Dear all,
> >   > 
> >   > Is there a Bug with "Trailing Stop Loss" in metastock. It 
does not
> >   seem to be working properly at all.
> >   > 
> >   > It should be programmable in Close Long / Short condition.
> >   > 
> >   > Hi:=ValueWhen(1,H>Ref(H,-1),H);
> >   > this catches the last swing top - which need not be the 
highest high
> >   in that particular long position.
> >   > 
> >   > Hi:=ValueWhen(1,H>Ref(Hi,-1),H);
> >   > this also does not work.
> >   > 
> >   > How can i update a variable value only when a fresh value of 
higher
> >   value is compared with its current value?
> >   > 
> >   > somethimes i feel excel is so much easier :-)
> >   > 
> >   > 
> >   > Also - i want to program this condition - can someone help 
pls
> >   > 
> >   > if current position is long then....... if current position 
is
> >   square then .... if current position is short then ...
> >   > 
> >   > what is the function for checking the current position ?
> >   > 
> >   > Thnx in advance
> >   > 
> >   > Regards
> > 
> > 
> > 
> > 
> > 
> > 
> >    
> >   Yahoo! Groups Links






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/