PureBytes Links
Trading Reference Links
|
Hi there, as far as I know there is not such a function, but I may be
wrong. To get the current position, use your own formulae, the ones
you use to enter & exit long and short. It is easiest if you have
just one formula for all of them, say a moving average crossover like
C>Mov(C,10,S) or cross(C,Mov(C,10,S))
enters long and
C<=Mov(C,10,S) or cross(Mov(C,10,S),C)
enters short
Then this formula
C - Mov(C,10,S)
gives you your current position.
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 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 -----
> From: MG Ferreira
> To: equismetastock@xxxxxxxxxxxxxxx
> 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 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/
|