Thanks a ton - but that is exactly what i am
struggling with -
I can manage the code logic for the trailing stop
loss but am stuck with
"Suppose you
have a variable, EnterLong, that becomes positive when you enter, then simply do
something like.."
How to program a variable which will track the
change in position OR the current position ?
what is the function for checking the current position and the change in
position ?
Regards
----- Original Message -----
Sent: Friday, May 06, 2005 7:15 PM
Subject: Re: [EquisMetaStock Group]
TRAILING STOP LOSS
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
Yahoo! Groups Links
|